我在windows安装了VNC Viewer,远程连接ubunt12.04服务器,发现远程桌面只有一个终端,没有桌面。。。 shell
从网上查了一些资料,问题得以解决,记录以下: ubuntu
修改~/.vnc/xstartup为: windows
# Uncomment the following two lines for normal desktop: unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #x-window-manager & export DESKTOP_SESSION=Ubuntu-2d export GDMSESSION=ubuntu-2d export STARTUP="/usr/bin/gnome-session --session=ubuntu-2d" $STARTUP
zhangxu@zhangxu-OptiPlex-9010:~/.vnc$ vnc4server -kill :2 (kill后的序号根据实际状况来)
zhangxu@zhangxu-OptiPlex-9010:~/.vnc$ vnc4server 服务器
实际效果图 session