windows linux子系统 docker无法启动

windows安装Linux子系统后,使用sudo service docker start启动后,再使用sudo service docker status查看docker状态,docker无法启动,使用sudo dockerd查看错误信息如下:

failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables/1.8.7 Failed to initialize nft: Protocol not supported

网上解决方法1:使用该方法没有解决问题

最新版的ubuntu系统使用了iptables-nft,而WSL2不支持导致的

使用以下命令修改版本:

sudo update-alternatives --config iptables

网上解决方法2:

下载安装包,升级wsl2

下载地址:

链接: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

查询子系统版本:

wsl -l -v

切换wsl版本:

wsl --set-version Ubuntu-20.04 2

设置默认wsl版本

wsl --set-default-version 2

成功启动docker,windows10安装ubuntu子系统,耗时一天,差点就放弃了。

参考链接:

[安利] WSL Linux 子系统,真香!完整实操 - 知乎

安装docker时出现以下错误:Package 'docker-ce' has no installation candidate_package 'docker-ce' has no installation candidate_Arhani的博客-CSDN博客

相关推荐
技术小齐4 分钟前
网络运维学习笔记 017HCIA-Datacom综合实验01
运维·网络·学习
大囚长38 分钟前
AI工作流+专业知识库+系统API的全流程任务自动化
运维·人工智能·自动化
Struggle Sheep1 小时前
linux安装redis
linux·运维·redis
butteringing2 小时前
BuildFarm Worker 简要分析
linux·软件构建·bazel·re api
saynaihe2 小时前
2025吐槽季第一弹---腾讯云EO边缘安全加速平台服务
运维·安全·云计算·腾讯云
@#---2 小时前
删除驱动精灵的详细过程
运维·服务器
likeyou~coucou3 小时前
自动化之ansible(二)
运维·自动化·ansible
小红帽2.03 小时前
客服系统自动化方案:揭秘全渠道智能服务解决方案 vx: haotsh
运维·自动化
reset20213 小时前
ubuntu离线安装ollama
linux·ubuntu·ollama
转身後 默落3 小时前
11.Docker 之分布式仓库 Harbor
分布式·docker·容器