安裝方法
sudo apt-get install vnc4server vnc-java
默認(rèn)端口從5901開始
修改 ~/.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
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop"
x-server-manager
這個配置是不能進(jìn)入桌面的
把最后一行x-server-manager 修改為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
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop"
gnome-session
這時候重啟服務(wù)即可
[root@fancyos ~]# vncserver -kill :1
[root@fancyos ~]# vncserver :1