Linux下VNCServer配置詳解
第一步:設置密碼
[root@ www.linuxidc.com ~]# vncpasswd
password:
Verify:
第二步:啓動一個vncserver session
[root@ www.linuxidc.com ~]# vncserver
這個時候會創建一個/root/.vnc/xstartup文件
第三步:修改生成的xstartup文件,注意粗體字
[root@ www.linuxidc.com ~]# vi /root/.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 &
.......
第四步:修改系統vacserver服務配置
[root@ www.linuxidc.com ~]# vi /etc/sysconfig/vncservers
打開文件後添加以下內容:
VNCSERVERS="1:root"
VNCSERVERARGS[1]=”-geometry 800×600 -alwaysshared -depth 24″
-alwaysshared代表允許多用戶同時登錄 -depth代爲色深,參數有8,16,24,32。
第五步:重啓vncserver
[root@ www.linuxidc.com ~]# /etc/init.d/vncserver restart 或 start 或 stop