1. 安装gonme核心包(若是字符界面)
apt-get install x-window-system-core
apt-get install gnome-core
apt-get install metacity
apt-get install gnome-desktop-environment (optional)
2. 安装 vnc4server
apt-get install vnc4server
3. 设置vncserver密码
vncpasswd
4. 启动VNC server
vncserver
5. 关闭 (:1表示5901端口)
vncserver -kill :1
6. 修改~/.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 &
7. 在服务器端退出gnome,否则客户端登录会出现字符界面。
sudo /etc/init.d/gdm stop