第一步:用root登陆linux,启动vnc服务;


第二步:根据vnc起来的端口,设置export DISPLAY=localhost:1(1表示vnc在第一个tty上启动的)


第三步:执行xhost +,并且提示“access control disabled, clients can connect from any host”才正确。


linux下的操作日志如下:

[root@localhost ~]# vncserver


New 'localhost:1 (root)' desktop is localhost:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost:1.log


[root@localhost ~]# export DISPLAY=:0.0


[root@localhost ~]# xhost +


摘自:http://hi.baidu.com/meng2087/blog/item/c279578b13d977779e2fb4f5.html