2016年10月6日 星期四

[Linux 文章收集] VNC-Server installation on CentOS 7

Source From Here 
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. 
# yum groupinstall "GNOME Desktop"
# yum install tigervnc-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: 
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

Now we will edit the file as follows: 
# vi /etc/systemd/system/vncserver@:1.service

Replace the string with appropriate vncuser’s username. In my case I will be using the user vncuser just created above: 
  1. [Unit]  
  2. Description=Remote desktop service (VNC)  
  3. After=syslog.target network.target  
  4.   
  5. [Service]  
  6. Type=forking  
  7. # Clean any existing files in /tmp/.X11-unix environment  
  8. ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'  
  9. ExecStart=/usr/sbin/runuser -l vncuser -c "/usr/bin/vncserver %i"  
  10. PIDFile=/home/vncuser/.vnc/%H%i.pid  
  11. ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'  
  12.   
  13. [Install]  
  14. WantedBy=multi-user.target  
If you wish to add more users you would create a new vncserver@:#.service file and change the string to the new users. Then is Firewall settings: 
# firewall-cmd --permanent --zone=public --add-service vnc-server
# firewall-cmd --reload

Now switch to the vncuser just created above and start the vnc service as: 
# su vncuser // Switch to 'vncuser'
# vnserver // You are required to enter your vnc password here
# ps aux | grep Xvnc // Check the vncserver process is up
...
... /usr/bin/Xvnc :1 -desktop private-repo:1 (vncuser) -auth /home/vncuser/.Xauthority

Now make the service enabled on after every reboot with root credentials: 
# systemctl daemon-reload
# systemctl enable vncserver@:1.service
# systemctl start vncserver@:1.service


4 VNC Client 

Windows 
Download link of TightVNC. 

(Using port 5901->5900 + 1 (Xvnc :"1")

Linux/Unix 
Download link of RealVNC 

沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...