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博客

相关推荐
可爱又迷人的反派角色“yang”6 小时前
ansible剧本编写(三)
linux·网络·云计算·ansible
石像鬼₧魂石11 小时前
内网渗透靶场实操清单(基于 Vulhub+Metasploitable 2)
linux·windows·学习·ubuntu
Danileaf_Guo12 小时前
256台H100服务器算力中心的带外管理网络建设方案
运维·服务器
橘子真甜~13 小时前
C/C++ Linux网络编程15 - 网络层IP协议
linux·网络·c++·网络协议·tcp/ip·计算机网络·网络层
拾贰_C14 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
bloglin9999914 小时前
启动容器报错ls: cannot access ‘/docker-entrypoint-initdb.d/‘: Operation not permitted
docker·容器·eureka
阿华hhh14 小时前
Linux系统编程(标准io)
linux·开发语言·c++
虹科网络安全15 小时前
艾体宝洞察 | 利用“隐形字符”的钓鱼邮件:传统防御为何失效,AI安全意识培训如何补上最后一道防线
运维·网络·安全
石像鬼₧魂石15 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan15 小时前
linux上面写python3日志服务器
linux·运维·服务器