WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Error code: CreateInstance/CreateVm/ConfigureNetworking/0x8007054f

Open DeaneChen opened this issue 1 year ago • 39 comments

Windows Version

Microsoft Windows [Version 10.0.22631.4460]

WSL Version

2.3.26.0

Are you using WSL 1 or WSL 2?

  • [x] WSL 2
  • [ ] WSL 1

Kernel Version

5.15.167.4-1

Distro Version

Ubuntu 22.04

Other Software

None

Repro Steps

Running wsl terminal first while wsl is stop.

Expected Behavior

wsl can start normally without any errors.

Actual Behavior

After Windows has been running for a certain period (during which WSL is usually inactive), there is a chance that the next time you attempt to start WSL, the following error may occur:

wsl: 出现了内部错误。
错误代码: CreateInstance/CreateVm/ConfigureNetworking/0x8007054f
wsl: 无法配置 networkingMode Mirrored) (网络,回退到 networkingMode None。

or maybe like this in english:

wsl: An internal error occurred.
Error code: CreateInstance/CreateVm/ConfigureNetworking/0x8007054f
wsl: Unable to configure networkingMode Mirrored) (network, falling back to networkingMode None.

LOG:I'm not sure where the log will appear, and the error message doesn't provide a log path.

I suspect this error code 0x8007054f is primarily caused by Windows, and the error code likely originates from the Windows system. Although WSL is functioning properly, there seems to be no internet connectivity.

And this error code always disappears after a Windows restart. Or I change autoProxy=true to false in the .wslconfig file. Of course, I just tested it, and even if I change the autoProxy configuration back to true and only restart WSL, it still works fine.

Diagnostic Logs

No response

DeaneChen avatar Dec 07 '24 10:12 DeaneChen

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Dec 07 '24 10:12 github-actions[bot]

/emailed-logs

DeaneChen avatar Dec 08 '24 13:12 DeaneChen

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

github-actions[bot] avatar Dec 08 '24 13:12 github-actions[bot]

Alright, I need to correct my previous description. Today, when I encountered this issue again, I tried changing autoProxy=true to false in the .wslconfig file and restarted WSL to fix it, but this time it didn't work. I had to restart the entire Windows system. (I've had instances where just restarting Clash resolved the issue, but they only worked once.)

DeaneChen avatar Dec 08 '24 13:12 DeaneChen

Is your system fully patched with Windows updates? There was a regression in Windows that has been fixed in a recent KB.

benhillis avatar Dec 09 '24 16:12 benhillis

Is your system fully patched with Windows updates? There was a regression in Windows that has been fixed in a recent KB.

I checked Windows Update, and it just notified me that I am using the latest version. However, I noticed that there is a manually installable patch, KB5046732. I will download it and continue to monitor whether the issue reoccurs.

DeaneChen avatar Dec 09 '24 16:12 DeaneChen

Is your system fully patched with Windows updates? There was a regression in Windows that has been fixed in a recent KB.

It still occurred, the latest KB patch didn't work.

DeaneChen avatar Dec 11 '24 10:12 DeaneChen

可以先关闭占用53端口的系统进程,然后在进程重启之前快速打开wsl

reflyable avatar Dec 17 '24 07:12 reflyable

可以先关闭占用53端口的系统进程,然后在进程重启之前快速打开wsl

我怀疑过端口问题,但我不确定是哪个冲突的端口。我刚刚检查了,没有在系统上找到使用53端口的进程。

DeaneChen avatar Dec 17 '24 07:12 DeaneChen

same for me. wsl --version:

WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2605

.wslconfig:

[wsl2]
dnsTunneling=true
firewall=true
autoProxy=true
networkingMode=mirrored

DgithubA avatar Dec 25 '24 21:12 DgithubA

i meet the same question. And i find no solution for it. if there is one, please tell me. Thanks a lot!!

TheoLtd avatar Jan 10 '25 03:01 TheoLtd

same question too

WSL 版本: 2.4.11.0
Kernel 版本: 5.15.167.4-1
WSLg 版本: 1.0.65
MSRDC 版本: 1.2.5716
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows 版本: 10.0.26100.3194

.wslconfig

[experimental]
autoMemoryReclaim=gradual  
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

Sparidae avatar Mar 01 '25 08:03 Sparidae

same question,.

If I delete the .wslconfig and use the NAT mode, the network appears to be normal.

But if I edit the network mode in the WSLcofig GUI application, then the same question appears:

WSL 版本: 2.4.11.0
内核版本: 5.15.167.4-1
WSLg 版本: 1.0.65
MSRDC 版本: 1.2.5716
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows 版本: 10.0.22631.4890

.wslconfig: (I only edit in the GUI app, it is generated by that)

[wsl2]
networkingMode=mirrored
[experimental]
hostAddressLoopback=true
bestEffortDnsParsing=true
autoMemoryReclaim=gradual

zhhangBian avatar Mar 11 '25 03:03 zhhangBian

This worked for me: Enable "Windows Hypervisor Platform" (Windows 虚拟机监控程序平台) in Turn Windows features on or off. Source: https://stackoverflow.com/a/78092729

My configuration was silently disabled by an Android virtualization software without any notification. After re-enabling it, the WSL network started working properly again.

LittleHeroZZZX avatar Mar 15 '25 04:03 LittleHeroZZZX

Restarting HNS service may help

AzureZeng avatar Apr 03 '25 00:04 AzureZeng

same question too

WSL 版本: 2.4.11.0
Kernel 版本: 5.15.167.4-1
WSLg 版本: 1.0.65
MSRDC 版本: 1.2.5716
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows 版本: 10.0.26100.3194

.wslconfig

[experimental]
autoMemoryReclaim=gradual  
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

