wsl2+Docker-Desktop笔记
转:12步搞定Wsl 2,安装、交互、迁移、VSCode远程调试应有尽有
http://www.zzvips.com/article/196520.html
转:win10 wsl2修改默认安装目录到其他盘
https://www.csdn.net/tags/MtTaEg1sODUyNjgxLWJsb2cO0O0O.html
1. 查看已安装的linux发行版本
wsl -l --all -v
2. 导出分发版为tar文件到d盘
wsl --export Ubuntu-20.04 d:\wsl-ubuntu20.04.tar
3. 注销当前分发版
wsl --unregister Ubuntu-20.04
4. 重新导入并安装WSL在D盘
wsl --import Ubuntu-20.04 d:\wsl-ubuntu20.04 d:\wsl-ubuntu20.04.tar --version 2
5. 设置默认登陆用户为安装时用户名
ubuntu2004 config --default-user USERNAME
6. 删除wsl-ubuntu20.04.tar
del d:\wsl-ubuntu20.04.tar
超详细Windows10/Windows11 子系统(WSL2)安装Ubuntu20.04(带桌面环境)
https://blog.csdn.net/weixin_44301630/article/details/122390018
1. 更换软件源
由于Ubuntu默认的软件源在国外,有时候后可能会造成下载软件卡顿,这里我们更换为国内的阿里云源,其他国内源亦可。
双击打开Ubuntu20.04 LTS图标,在命令行中输入
# 备份原来的软件源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 编辑软件源
sudo nano /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-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
2. 更新升级软件
在Ubuntu命令行中依次执行如下命令:
# 更新软件源
sudo apt-get update -y
# 升级所有软件
sudo apt-get upgrade -y
转:Docker-Desktop储存路径更改
https://blog.csdn.net/junehappylove/article/details/123522433
备份
wsl --export docker-desktop D:\docker-desktop.tar
备份
wsl --export docker-desktop-data D:\docker-desktop-data.tar
注销
wsl --unregister docker-desktop
注销
wsl --unregister docker-desktop-data
导入
wsl --import docker-desktop D:\docker-desktop D:\docker-desktop.tar --version 2
wsl --import docker-desktop-data D:\docker-desktop-data D:\docker-desktop-data.tar --version 2
删除备份
del D:\docker-desktop-data.tar
del D:\docker-desktop.tar