ubuntu上安装vnc4server

1、apt-get install vnc4server xinted

2、vi /root/.vnc/xstartup

   1)解开注释:unset行,exec行;
   2)注释掉后面的行:xsetroot行,vncconfig行,xterm行,twm...

3、chmod 755 /etc/X11/xint/xinitrc

4、启动:vnc4server ,注意几下 ubuntu:x 中的x是几

5、netstat -antpl查看启动的端口是多少:

root@ubuntu:~/.vnc# netstat -antpl
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:6003            0.0.0.0:*               LISTEN      12350/Xvnc4    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      7338/sshd      
tcp        0      0 192.168.234.124:22      192.168.234.10:1824     ESTABLISHED 11536/2        
tcp        0      0 192.168.234.124:22      192.168.234.10:1993     ESTABLISHED 9154/0         
tcp6       0      0 :::5903                 :::*                    LISTEN      12350/Xvnc4    
tcp6       0      0 :::22                   :::*                    LISTEN      7338/sshd

可以看出port=5903

6、用vnc客户端就可以连接了。

猜你喜欢

转载自mayatama.iteye.com/blog/1634271