首先安装vnc-server
yum install vnc vnc-server
安装过后执行
/** 注释
* Password 输入密码
* Verify 确认密码
* Would you like to enter a view-only password (y/n)? 选择N
*/
[root@yr ~]# vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
/**
* yr:1 就是后面要用的值
*
*/
New 'yr:1 (root)' desktop is yr: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/yr:1.log
执行
[root@yr ~]# export DISPLAY=yr:1
[root@yr ~]# xhost +
问题就解决