在 WSL 2 上安装了 Ubuntu 20.04 发行版
创建
wsl.conf
如下内容:
===============================================================
[automount]
enabled = true
options = "metadata,uid=1000,gid=1000,umask=22,fmask=11,case=off"
mountFsTab = true
crossDistro = true
[network]
generateHosts = false
generateResolvConf = true
[interop]
enabled = true
appendWindowsPath = true
=============================================================
- 根据以下设置 systemD https://github.com/damionGans/ubuntu-wsl2-systemd-script
- 安装 core、lxd 和一些其他 snap 包,比如 microk8s。一切看起来都很好:
$ snap list
Name Version Rev Tracking Publisher Notes
core18 20210611 2074 latest/stable canonical✓ base
core20 20210429 1026 latest/stable canonical✓ base
lxd 4.15 20840 latest/stable canonical✓ -
microk8s v1.21.1 2262 1.21/stable canonical✓ classic
snapd 2.51.1 12398 latest/stable canonical✓ snapd
登出
再次登录,快照状态相同
注销然后终止正在运行的发行版:wsl -t Ubuntu-20.04
重启:wsl -d Ubuntu-20.04
检查快照:
$ snap list
Name Version Rev Tracking Publisher Notes
core18 2074 latest/stable canonical✓ broken
core20 1026 latest/stable canonical✓ broken
lxd 4.15 20840 latest/stable canonical✓ -
microk8s 2262 1.21/stable canonical✓ broken
snapd 12398 latest/stable canonical✓ broken
我怀疑快照配置进入了临时空间并且不会持续存在。