歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下VNCServer配置詳解

Linux下VNCServer配置詳解

日期:2017/2/28 15:48:42   编辑:Linux教程

VNC服務是Linux系統經常使用的一種服務,配置起來也不復雜,以下為詳細配置方法:

第一步:設置密碼

[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

Copyright © Linux教程網 All Rights Reserved