Skip to content

Instantly share code, notes, and snippets.

@alkavan
Last active August 13, 2017 17:40
Show Gist options
  • Select an option

  • Save alkavan/e0960383825294c0219816274b998fc6 to your computer and use it in GitHub Desktop.

Select an option

Save alkavan/e0960383825294c0219816274b998fc6 to your computer and use it in GitHub Desktop.
CentOS 7.x - Google Cloud - 1 GPU - Bootstrap Instructions

Bootstrap Instructions

CentOS 7.x | Google Cloud | 1 GPU

Stage 1 - System update and common setup procedure

Update system

# yum update

Set system time to UTC timezone

# timedatectl set-timezone UTC

Install Linux development tool set

yum groupinstall "Development Tools"

Install NVIDIA drivers from ELRepo

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

Install X Window System

yum groupinstall "X Window System"

Install NVIDIA official Linux driver

# yum --nogpgcheck localinstall 

Install Server GUI packages

# yum groups install "Server with GUI"

Set system graphical target default

# systemctl set-default graphical.target

Enable vncserver service and add to firewall

# yum install tigervnc-server
# cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
# nano /etc/systemd/system/vncserver@:1.service

As root:

ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid

As user 'john':

ExecStart=/sbin/runuser -l john -c "/usr/bin/vncserver %i"
PIDFile=/home/john/.vnc/%H%i.pid

Reload daemon and enable in firewall

# systemctl daemon-reload
# vncpasswd
# systemctl enable vncserver@:1.service
# systemctl start vncserver@:1.service
# firewall-cmd --permanent --add-service vnc-server
# systemctl restart firewalld.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment