VNC

Ubuntu 9/11
sudo apt-get install ubuntu-desktop --no-install-recommends
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" &
gnome-session & # support for GNOME
startkde $ #support for KDE
Lubuntu

編輯 .vnc/xstartup

/usr/bin/lxsession -s Lubuntu -e LXDE
CentOS

CentOS 6:

yum groupinstall Desktop
yum install tigervnc tigervnc-server

設定 VNC 密碼

vncserver

編輯 ~/.vnc/xstartup

# 移除註解
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

設定開機後自動啟動

/etc/sysconfig/vncservers

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1280x1024"     #這行可不加
chkconfig vncserver on

CentOS 5:

# Install
yum install vnc-server

# Set the password for vnc
vncserver

/root/.vnc/xstartup

xsetroot -solid grey
vncconfig -iconic &
gnome-session &   # 加這行
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & # 註解這行
#twm & # 註解這行

重啟 vncserver

vncserver -kill :1
vncserver

畫面解析太小

vncserver -geometry 1280x960
Learning