Ubuntu VNC4Server
8月 12th, 2009,由 frank撰写
1. 安装vnc4server
[email protected]:~# sudo apt-get install vnc4server
2. 设置vnc密码
[email protected]:~# vncpasswd Password: Verify:
3. 开启vncserver
[email protected]:~# vncserver :1 New 'frank-desktop:1 (root)' desktop is frank-desktop:1 Starting applications specified in /home/frank/.vnc/xstartup Log file is /home/frank/.vnc/frank-desktop:1.log
4. 通过vncserver登陆ubuntu
任何vnc客户端都可以,我用的是vnc views。
在登录地址输入:192.168.1.102:1
密码输入:
5.自动启动vncserver
由于每次重启后需要手动打开vnc,很麻烦,所以需要让他自动启动。
然而现在还没解决,解决后再更新。
2010-05-08更新注意:
最近刚刚把Ubuntu升级到了10.04版,但是发现VNC不能用了,并报下面的错误:
[email protected]:/etc/init.d# vncserver :1 vncserver: Wrong type or access mode of /home/frank/.vnc.
可以通过下面的命令解决此问题:
[email protected]:/etc/init.d# su - root bash -c "vncserver :1" You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /root/.Xauthority New 'frank-desktop:1 (root)' desktop is frank-desktop:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/frank-desktop:1.log
分析:
有可能是权限问题,测试后发现在用户模式下,可以正常登录,也许在10.04下权限比较严吧。
[email protected]:~$ vncserver :3 You will require a password to access your desktops. Password: Verify: xauth: /home/frank/.Xauthority not writable, changes will be ignored New 'frank-desktop:3 (frank)' desktop is frank-desktop:3 Starting applications specified in /home/frank/.vnc/xstartup Log file is /home/frank/.vnc/frank-desktop:3.log