linux下vncserver配置與win下vnc用戶端

來源:互聯網
上載者:User

VNC最初由AT&T開發,是一個對系統進行遠端管理的軟體.其操作方式類似於現在Windows下常見的遠端桌面,當然其資格比Windows的遠端桌面更老.在Windows下的VNC軟體有RealVNC等.

linux系統當然不支援Windows的遠端桌面登入,那麼我們如何用一台Windows的筆記本來管理一台linux的伺服器呢?

下載頁面:
http://www.realvnc.com/products/download.html
http://www.onlinedown.net/soft/45175.htm

首先,我們當然會考慮SSH,在linux下安裝SSH伺服器,然後在windows下使用puTTY登入進行管理.
但是現在,我們不滿足僅僅使用命令列方式,我們同樣想使用GUI介面.那麼:

1.在linux系統下安裝VNC Server,大多數linux發行版都帶了VNC Server的發行包.只要選擇安裝就可以了.
2. 在Windows下安裝VNC 用戶端,以RealVNC為例,VNC用戶端叫做VNC Viewer.VNC的使用相對比較簡單,輸入用戶端的IP,然後VNC會進行串連,然後彈出密碼框輸入密碼.沒有問題的話就串連上了.
3. 配置linux VNC Server.

(1)啟動VNC 服務.通過puTTY以SSH方式登入伺服器,假設使用者名稱為test

login as: test
 [test@MyServer's password:
 [test@xok.la ~]$ /etc/init.d/vncserver start
 Starting VNC server: no displays configured                [  OK  ]

(2)運行vncserver命令,如果第一次配置VNC Server,會要求提供登入VNC使用的密碼.以後也可以使用vncpasswd來修改密碼.

[test@xok.la ~]$ vncserver

 You will require a password to access your desktops.

 Password:123456
 Verify:123456
 xauth:  creating new authority file /root/.vnc/.Xauthority

 New 'xok.la.localdomain:1 (test)' desktop is xok.la.localdomain:1

 Creating default startup script /root/.vnc/xstartup
 Starting applications specified in /root/.vnc/xstartup
 Log file is /root/.vnc/xok.la.localdomain:1.log

(3)此時就可以在Windows使用VNC viewer登入了
輸入伺服器位址:192.168.0.64:1
然後提示輸入密碼,輸入你剛才設定的密碼就好了,如123456

注意:IP地址後面的:1的意思是linux上面VNC設定的Display No.每運行一個vncserver就會多建立一個Display,Display No也就會加一.
雖然此時可以登入,但是登入後看到的介面是X term的介面,還不是正常的X Window介面,我們要修改配置,使之使用X Window

(4)修改設定檔/root/.vnc/xstartup,使之與下面內容相同

  1. [test@xok.la .vnc]$ cat 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" &
twm &

(5)儲存檔案,在puTTY終端中輸入vncserver,讓VNC開啟一個新的Display

[test@xok.la ~]$ vncserver

 New 'xok.la.localdomain:1 (test)' desktop is xok.la.localdomain:2

 Starting applications specified in /root/.vnc/xstartup
 Log file is /root/.vnc/xok.la.localdomain:2.log

(6)使用VNC Viewer重新登入

win下VNC Viewer 下載(包括註冊碼在內):http://xok.la/file/2008/11/ha_vnc-e4_2_9-x86_win32.rar

輸入伺服器位址:192.168.0.64:2
然後提示輸入密碼,如123456

伺服器位址後面的Display No是根據第(5)步啟動並執行vncserver命令的結果來的
New ‘xok.la.localdomain:1 (test)’ desktop is xok.la.localdomain:2
所以Display No就是2,別忘記加冒號哦.

然後就看到你想要的介面了吧.
以後如果伺服器重新啟動後,要重新輸入vncserver後登入.如果伺服器一直開機,就不用了.

如果要殺掉vncserver 進程,可執行vncserver :1 kill ,1表示display的ID號

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.