【Linux Ubuntu】華爲雲ECS安裝桌面版Ubuntu

如前幾篇所屬購買多家雲服務器商的Ubuntu服務器後,想使用桌面版,本文以華爲云爲例介紹桌面版Ubuntu的安裝。

連接Ubuntu桌面需要安裝VNC,即在Linux服務器上安裝VNC Server,在windows上安裝VNC Viewer

windows安裝VNC連接:VNC

1.Windows 安裝VNC Viewer

2.Shell遠程連接服務器

使用XShell連接華爲雲,賬號是root,連接後更新軟件庫、升級軟件並安裝桌面

# 更新軟件庫
apt-get update

# 升級軟件
apt-get upgrade

# Linux服務器安裝VNC Server
apt-get install vnc4server

# 重啓服務器
reboot

3.啓動VNC

# Linux啓動VNC服務
vncserver

啓動VNC服務後需要輸入密碼,這個密碼就是在windows上連接Ubuntu界面時要輸入的密碼,密碼最長八位

後面要修改的xstartup文件位置在綠色框內 /root/.vnc/xstartup

4. Gnome 桌面環境安裝與配置

# 安裝x-windows的基礎
sudo apt-get install x-window-system-core
# 安裝登錄管理器
sudo apt-get install gdm
# 安裝Ubuntu的桌面
sudo apt-get install ubuntu-desktop
# 安裝gnome配套軟件
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
# 修改VNC配置文件
vi ~/.vnc/xstartup

xstartup文件修改爲(如不修改連接後出現灰色界面和X形鼠標不能夠正常使用):

#!/bin/sh

# Uncomment the following two lines for normal desktop:
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# xterm -geometry 80x24+10+10 -ls -tile "$VNCDESKTOP Desktop" &
# gnome-session &

# x-session-manager & xfdesktop & xfce4-panel &
# xfce4-menu-plugin &
# xfsettingsd &
# xfconfd &
# xfwm4 &

x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

5. 關閉原桌面進程並重啓

# 1是指桌面號,第三步啓動VNC服務後會有一個 :1,就是這個1
vncserver -kill :1

# 重新啓動VNC桌面進程
vncserver :1

6.在華爲雲控制檯的安全組裏打開VNC服務需要用到的5900和5901端口

7.Windows端打開VNC,注意要加:1桌面號,之後要輸入第三步中的密碼

8. 連接成功

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章