一般在 CentOS 6 安裝桌面環境時,步驟如下:
yum -y groupinstall "General Purpose Desktop" "X Window System" "Desktop"
在我們的 VPS 若安裝時已選擇含 "Gnome Desktop" 的作業系統,則上述 group 已經安裝好了 ,我們只需要安裝中文支援即可:
yum -y groupinstall "chinese support"
接下來編輯此檔案:
vi /etc/sysconfig/i18n
LANG="en_US.UTF-8" 改為 LANG="zh_TW.UTF-8"
若此檔案不存在則直接加上 LANG="zh_TW.UTF-8" 內容後存檔離開
接下來重開機使設定生效:
shutdown -r now
最後設定 VNC,直接輸入(未安裝 VNC Server 可用此指令安裝:yum install tigervnc-server ):
vncserver
開機啟用 VNC:
/sbin/chkconfig vncserver on
系統會請您設定 VNC 密碼:
[[email protected] ~]# vncserver
You will require a password to access your desktops.
Password:********
Verify:********
xauth: creating new authority file /root/.Xauthority
New 'demo.server.com:1 (root)' desktop is demo.server.com:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/x03.server.com:1.log
[[email protected] ~]#
接下來您可以用 VNC Viewer 來連線了 ( 下載 UltraVNC,請點此進入 官網 )
假設您的 IP 是 10.10.10.10 ,則請輸入 10.10.10.10:1,如下圖: