上一篇文章主要說了,win10怎麼安裝ubuntu子系統
並將其從默認的C盤遷移到F盤下
這一篇文章主要講,給ubuntu安裝圖形界面,並通過windows遠程桌面程序連接。
先看效果圖
安裝圖形界面
所有操作我們使用root來操作,所以先設置密碼
sudo passwd
然後切換到root用戶
默認源在國外,速度很慢,備份並切換為國內的源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
之後編輯源文件 vim /etc/apt/sources.list
dG清空文件內容後,右鍵粘貼內容,:wq 保存即可
修改後執行命令
sudo apt-get update
安裝圖形界面
1、安裝xorg這個基礎軟件環境,命令是:
sudo apt-get install xorg
2、安裝xfce這個桌面環境,安裝命令是:
sudo apt-get install xfce4
3、安裝xrdp這個軟件,xrdp這個軟件的作用是提供一個windows遠程桌面的服務端,讓windows主機可以通過常用的遠程桌面工具連接到linux服務器上。安裝命令是:
sudo apt-get install xrdp
4、配置一下環境,首先需要修改一下xrdp監聽的端口,xrdp默認是監聽在3389端口上,而因為windows主機和linux子系統是在同一臺機器上,因此windows自己的遠程桌面程序監聽的3389端口就會和linux子系統上的xrdp監聽的3389端口衝突。我們先打開xrdp程序的配置文件,命令是:
//備份 sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak //修改 sudo vim /etc/xrdp/xrdp.ini
5、將xfce4的會話環境寫入到默認的會話環境配置文件中去,命令是:
sudo echo xfce4-session > ~/.xsession
寫入完成後重新啟動xrdp服務,命令是:
sudo /etc/init.d/xrdp restart
為了防止每次開機都要設置手動啟動一次,將此命令寫到.bashrc文件中
啟動完成後,ubuntu的桌面環境就配置好了。
6、查看IP地址
ipconfig
然後連接成功
閱讀更多 網上搬磚頭z 的文章