1、系統軟件設置
CentOS端:
查看是否安裝了vnc軟件
# rpm -q vnc vnc-server
package vnc is not installed
vnc-server-4.1.2-14.e15_3.1
上面信息就是說,vnc沒有安裝,而vnc-server已經安裝了。
那麼,安裝 vc
# yum install vnc
如果vnc-server沒有安裝,那麼
# yum install vnc-server
Ubuntu端:
安裝vnc4server
$ sudo apt-get install vnc4server
設置密碼
$ vncpasswd
password:
verify:
$ vim ~/.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-window-manager &
修改之後是:
注釋最後兩行,也就是在前面加 #
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
然後加上
gnome-session &
$ vnc4server
Warning: user-MS-7549:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server user-MS-7549:1
xauth: creating new authority file /home/user/.Xauthority
New 'user-MS-7549:2 (user)' desktop is user-MS-7549:2
Creating default startup script /home/user/.vnc/xstartup
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/user-MS-7549:2.log