Requirements and instructions
开发老大突然心血来潮,让实现在windows下通过vnc实现连接到CentOS系统的图形化界面,这里实践CentOS7.2下安装VNC,让Windows远程桌面Linux解决了不少问题,写个实际操做,如果你们碰到同样的问题,就可以迅速解决,无需头疼甚至放弃了。 说明:这里的系统为CentOS 7.2的图形化界面系统,
Start operation 1, install and install X-window
# yum check-update# 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 #重启机器
2. Installing VNC
# yum install tigervnc-server -y
3. Copy the service file from the VNC backup library to the system service Management directory "There is an error in the original, not creating [email Protected]:1.service folder"
# cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]:1.service #复制并被重命名为[email protected]:1.service
4, modify [email protected]:1.service file
[[email protected] system]# grep -n -v "^#" /etc/systemd/system/[email protected]\:1.service31:32:33:[Unit]34:Description=Remote desktop service (VNC)35:After=syslog.target network.target36:37:[Service]38:Type=forking39:User=root40:ExecStart=/usr/bin/vncserver :1 -geometry 1280x1024 -depth 16 -securitytypes=none -fp /usr/share/X11/fonts/misc41:ExecStop=/usr/bin/vncserver -kill :142:43:[Install]44:WantedBy=multi-user.target
Modify the file to make the configuration effective:
# systemctl daemon-reload
5. Set the password for [email Protected]:1.service]
# vncpasswd
6. Start VNC
# systemctl enable [email protected]:1.service #设置开机启动# systemctl start [email protected]:1.service #启动vnc会话服务# systemctl status [email protected]:1.service #查看nvc会话服务状态# systemctl stop [email protected]:1.service #关闭nvc会话服务# netstat -lnt | grep 590* #查看端口tcp 0 0 0.0.0.0:5902 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:5903 0.0.0.0:* LISTEN tcp6 0 0 :::5902 :::* LISTEN tcp6 0 0 :::5903 :::* LISTEN
8. Windows uses VNC to link to graphical interface
1, link the graphical interface server 5902 port
2. Enter the password previously set with VNCPASSWD
3. Successful link
CentOS7.2 installing VNC to allow Windows to remotely connect to the CentOS 7.2 graphical interface