首先,确保系统已安装vnc-server软件包。VNC Server的配置很简单,首先使用vncpasswd设置登录密码:
# vncpasswd Password:****** Verify:******
接下来,修改配置文件,使配置文件内容如下:
# cat .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 &
按如下方式启动vncserver,
# vncserver & [3] 8079 [root@master ~]# New 'master.liucc.com:1 (root)' desktop is master.liucc.com:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/master.liucc.com:1.log [3] Done vncserver
这样,就产生了一个连接,就是上面的“master.liucc.com:1”。在客户端使用vnc viewer连接: