歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux桌面 >> Windows下VNCViewer遠程連接Linux桌面

Windows下VNCViewer遠程連接Linux桌面

日期:2017/3/6 9:46:33   编辑:Linux桌面

Windows下VNCViewer遠程連接Linux桌面


Windows下VNCViewer遠程連接Linux桌面


一:服務器端(Centos6.5)

1:安裝桌面:

# yum groupinstall "GNOME Desktop Environment"(CentOS 5.x安裝GNOME桌面環境)

# yum groupinstall "X Window System""Desktop"(CentOS 6.x安裝GNOME桌面環境)

2:安裝vncserver

(1) 檢查是否已經安裝了VNCServer

[java]view plaincopyprint?
  1. [root@centos6~]#rpm-qa|grepvnc
  2. tigervnc-1.0.90-0.17.20110314svn4359.el6.i686
  3. gtk-vnc-0.3.10-3.el6.i686
  4. tigervnc-server-1.0.90-0.17.20110314svn4359.el6.i686
  5. gtk-vnc-python-0.3.10-3.el6.i686
[java]view plaincopyprint?
  1. <spanstyle="font-family:Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);">如果上面的幾個rpm包已經存在,說明VNCserver已經安裝好了,接下來跳轉步驟(3)啟動vncserver就可以了,否則執行步驟(2)</span>

(2) 安裝vncServer

[java]view plaincopyprint?
  1. #yuminstalltigervnc
  2. #yuminstalltigervnc-server

(3)啟動vncserver

第一次啟動vncserver需要輸入密碼兩次

[java]view plaincopyprint?
  1. [root@centos6mnt]#vncserver
  2. Youwillrequireapasswordtoaccessyourdesktops.
  3. Password:
  4. Verify:
  5. New'centos6.xman.org:1(root)'desktopiscentos6.xman.org:1
  6. Creatingdefaultstartupscript/root/.vnc/xstartup
  7. Startingapplicationsspecifiedin/root/.vnc/xstartup
  8. Logfileis/root/.vnc/centos6.xman.org:1.log

注意:

# /etc/init.d/vncserver restart

注:有時候上面的命令啟動會報錯,直接運行就可以:

# vncserver

注:關閉具體的vncserver命令:vncserver -kill :1vncserver -kill :2

(4) 設置遠程登陸到gnome桌面的配置:

# vim /etc/sysconfig/vncservers(SUSE企業版不用配置此文件)

再最後面加入如下兩行:

VNCSERVERS="1:root"

VNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared-depth 24"

注意:如果windows連接的時候出現黑屏(在ip地址和端口沒有輸出錯誤的情況下),可將這裡的分辨率改為800x600.

(5)防火牆的設置

不設置防火牆連接的時候有可能會被阻止,這是可以選擇關閉防火牆或者將VNC的服務器端口號加入到防火牆的信任列表中:

關閉防火牆:service iptables stop

或者:將VNC server添加到linux的防火牆信任列表中

[java]view plaincopyprint?
  1. [root@centos6u2~]#vim/etc/sysconfig/iptables
  2. #thenaddbelowlinetothisfile
  3. -AINPUT-mstate--stateNEW-mtcp-ptcp--dport5900:5910-jACCEPT
  4. #restartiptables
  5. [root@centos6u2~]#serviceiptablesrestart

防火牆的其它操作可見:http://blog.csdn.net/jemlee2002/article/details/7042991

二:客戶端(windows)

接下來可以在網上下載http://vnc-pe.softonic.cn/vncviewer進行安裝。打開輸入ip地址和端口號。這裡的端口號我也沒有弄清楚,我這裡輸入的是1,你可以試試2 或者5901或者5902,具體我沒有研究,有明白的也可以告訴我。

參考文獻:1:http://www.cnblogs.com/wise-man/archive/2012/07/23/2604023.htmlCentOS 6安裝和配置VNC

2: http://www.ha97.com/4634.html#comment-322709 CentOSLinux下VNC Server遠程桌面配置詳解

3:http://blog.sina.com.cn/s/blog_6e0c0fdf010198pl.html TightVNC Windows下遠程連接Linux桌面

http://xxxxxx/Linuxjc/1134281.html TechArticle

Copyright © Linux教程網 All Rights Reserved