標籤:vnc
實驗環境
Server:CentOS 6.5 x86_64
Client: Windows 7
安裝和配置VNC
1. [[email protected] ~]# yum install tigervnc-server -y
2. 修改vnc主設定檔
[[email protected]~]# vim /etc/sysconfig/vncservers
找到最後兩行,去掉注釋,修改為
VNCSERVERS="1:root" ###第一個遠端連線的賬戶為root
VNCSERVERARGS[1]="-geometry1200x900 "
###root遠程登入解析度為1200x900
3. 啟動vnc
[[email protected]~]# vncserver
Youwill require a password to access your desktops.
Password: ###這裡輸入串連遠端桌面的密碼
Verify: ###再次輸入密碼
xauth:(stdin):1: bad display name"gxh:1" in "add" command
New‘gxh:1 (root)‘ desktop is gxh:1
Creatingdefault startup script /root/.vnc/xstartup
Startingapplications specified in /root/.vnc/xstartup
Logfile is /root/.vnc/gxh:1.log
4. 修改xstartup檔案
[[email protected]~]# vim .vnc/xstartup
將最後兩行注釋掉,在最後一行添加如下:
#xterm-geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm&
gnome-session&
5. 設定vncserver開機啟動
[[email protected]~]# chkconfig vncserver on
6. 設定防火牆
VNCserver 監聽的連接埠從 5900 開始,display:1 監聽 5901,display:2監聽 5902,以此類推。
[[email protected]~]# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
[[email protected]~]# service iptables save
7. VNC Server配置完成
用戶端
8. 安裝vnc用戶端
1.9. 遠端連線vnc伺服器
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M00/8C/D7/wKioL1h7RryyzC25AABTM0jHfjo753.png-wh_500x0-wm_3-wmp_4-s_3540894085.png" title="v.png" alt="wKioL1h7RryyzC25AABTM0jHfjo753.png-wh_50" />
擴充命令
10. 添加一個display
[[email protected] ~]# vncserver
xauth: (stdin):1: bad display name "gxh:2" in"add" command
New ‘gxh:2 (root)‘ desktop is gxh:2
Starting applications specified in/root/.vnc/xstartup
Log file is /root/.vnc/gxh:2.log
11. 列出所有display
[[email protected] ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESSID
:1 2403
:2 2998
12. 關閉一個display
[[email protected] ~]# vncserver -kill :2
Killing Xvnc process ID 2998
[[email protected] ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESSID
:1 2403
13. 修改遠程登入密碼
[[email protected] ~]# vncpasswd
Password:
Verify:
VNC用戶端軟體推薦
VNC Viewer
TightVNC
RealVNC
TigerVNC
本文出自 “菜鳥行天下” 部落格,請務必保留此出處http://guoxh.blog.51cto.com/10976315/1892103
CentOS 6.5 安裝和配置 VNC!!!