I've noticed that on my machine, after a reboot and then starting WSL, this issue temporarily disappears. However, after running for several days, the problem reappears. I don't know if it's possible that some other program is causing these issues, I haven't installed anything new that would obviously cause this. Hopefully the above information helps

Sparidae avatar Apr 03 '25 11:04 Sparidae

same question too

zhaoguohan123 avatar Apr 27 '25 09:04 zhaoguohan123

This worked for me: Enable "Windows Hypervisor Platform" (Windows 虚拟机监控程序平台) in Turn Windows features on or off. Source: https://stackoverflow.com/a/78092729

My configuration was silently disabled by an Android virtualization software without any notification. After re-enabling it, the WSL network started working properly again.

it's also worked for me

dihambo avatar Apr 29 '25 07:04 dihambo

I have tried all the solutions above, none of which worked. Only restarting the PC can temporarily restore it for a period of time (a few days)

DeaneChen avatar May 04 '25 12:05 DeaneChen

same

wsl --version

WSL 版本: 2.5.7.0
内核版本: 6.6.87.1-1
WSLg 版本: 1.0.66
MSRDC 版本: 1.2.6074
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows: 10.0.26100.4652
.wslconfig

[wsl2]
firewall=false
networkingMode=Mirrored

cethink avatar Jul 10 '25 08:07 cethink

In my case, closing Clash-Verge can solve this problem.

WSL 版本: 2.6.0.0
内核版本: 6.6.87.2-1
WSLg 版本: 1.0.66
MSRDC 版本: 1.2.6228
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows: 10.0.26120.2705

remi-riya avatar Jul 31 '25 09:07 remi-riya

I ran Netch once and it recovered.

narfa0215 avatar Aug 28 '25 02:08 narfa0215

I just use ipconfig /flushdns solved this problem, and I don't know why. this problem always appears when I restart my pc

3nowfan avatar Sep 27 '25 01:09 3nowfan

Image

lng205 avatar Oct 03 '25 04:10 lng205

如果安装了VMWare的话可以把VMWare的几个服务停掉试一下,这几个服务默认是开机自启动的,我排查半天猜测可能是它的原因,于是就把它关了,关掉之后的这两天倒是没出现这种情况了

Image

k13in avatar Oct 09 '25 07:10 k13in

我今晚想把 localhost 代理配置镜像到 WSL 中以更快地克隆 GitHub 项目,跟着网络上的教程走也遇到了这个问题,后面执行了 wsl --shutdown 和 wsl --update 后启动 wsl 还是不行,随后把 %USERPROFILE%\.wslconfig 从

[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

改为

[wsl2]
firewall=false
networkingMode=Mirrored

后执行 wsl --shutdown 和 wsl 就正常了,随后我又把 %USERPROFILE%\.wslconfig 从

[wsl2]
firewall=false
networkingMode=Mirrored

改成了

[experimental]
autoMemoryReclaim=gradual
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

,执行 wsl --shutdown 和 wsl 后却不报错了,不知道是什么原因。

在控制台执行 wsl --version 的输出如下。

WSL 版本: 2.6.1.0
内核版本: 6.6.87.2-1
WSLg 版本: 1.0.66
MSRDC 版本: 1.2.6353
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows: 10.0.26100.6725

在 WSL 内执行 curl -I https://www.google.com 的结果为:

HTTP/1.1 200 Connection established

HTTP/2 200
content-type: text/html; charset=ISO-8859-1
content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-mdHG4l3Mp_gXmBcCtWnyaQ' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
accept-ch: Sec-CH-Prefers-Color-Scheme
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
date: Wed, 15 Oct 2025 15:53:23 GMT
server: gws
x-xss-protection: 0
x-frame-options: SAMEORIGIN
expires: Wed, 15 Oct 2025 15:53:23 GMT
cache-control: private
set-cookie: AEC=AaJma5v3zHxLmhlh7b9itbk8LeCvG1YODTN_BndcvTkNQF5fIeYZ1S2rk-0; expires=Mon, 13-Apr-2026 15:53:23 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
set-cookie: NID=525=fuwA2SGcRUsi5BXACwXd15Q67aarrH6LvaFGstv3L9QhpXyIOBUMSqCS32x-5bsfpKQ44cMG0aSguPTdUzQkgcaBpIkfEVFvCeSWUKt-bGqkv40CrJrhmfYwsv3Ej3WEIeyxAxkzckyYovW3_BZUVvBjwwkDDjYkqdwXAofJkM1jK9lX9IHN063R4l5-w-9wDqesnLHtTWKmhRcAkwRt; expires=Thu, 16-Apr-2026 15:53:23 GMT; path=/; domain=.google.com; HttpOnly
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

此外,我用命令 netstat -ano | find ":53 " 看了下占用 53 端口的进程 ID,利用任务管理器跳转到它的服务,随后发现它是一个系统服务,一结束服务进程就会自动重启,而且不允许将状态设置为“已禁用”,此服务在 Windows 自带的 services.msc 中难以找到,服务对应的注册表路径为 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess。

Image

BatchClayderman avatar Oct 15 '25 15:10 BatchClayderman

Same case. I tried all solutions mentioned above but remain same situation. Btw, I use sparkle(which is similar to clash verge )and enable DNS overried. I also use adguardhome(which listen to port 53 also). I tried to turn off both of them but it take no effects.

schalkiii avatar Oct 18 '25 03:10 schalkiii

Win + R, type services.msc and restart WSL Service, then start wsl worked for me

R-3MY avatar Oct 21 '25 13:10 R-3MY

mark

ImViper avatar Oct 29 '25 11:10 ImViper

same issue

eko5624 avatar Oct 31 '25 07:10 eko5624