CentOS7安裝GNOME桌面和VNC遠程桌面服務(wù)
- CentOS7安裝GNOME桌面
#yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
啟動GNOM桌面可使用
startx
命令
- CentOS7安裝配置VNC遠程GUI桌面服務(wù)
VNC用于遠程桌面連接
安裝
#yum -y install tigervnc-server
配置
#cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
設(shè)置VNC密碼
#vncpasswd
重啟systemd
#systemctl daemon-reload
設(shè)置永久開啟VNC服務(wù)
#systemctl enable vncserver@:1.service
啟動VNC服務(wù)
#systemctl start vncserver@:1.service
如遇報錯:
Job for vncserver@:1.service failed because the control process exited with error code. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.
編輯/etc/systemd/system/vncserver@:1.service配置文件:
將Type=forking改為Type=simple
重新啟動VNC服務(wù)
#systemctl restart vncserver@:1.service
查看VNC服務(wù)狀態(tài)
#systemctl status vncserver@:1.service
如有Activie:failed則表示啟動失敗
編輯/etc/systemd/system/vncserver@:1.service配置文件:
將里面所有的<USER>替換為當(dāng)前用戶名(大致有兩處)歹垫,如root财饥;另底挫,如果是root用戶,應(yīng)將PIDFile的/home/root改為/root
重新啟動VNC服務(wù)
#systemctl restart vncserver@:1.service
- VNC客戶端連接
- VNC遠程服務(wù)端需開放5901端口
- 客戶端安裝VNC Viewer或TigerVNC
- 連接地址填寫ip:5901
- 然后輸入所設(shè)置的VNC密碼