Installation and Configuration vncserver centos 7

Transfer from http://blog.csdn.net/a105421548/article/details/38437639


These days corporate training, there is a senior trial recommended under centos7, training more than just a bit of free time and a server. He began to fiddle with the server. I began centos installed on the server 7. Taking into account the needs of remote desktop control of ready to install vncserver.

installation steps:

       Turn off the firewall, centos firewall is firewalld, turn off the firewall command systemctl stop firewalld.service. Close enforce, setenforce 0.

 1.安装tigervncserver,yum install tigervnc-server tigervnc-server-module

 2. Copy the configuration file cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service

 3. Go to your profile directory cd / etc / systemd / system

 4. Modify the configuration file vim vncserver @: 1.service

Configuration file contents:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
User=root
ExecStart=/usr/bin/vncserver :1 -geometry 1280x1024 -depth 16 -securitytypes=none -fp /usr/share/X11/fonts/misc
ExecStop=/usr/bin/vncserver -kill :1

[Install]
WantedBy=multi-user.target

 5. Enable profile  systemctl enable vncserver @: 1.service

 6. Set login password: vncpasswd

 7. Start vncserver: systemctl Start vncserver @: 1.service

 8. Start Status View: systemctl vncserver @ Status: 1.service

 9. Review the Port Status: netstat LNT | grep 590 *

 10. Check error message: grep VNC / var / log / messages



Question: landlord, according to your approach, built after win7 under the VNC-Viewer to open a remote desktop is black, the landlord encountered such a situation it

Add a line in the gnome-session & xstartup file and vncserver -kill: 1, and then start vncserver: 1 on it!


Linux VNC black (rpm)

If the remote VNC desktop Linux is not entered for a long time, so when using VNC View to open a remote linux desktop, the desktop does not show up, show a black screen, and click on the keyboard or mouse is still no response, still a black screen.
This time on the need to set up vnc server.

Edit /root/.vnc/xstartup 
[root@localhost ~]# vi /root/.vnc/xstartup   

Remove the following two lines of comment: 
unset SESSION_MANAGER  
exec /etc/X11/xinit/xinitrc  
Execute the following command to restart the vnc server:
[root@localhost ~]# vncserver -kill :1  
[root@localhost ~]# vncserver :1 



If you need to use Centos 7 may default firewall

[root@wic ~]# firewall-cmd --permanent --add-service vnc-server
[root@wic ~]# systemctl restart firewalld.service

The sixth step, set up and turned on by default VNC

[root@wic ~]# systemctl enable vncserver@:1.service
[root@wic ~]# systemctl start vncserver@:1.service


Guess you like

Origin blog.csdn.net/ptianfeng/article/details/44745809