CentOS 7.6 配置VNC遠端訪問伺服器圖形介面
阿新 • • 發佈:2019-07-17
CentOS 7.6 配置VNC遠端訪問伺服器圖形介面
1. 安裝VNC
1.1 安裝圖形介面
yum groupinstall "development tools"
yum groupinstall "gnome desktop"
1.2 安裝配置vnc
yum install tigervnc tigervnc-server -y
vncserver :n
#這裡的n是 sessionnumber,不指定預設為1,也可以是2、3等等。第一次會提示輸入密碼,以後可以使用 vncpasswd 命令修改密碼。
具體如下:
[root@oracle ~]# vncserver :1
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:
xauth: file /root/.Xauthority does not exist
New 'oracle.sysit.cn:1 (root)' desktop is oracle.sysit.cn:1
Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/oracle.sysit.cn:1.log
[root@oracle ~]# netstat -antlp | grep vnc
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 31009/Xvnc
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 31009/Xvnc
tcp6 0 0 :::5901 :::* LISTEN 31009/Xvnc
tcp6 0 0 :::6001 :::* LISTEN 31009/Xvnc
1.3 關閉vncserver
[root@oracle ~]# vncserver -kill :1
Killing Xvnc process ID 31009
1.4 指定解析度和色深
預設引數,vncserver 顯示會圖示解析度會比較小,我們可以指定引數。
vncserver :1 -geometry 1366x768 -alwaysshared -depth 24
- -geometry 指定解析度,-alwaysshared代表允許多使用者同時登入, -depth代為色深,引數有8,16,24,32。
2. 使用vnc-viewer訪問
vnc-viewer下載地址:http://www.canadiancontent.net/tech/download/VNC_Viewer.html
至此可以遠端操作。
如果覺得