更新wsl,docker无法启动wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.解决方案

PS C:\Users\xxxx> wsl -v
WSL 版本: 2.0.0.0
内核版本: 5.15.123.1-1
WSLg 版本: 1.0.57
MSRDC 版本: 1.2.4485
Direct3D 版本: 1.608.2-61064218
DXCore 版本: 10.0.25880.1000-230602-1350.main
Windows 版本: 10.0.22000.2295

sudo service docker start
mount: /sys/fs/cgroup/cpuset: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/cpu: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/cpuacct: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/blkio: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/memory: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/devices: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/freezer: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/net_cls: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/perf_event: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/net_prio: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/hugetlb: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/pids: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/rdma: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
mount: /sys/fs/cgroup/misc: wrong fs type, bad option, bad superblock on cgroup, missing codepage or helper program, or other error.
 * Starting Docker: docker
解决方法:
步骤一:
$ cat /etc/fstab

LABEL=cloudimg-rootfs / ext4 defaults 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0

步骤二:
$ cat /etc/wsl.config

[boot]
systemd=true
cgroup_enable=memory systemd.unified_cgroup_hierarchy=0

步骤三:
运行:%USERPROFILE%\.wslconfig

[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
[wsl2]
kernelCommandLine = cgroup_no_v1=all




posted on 2023-09-21 15:46  秋雨的蝴蝶  阅读(247)  评论(0编辑  收藏  举报