安装vncserver后,默认的配置下只有一个很“朴素”的图形界面(没有抓图,就一个黑白窗口),要支持Ubuntu的桌面,并且支持和windows之前复制粘贴文字,需要修改xstartup配置文件如下:
root@myserver:~/.vnc$ cat 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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
gnome-session &
xcutsel &
The -nowin flag can be used if you always want clipboard support but don't wish to clutter the desktop with this window - alternatively the -iconic option can be used to make it iconified by default.