Preface
This guide explains how to configure VNC-server in CentOS 7.0 server. It is a very convinient way of administrating the CentOS 7.0 with the help of GUI(Graphics User Interface). The GUI can be access any where with the help of the VNC-client on any OS. The basic condition is that the connecting OS must have VNC-clients installed in it.
2 Installation
I am logged in my system with root, & now I will be installing the VNC-server.
3 Adding VNC user
In my case I am using user=vncuser it will differ in your case. You can use any username for the same. In CentOS 7.0 there is change in the vncserver configuration file. Before ContOS 7.0 it was /etc/sysconfig/vncservers and now it have changed in /lib/systemd/system/vncserver@.service. Next I will use the original file and create the configuration file as shown:
Now we will edit the file as follows:
Replace the string
- [Unit]
- Description=Remote desktop service (VNC)
- After=syslog.target network.target
- [Service]
- Type=forking
- # Clean any existing files in /tmp/.X11-unix environment
- ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
- ExecStart=/usr/sbin/runuser -l vncuser -c "/usr/bin/vncserver %i"
- PIDFile=/home/vncuser/.vnc/%H%i.pid
- ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
- [Install]
- WantedBy=multi-user.target
Now switch to the vncuser just created above and start the vnc service as:
Now make the service enabled on after every reboot with root credentials:
4 VNC Client
Windows
Download link of TightVNC.
(Using port 5901->5900 + 1 (Xvnc :"1"))
Linux/Unix
Download link of RealVNC
沒有留言:
張貼留言