Win10子系統-Ubuntu安裝及配置VNC訪問XFCE4桌面

出這篇博客的原因就是爲了使大家少走彎路,從最開始安裝Ubuntu子系統到配置VNC圖形化界面訪問,完全一步一步走下來,自己也是嘗試了很多,最後確定了這個子系統操作方案,那麼首先第一步就是進入win10的啓用或關閉windows功能,打開如下功能:適用於Linux的Windows子系統,然後就可以進入應用商店下載安裝Ubuntu了,這裏我安裝的是18.04版本

現在可以從菜單直接進入Ubuntu界面,系統會自動安裝和初始化,根據提示輸入自己的用戶名和密碼(密碼用來進入root)然後我們切換到root用戶,並打開編輯軟件源,具體的VIM用法大家可以自行百度,就不贅述了

sudo -s
#輸入你的密碼
vim /etc/apt/source.list
#配置軟件源

這裏我採用阿里雲的源,這個是官方鏡像站https://developer.aliyun.com/mirror/ubuntu,將原來的軟件源刪掉,複製下面對應版本的軟件源到文件中,保存並退出

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

然後執行升級,遇到選項就選YES

apt-get update
apt-get upgrade

下面我們開始安裝xfce4桌面,再繼續安裝vncserver,安裝完成後,Bash輸入vncserver進行初始化,輸入VNC遠程連接的密碼

apt-get install xfce4 vnc4server
vncserver

然後配置vnc啓動文件,在末尾加上startxfce4 &,保存並退出,然後重啓服務

 vim ~/.vnc/xstartup

下面可以通過這兩個命令配置開啓或關閉vnc端口,我這裏用的端口0

vncserver :0
vncserver -kill :0

完成以後就可以打開VNC viewer,輸入子系統地址和端口號進行連接

完成後,就可以進入VNC界面,點擊default桌面設置,可以看到配置完成後畫面如下

 

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