Friday, September 25, 2015

Install VNC Server on CentOS 7

Install VNC Server on CentOS 7

VNC Server IP: 124.124.124.143

Remote to VNC Server, Login as root and install the packages

Install dependency packages
yum groupinstall "X Window System"
yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

unlink /etc/systemd/system/default.target

ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

Reboot Server
reboot

Install VNC Server
yum install tigervnc-server

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

Now open /etc/systemd/system/vncserver@:1.service file and replace with your username .
Find these lines ..

I am create for user root in this case
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid


Reload systemd for changes.
systemctl daemon-reload

Create VNC password for the user .
vncpasswd

Enable service at startup
systemctl enable vncserver@:1.service

Start the service .
systemctl start vncserver@:1.service


Allow VNC service and restart firewall
firewall-cmd --permanent --add-service vnc-server
systemctl restart firewalld.service


Click Continue

Conected.


To stop VNC service .
systemctl stop vncserver@:1.service

To disable VNC service from startup ( permanent ).
systemctl disable vncserver@:1.service

To stop firewall ( For troubleshooting ).
systemctl stop firewalld.service


#VNC #CentOS #Server #Vannakk

No comments:

Post a Comment