当时并没有详细记录的意识,只记录了相关代码,某些步骤现在已经看不懂了x
wsl命令
备份还原
wsl --export Ubuntu C:\OWO\CloudMusic\wslbkp.tar
wsl --import Ubuntu C:\CloudMusic C:\OWO\CloudMusic\wslbkp.tar
卸载子系统
wsl --list --all
wsl --unregister Ubuntu
安装桌面 gnome(失败)
sudo apt-get install ubuntu-desktop gnome
安装 systemd(失败)
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
修改 enter-systemd-namespace 参考
bash ubuntu-wsl2-systemd-script.sh //系统会崩溃
设置默认Linux开发版
wslconfig /setdefault Ubuntu-20.04
配置代理(Clash开启允许局域网连接)
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*');
export https_proxy="http://${hostip}:7890";
export http_proxy="http://${hostip}:7890";
export all_proxy="socks5://${hostip}:7891";
git 通过代理
git clone -c http.proxy="http://127.0.0.1:1080" https://github.com/TIGERB/easy-php.git
apt相关
sudo apt -o Acquire::http::proxy="http://${hostip}:7890" install nvidia-cuda-toolkit
sudo apt search libdc1394
sudo apt install
sudo apt purge libopencv-dev python3-opencv
sudo apt autoremove
OpenCV(2.4.11 3.2.0均编译失败,而3.4.5可以无错误编译,下载链接)
参考
编译用代码
mkdir build && cd build
cmake ..
make -j8
sudo make install
sudo ldconfig
窗口显示
VcXsvr 勾上 Disable access control 选项
nano ~/.bashrc
最后加上
export DISPLAY=`grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0
刷新shell的配置
source ~/.bashrc
Draft
netsh int ipv4 set dynamic tcp start=49152 num=16384
相关教程资料
不用装双系统,直接在 Windows 上体验 Linux:Windows Subsystem for Linux - 少数派
快速上手──在 Linux 上游玩 osu!stable | 砂糖砂糖沙