CentOS6安裝vncserver實現圖形化訪問

來源:互聯網
上載者:User

CentOS6安裝vncserver實現圖形化訪問

一、配置163的yum源

1.匯入CentOS-6的GPG認證

#rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

2.讓yum使用網易的源:

#cd /etc/yum.repos.d/

#wget http://mirrors.163.com/.help/CentOS-Base-163.repo

3.修改repo檔案

在所有mirrorlist前面加上#,把所有$releasever替換成6,儲存

#sed -i '/mirrorlist/d' CentOS-Base-163.repo

#sed -i '/\[addons\]/,/^$/d' CentOS-Base-163.repo

#sed -i 's/\$releasever/6/' CentOS-Base-163.repo

#sed -i 's/RPM-GPG-KEY-CentOS-5/RPM-GPG-KEY-CentOS-6/' CentOS-Base-163.repo

4.清理並重建yum緩衝

#yum clean metadata

#yum makecache

二、安裝gnome圖形化案頭

#yum groupinstall -y "X Window System"

#yum groupinstall -y "Desktop"

#yum groupinstall -y "Chinese Support"

三、安裝vncserver並配置

1.安裝vncserver

#yum install -y tigervnc-server

2.配置vncserver

1).配置為開機自啟動

#chkconfig --level 345 vncserver on

2).配置vnc密碼

#vncserver

You will require a password to access your desktop.

Password:

Verify:

3).配置為使用gnome案頭

修改 /root/.vnc/xstartup檔案,把最後的 twm & 刪掉 加上 gnome-session &。

4).配置vncserver啟動後監聽連接埠和環境參數

修改/etc/sysconfig/vncservers 檔案添加以下內容

VNCSERVERS="1:root"

# 案頭號:使用者 監聽 590* 連接埠

VNCSERVERARGS[1]="-geometry 1200x800"

5).重啟vncserver服務

#service vncserver restart

四、允許root訪問圖形介面和產生新的machine-id

#sed -i 's/.*!= root.*/#&/' /etc/pam.d/gdm#dbus-uuidgen >/var/lib/dbus/machine-id

五、關閉selinux和NetworkManager服務

1.檢查selinux服務並關閉

#vi /etc/selinux/config

確認裡面的SELINUX欄位的值是disabled,如果不是則改為disabled。

2.關閉NetworkManager服務

#chkconfig --del NetworkManager

六、測試登入:

聯繫我們

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