主要參考這篇博客
更新
apt update -y
apt
下載必要的包
在linux系統(tǒng)下扼褪,桌面其實只相當(dāng)于一個程序,不同的桌面對應(yīng)不同的程序呀舔,因此需要下載不同的程序包弥虐。
所有的包
apt install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y
部分包( office扩灯、瀏覽器、等等的額外組件)
apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y
vncserver安裝
apt install vnc4server -y
配置
需要改動 ~/.vnc/xstartup
文件,在 x-window-manager & 的后面新增下面這 4 行:
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
完整的配置
#!/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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
啟動霜瘪、關(guān)閉和訪問
vncserver # 啟動
vncserver -kill :number # 關(guān)閉
訪問的話需要VNC客戶端
去鏈接珠插,連接的地址是:
youip:5901
5901
是相對于桌面號碼,vncserver命令執(zhí)行后颖对,會有對應(yīng)的號碼捻撑。一般是 :1 / : 2遞增,在連接的時候?qū)?yīng)5901
缤底、5902
顾患。