wsl--set-default-version2
修改Ubuntu20.04下載源
vim /etc/apt/sources.list
在末尾加入
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-srchttp://mirrors.aliyun.com/ubuntu/focal-backportsmainrestricteduniversemultiverse
sudo apt-get update
sudo apt-get upgrade -y
?安裝Xfce等依賴(安裝圖形界面和遠(yuǎn)程鏈接)
sudo apt install xorg
sudo apt-get install xfce4
sudo apt-get install xrdp
sudo apt-get install net-tools
sudo apt install -y lightdm
?
sudo apt install xfce4-goodies
?
?
sudo dpkg-reconfigure lightdm
?當(dāng)前用戶指定登錄session類型
echo"xfce4-session">~/.xsession
修改xrdp運(yùn)行端口,防止與Windows11自帶的xrdp服務(wù)端口沖突
sudo vim /etc/xrdp/xrdp.ini
修改xrdp的配置文件,把port從3389修改為任意未被占用的端口,避免和本機(jī)沖突
sudo echo xfce4-session >~/.xsession
sudo service xrdp restart
?配置網(wǎng)絡(luò),獲取主機(jī)的IP
sudo apt install net-tools
ip route | grep default | awk '{print $3}'
?
install bcbisonbuild-essentialccachecurlflexg++-multilibgcc-multilibgitgit-lfsgnupggperfimagemagick
lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libncurses5 libncurses5-dev
libssl-dev libxml2 libxml2-utils lzop pngcrush rsync
schedtool squashfs-tools xsltproc
zip zlib1g-dev
?開啟防火墻端口
sudo ufw allow 33891
打開遠(yuǎn)程桌面鏈接
mstsc
使用Windows自帶的遠(yuǎn)程控制進(jìn)行連接
localhost:33891
?
?
?
?注意:每次使用的時(shí)候都需要重新輸入
wsl --shutdown
wsl -u root
sudo /etc/init.d/xrdp start
或
sudo service xrdp restart
?
?
?
sudo add-apt-repository ppa:maarten-fonville/android-studio
?
sudo apt install android-studio
sudo apt install openjdk-8-jdk
sudo apt install openjdk-11-jdk
?啟用systemd
sudo apt install -y ubuntu-desktop xrdp gnome-software gnome-tweaks gnome-shell-extensions
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
?
exec bash
?
?
?啟動(dòng)XRDP服務(wù)
//關(guān)閉WSL
wsl --shutdown
wsl -u root
//由于WSL2里面不能用systemd,所以需要手動(dòng)啟動(dòng)
sudo /etc/init.d/xrdp start
安裝中文輸入法(需要在WSL Ubuntu20.04 GUI圖形界面中操作)
(1).卸載IBus輸入法框架
Ubuntu內(nèi)置了IBus輸入法框架,與fcitx沖突,需要事先卸載
sudoaptremoveibus*
(2).安裝所需要的軟件包
sudoaptinstalldbus-x11fcitxim-configfcitx-sunpinyinfcitx-table-wubi
(3).安裝后需要重啟一次
wsl --shutdown
wsl -u root
sudo /etc/init.d/xrdp start
(4).配置輸入法框架
fcitx-config-gtk3
安裝搜狗輸入法
https://shurufa.sogou.com/
-
源碼
+關(guān)注
關(guān)注
8文章
639瀏覽量
29185 -
Ubuntu
+關(guān)注
關(guān)注
5文章
563瀏覽量
29702 -
Windows11
+關(guān)注
關(guān)注
0文章
57瀏覽量
4309
原文標(biāo)題:Windows11上WSL之Ubuntu20.04搭建Android系統(tǒng)源碼編譯環(huán)境
文章出處:【微信號(hào):哆啦安全,微信公眾號(hào):哆啦安全】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
相關(guān)推薦
評論