You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Win11 WSL2启动K3s Server报错‘Failed to start ContainerManager’求助

K3s Server启动失败修复方案(Win11 WSL2-Ubuntu环境)

问题背景

此前在Win11的WSL2-Ubuntu环境可正常运行K3s Server,安装并卸载VMware后启动K3s Server出现错误,环境配置为Win11系统+WSL2-Ubuntu+Docker Desktop,使用GitHub最新版K3s。

报错日志

"unable to find data in memory cache" mountpoint="/var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs"
E0711 10:59:36.648074    2373 kubelet.go:1400] "Image garbage collection failed once. Stats initialization may not have completed yet" err="invalid capacity 0 on image filesystem"
I0711 10:59:36.648588    2373 fs_resource_analyzer.go:67] "Starting FS ResourceAnalyzer"
I0711 10:59:36.648648    2373 volume_manager.go:284] "Starting Kubelet Volume Manager"
I0711 10:59:36.648725    2373 desired_state_of_world_populator.go:145] "Desired state populator starts to run"
I0711 10:59:36.649583    2373 server.go:461] "Adding debug handlers to kubelet server"
I0711 10:59:36.666612    2373 cpu_manager.go:214] "Starting CPU manager" policy="none"
I0711 10:59:36.666632    2373 cpu_manager.go:215] "Reconciling" reconcilePeriod="10s"
I0711 10:59:36.666640    2373 state_mem.go:36] "Initialized new in-memory state store"
I0711 10:59:36.666717    2373 state_mem.go:88] "Updated default CPUSet" cpuSet=""
I0711 10:59:36.666733    2373 state_mem.go:96] "Updated CPUSet assignments" assignments=map[]
I0711 10:59:36.666749    2373 policy_none.go:49] "None policy: Start"
I0711 10:59:36.667119    2373 memory_manager.go:169] "Starting memorymanager" policy="None"
I0711 10:59:36.667134    2373 state_mem.go:35] "Initializing new in-memory state store"
I0711 10:59:36.667203    2373 state_mem.go:75] "Updated machine memory state"
E0711 10:59:36.667341    2373 kubelet.go:1480] "Failed to start ContainerManager" err="system validation failed - wrong number of fields (expected 6, got 7)"

修复步骤

1. 清理K3s残留数据,重置运行环境

停止K3s服务并删除所有相关数据:

sudo systemctl stop k3s
sudo rm -rf /var/lib/rancher/k3s
sudo rm -rf /etc/rancher/k3s

重新安装并启动K3s:

curl -sfL https://get.k3s.io | sh -

2. 重置WSL2配置(解决VMware修改的系统参数)

先关闭所有WSL实例:

# 在Windows终端执行
wsl --shutdown

在WSL2-Ubuntu中编辑/etc/wsl.conf,添加以下配置确保挂载参数正常:

[automount]
enabled = true
options = "metadata,umask=22,fmask=11"
mountFsTab = true

[network]
generateHosts = true
generateResolvConf = true

再次执行wsl --shutdown后重启WSL。

3. 解决Docker Desktop与K3s的containerd冲突

如果同时运行Docker Desktop,两者的containerd可能存在资源冲突,可停止Docker Desktop的containerd服务,或启动K3s时指定独立的containerd端点:

curl -sfL https://get.k3s.io | sh -s - --container-endpoint unix:///run/k3s/containerd/containerd.sock

4. 验证overlayfs快照功能

检查WSL2中overlayfs模块是否正常加载:

lsmod | grep overlay

若未加载,可尝试手动加载:

sudo modprobe overlay

内容的提问来源于stack exchange,提问作者Lawrence Yang

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 05:33:13