CentOS 6.3下 VNC Server 的配置

來源:互聯網
上載者:User

作業系統:CentOS6.3

Linux 可以通過使用 SSH 遠端連線來進行控制,也可以在主機執行以下命令進行投射。

[root@localhost ~]# export DISPLAY=ipaddress:0[root@localhost ~]# xhost +

這個命令要求 ipaddress 的機器裝有 X Server(比如 Xmanager),但有時需要將遠程整個的 Linux 案頭投射到本地,這時仍可通過安裝配置 Xmanager 來實現。

本文主要介紹 VNC Server 的配置方法,需配置好 yum 源,文中的“主機”指安裝 Linux 的機器。

首先驗證主機上是否安裝 VNC Server,使用

[root@localhost ~]# yum list | grep vnc

的命令。返回

tigervnc.x86_64                        1.0.90-0.10.20100115svn3945.el6    @localtigervnc-server.x86_64                 1.0.90-0.10.20100115svn3945.el6    @local

就代表已經存在,否則就通過

[root@localhost ~]# yum install "*vnc*" pixman pixman-devel libXfont -y

的命令進行安裝。

單使用者root配置方法:

1. 啟動 VNC Server,這時會要求你輸入兩次進行串連的初始密碼。

[root@localhost ~]# vncserverYou will require a password to access your desktops.Password: //輸入密碼Verify: //再次輸入密碼xauth: creating new authority file /root/.XauthorityNew ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1Creating default startup script /root/.vnc/xstartupStarting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost.localdomain:1.log

這裡要注意:每個使用者都可以啟動多個 VNC Server 遠端桌面,它們用 ip 加連接埠號碼:ip:1、ip:2、ip:3 來標識區分,使用同一連接埠會使另外登入的使用者自動結束。另,VNC Server 的大部分設定檔及記錄檔都在使用者 home 目錄的.vnc 目錄下。

使用者可以自訂啟動號碼如:

[root@localhost ~]# vncserver :2        #注意:2前面一定要有空格。A VNC server is already running as :2

2. Red Hat Linux 支援兩種圖形模式:KDE 模式和 gnome 模式。

你的 Redh Hat 使用的什麼圖形模式這個一般只有登入到圖形介面查看一下才能知道,或者通過

[root@localhost ~]# ps -aux | grep gnome

這樣的命令來判斷。

如果是 gnome 案頭,那麼需要修改/root/.vnc/xstartup的設定檔。

使用 vi 開啟 xstartup 檔案,如下:

[root@localhost /]# cd /root/.vnc[root@localhost .vnc]# vi xstartup

刪除全部內容,然後添加如下內容:

-------------------------

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 -gemetry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#twm &

gnome-session &

-------------------------------

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.