首先,确保系统已安装vnc-server软件包。VNC Server的配置很简单,首先使用vncpasswd设置登录密码:
1
2
3
|
# vncpasswd
Password:******
Verify:******
|
接下来,修改配置文件,使配置文件内容如下:
1
2
3
4
5
6
7
8
9
10
11
|
# 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,
1
2
3
4
5
6
7
8
9
|
# 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连接:
版权声明:原创作品,如需转载,请注明出处。否则将追究法律责任