- 安装:
- sudo apt-get install vnc4server
- ~/.vnc/xstartup 修改该文件如下:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &# twm &gnome-session &
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &# twm &gnome-session &
- vncserver :1 启动服务
- 使用tightvnc连接,格式为IP:1
- 问题:Could Not Acquire Name On Session Bus
- 原因是两个用户不能使用同一个gnome会话。两种方法:
- 主机上退出gnome桌面程序,远程就可以连上了;
unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER
D键无法使用
Ubuntu默认使用D键作为快捷键显示桌面。因此,禁用改快捷键或者绑定到其他按键上去。