Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code: Wsl/Service/CreateInstance/CreateVm/WSAENOTCONN Press any key to continue... #11791

Open
1 of 2 tasks
heartacker opened this issue Jul 17, 2024 · 41 comments
Open
1 of 2 tasks
Assignees

Comments

@heartacker
Copy link

Windows Version

版本 Windows 11 专业版 版本号 24H2 安装日期 ‎2024/‎4/‎6 操作系统版本 26120.961 体验 Windows Feature Experience Pack 1000.26100.8.0

WSL Version

WSL 版本: 2.3.11.0 内核版本: 6.6.36.3-1 WSLg 版本: 1.0.63 MSRDC 版本: 1.2.5326 Direct3D 版本: 1.611.1-81528511 DXCore 版本: 10.0.26100.1-240331-1435.ge-release Windows 版本: 10.0.22631.3880

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

由于套接字没有连接并且(当使用一个 sendto 调用发送数据报套接字时)没有提供地址,发送或接收数据的请求没有被接受。
Error code: Wsl/Service/CreateInstance/CreateVm/WSAENOTCONN
Press any key to continue...

Expected Behavior

WSL 版本: 2.3.11.0
内核版本: 6.6.36.3-1
WSLg 版本: 1.0.63
MSRDC 版本: 1.2.5326
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26100.1-240331-1435.ge-release
Windows 版本: 10.0.22631.3880

Actual Behavior

can not work

Diagnostic Logs

No response

Copy link

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 scipt will output the path of the log file once done.

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.

@YCG1
Copy link

YCG1 commented Jul 18, 2024

我也遇到了同样的问题 请问怎么操作可以解决?

@YCG1
Copy link

YCG1 commented Jul 18, 2024

@YCG1
Copy link

YCG1 commented Jul 18, 2024

我知道如何解决了 预览版的WSL有问题 去下载正式版的2.2.4.0就可以解决问题了

@heartacker
Copy link
Author

我知道如何解决了 预览版的WSL有问题 去下载正式版的2.2.4.0就可以解决问题了

就是github 的链接吗

@YCG1
Copy link

YCG1 commented Jul 18, 2024

我知道如何解决了 预览版的WSL有问题 去下载正式版的2.2.4.0就可以解决问题了

就是github 的链接吗

是的就是 正式版的下载之后重新安装一下就可以了

@JustLookAtNow
Copy link

我知道如何解决了 预览版的WSL有问题 去下载正式版的2.2.4.0就可以解决问题了

数据会被覆盖么?

@JustLookAtNow
Copy link

2.3.11.0 同样的问题,正用着直接crash了然后启动不了了

@BurnerK
Copy link

BurnerK commented Jul 19, 2024

我知道如何解决了 预览版的WSL有问题 去下载正式版的2.2.4.0就可以解决问题了

我目前也是2.3.11.0,怎么降级到2.2.4.0?

@JustLookAtNow
Copy link

WslLogs-2024-07-19_13-37-06.zip
here is the log!

@nnathan
Copy link

nnathan commented Jul 21, 2024

I'm having the same issue starting up the kernel built from the WSL2 kernel source with tag linux-msft-wsl-6.6.36.3. I only changed the config so that everything was =y instead of =m as recommended in the README for building. My bzImage is in c:\Users\naveen\bzImage-linux-msft-wsl-6.6.36.3 and I have the following .wslconfig:

[wsl2]
kernel=C:\\Users\\naveen\\bzImage-linux-msft-wsl-6.6.36.3
networkingMode=mirrored

WSL2 info:

wsl --version
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2 (ignore this, this is the kernel I had to revert to because of the error)
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.3880

@JustLookAtNow

This comment was marked as duplicate.

@github-actions github-actions bot mentioned this issue Jul 22, 2024
2 tasks
@chessturo chessturo self-assigned this Jul 23, 2024
@Gn3po4g
Copy link

Gn3po4g commented Jul 25, 2024

https://github.com/Nevuly/WSL2-Linux-Kernel-Rolling
我用了这个仓库编译的内核,好像最高支持版本是6.5.9,大于等于6.6.0的版本都会报Error code: Wsl/Service/CreateInstance/CreateVm/WSAENOTCONN

@heartacker
Copy link
Author

@chessturo could you please fix this, thanks

@chessturo
Copy link
Collaborator

@chessturo could you please fix this, thanks

Hey! I'm currently investigating, but don't have an estimate for when it will be fixed. Please feel free to let me know if new information comes up (for example, if the problem persists after a WSL update, or conversely if a WSL update fixes it)

@JustLookAtNow
Copy link

@chessturo could you please fix this, thanks

Hey! I'm currently investigating, but don't have an estimate for when it will be fixed. Please feel free to let me know if new information comes up (for example, if the problem persists after a WSL update, or conversely if a WSL update fixes it)

2.3.12
The issue still exists in version 2.3.12.

@JustLookAtNow
Copy link

@chessturo could you please fix this, thanks

Hey! I'm currently investigating, but don't have an estimate for when it will be fixed. Please feel free to let me know if new information comes up (for example, if the problem persists after a WSL update, or conversely if a WSL update fixes it)

2.3.12 The issue still exists in version 2.3.12.

The issue also exists in version 2.3.13.

@chessturo
Copy link
Collaborator

Asking here since this seems to be the most active thread on this issue. I'm still having trouble reproducing the bug on my end, but my suspicion is that this is related to something particular to certain CPU models. I am hopeful that adding the following config will help (please see here for details):

[wsl2]
kernelCommandLine=noxsave

I would really appreciate it if those affected could try this and report back on if it works or not (preferably along with dmesg and/or WSL logs). I'm continuing to work on reproducing this on my end, so hopefully I shouldn't have to ask too much more of y'all. Thanks for the reports, and thanks in advance to anyone who's willing to help test out this fix!

@Gn3po4g
Copy link

Gn3po4g commented Jul 30, 2024

noxsave

It works! And the problem appeared on my Intel CPU and not on the AMD CPU, as you said.

@heartacker
Copy link
Author

@chessturo thank, it works

@JustLookAtNow
Copy link

JustLookAtNow commented Jul 30, 2024

Asking here since this seems to be the most active thread on this issue. I'm still having trouble reproducing the bug on my end, but my suspicion is that this is related to something particular to certain CPU models. I am hopeful that adding the following config will help (please see here for details):

[wsl2]
kernelCommandLine=noxsave

I would really appreciate it if those affected could try this and report back on if it works or not (preferably along with dmesg and/or WSL logs). I'm continuing to work on reproducing this on my end, so hopefully I shouldn't have to ask too much more of y'all. Thanks for the reports, and thanks in advance to anyone who's willing to help test out this fix!

it works!
dmesg.log

here is dmesg log and my cpu is i5-12500

@ffme-lab
Copy link

@chessturo it works!
dmesg.log

@mortenfc
Copy link

mortenfc commented Aug 2, 2024

I did the same as @nnathan and the kernelCommandLine=noxsave did not fix for me.

PS C:\Users\mfjordchris> wsl --version
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22621.3880
PS C:\Users\mfjordchris> wsl
A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
Error code: Wsl/Service/CreateInstance/CreateVm/WSAENOTCONN
# Settings apply across all Linux distros running on WSL 2
# https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig
[wsl2]
memory=56GB

processors=18

kernel="C:\\Users\\mfjordchris\\Documents\\WSL\\6.6.y_all_modules"

kernelCommandLine = noxsave

localhostforwarding=true

autoProxy=true

firewall=false

vmIdleTimeout=600000 #ms 600 s = 10 min

[experimental]
autoMemoryReclaim=dropcache

WslLogs-2024-08-02_10-00-59.zip

@THZ34
Copy link

THZ34 commented Aug 2, 2024

@chessturo thank, it works

@chessturo
Copy link
Collaborator

I did the same as @nnathan and the kernelCommandLine=noxsave did not fix for me.

PS C:\Users\mfjordchris> wsl --version
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22621.3880
PS C:\Users\mfjordchris> wsl
A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
Error code: Wsl/Service/CreateInstance/CreateVm/WSAENOTCONN
# Settings apply across all Linux distros running on WSL 2
# https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig
[wsl2]
memory=56GB

processors=18

kernel="C:\\Users\\mfjordchris\\Documents\\WSL\\6.6.y_all_modules"

kernelCommandLine = noxsave

localhostforwarding=true

autoProxy=true

firewall=false

vmIdleTimeout=600000 #ms 600 s = 10 min

[experimental]
autoMemoryReclaim=dropcache

WslLogs-2024-08-02_10-00-59.zip

@mortenfc looking at your logs, it looks like your problem has a different root cause. I would suggest opening a new issue (and you can remove the noxsave command line param)

@chessturo
Copy link
Collaborator

chessturo commented Aug 6, 2024

Alright, unfortunately I haven't been able to get access to a machine that's affected with the bug, but I am hopeful that I have figured out the root issue. If anyone is interested in testing a root-cause fix, please do the following on a working WSL install (e.g., via the noxsave fix or by rolling back to a working version):

  1. Make sure you have all the dependencies: sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev cpio
  2. git clone [email protected]:chessturo/WSL2-Linux-Kernel.git (or git clone https://github.com/chessturo/WSL2-Linux-Kernel.git if you prefer HTTPS) and cd WSL2-Linux-Kernel
  3. git checkout fpu-fix
  4. make -j`nproc` KCONFIG_CONFIG=Microsoft/config-wsl and just accept the defaults on the questions it asks. Note that this may take several minutes. You can remove the -j`nproc` if you don't want it using all your CPU cores, though this will take longer.
  5. Copy the created vmlinux file somewhere into Windows e.g., cp vmlinux /mnt/c/Users/YourUser
  6. Edit your .wslconfig to include
[wsl2]
kernel=C:\\Users\\YourUser\\vmlinux # Point this to the copied vmlinux, note the double backslashes!
# please MAKE SURE to remove the kernelCommandLine=noxsave
  1. Attempt to boot the kernel. I would really appreciate dmesg logs and confirmation for whether the fix worked or not!
  2. Remove the kernel= line from your .wslconfig (or put it back to whatever it was before). This kernel doesn't have many modules built in (to avoid adding extra variables), but this could break certain apps if you try to use them with this testing kernel. You'll also need to put back the kernelCommandLine=noxsave.

PLEASE NOTE:
Changing the kernel config option in .wslconfig is essentially as dangerous as running any other code. In general, you should be very careful about doing this. I am a Microsoft employee (as you can see from the Member along the banner of my messages on this thread, and the Microsoft badge on my profile), and you can inspect all the changes I've made: after step 3 simply run git diff linux-msft-wsl-6.6.y.

Thanks again for the bug reports and testing out the original noxsave temporary fix! I will be sure to keep this thread updated.

@genuinefafa
Copy link

genuinefafa commented Aug 6, 2024

@chessturo i'm having issues checkouting in PS... will try into wsl

PS D:\Develop> git clone [email protected]:chessturo/WSL2-Linux-Kernel.git
Cloning into 'WSL2-Linux-Kernel'...
remote: Enumerating objects: 9780696, done.
remote: Total 9780696 (delta 0), reused 0 (delta 0), pack-reused 9780696
Receiving objects: 100% (9780696/9780696), 2.06 GiB | 8.19 MiB/s, done.
Resolving deltas: 100% (8257787/8257787), done.
error: invalid path 'drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

PS D:\Develop>
PS D:\Develop> cd .\WSL2-Linux-Kernel\
PS D:\Develop\WSL2-Linux-Kernel> git checkout fpu-fix
error: invalid path 'drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c'
error: invalid path 'drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h'
error: invalid path 'include/soc/arc/aux.h'

btw, the kernelCommandLine=noxsave worked on my end
dmesg.log

@genuinefafa
Copy link

tried into Pengwin WSL with make installed

...
  CC [M]  drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_transition.o
  LD [M]  drivers/gpu/drm/amd/amdgpu/amdgpu.o
  AR      drivers/gpu/built-in.a
  AR      drivers/built-in.a
make[1]: *** [/home/fafa/WSL2-Linux-Kernel/Makefile:1921: .] Error 2
make: *** [Makefile:234: __sub-make] Error 2

got error 2, sorry :(

@chessturo
Copy link
Collaborator

@genuinefafa Ah sorry, yeah this all needs to be done on WSL. I've updated my instructions to include the details.

I'm not sure what exactly is causing that issue --- likely something further up than where your logs are cut off. If you re-run the make command immediately after getting that error, it should produce much less output and include some more details on what build step failed. I'd also double check you have all the dependencies via sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev cpio (I've also added this to the original instructions).

Thanks for your help testing this out, I really appreciate it!

@JustLookAtNow
Copy link

@chessturo
The custom kernel is works!

here is the log.

dmesg.log

@JustLookAtNow
Copy link

@chessturo The custom kernel is works!

here is the log.

dmesg.log

I encountered two yes-or-no questions when I started compiling. I simply pressed Enter without knowing if it would affect the final result, but I thought it was important to let you know.

@chessturo
Copy link
Collaborator

@chessturo The custom kernel is works!
here is the log.
dmesg.log

I encountered two yes-or-no questions when I started compiling. I simply pressed Enter without knowing if it would affect the final result, but I thought it was important to let you know.

Thank you for testing this, and I'm glad to hear it works! And don't worry, that's expected, though I appreciate you letting me know --- I've updated the directions to clarify as well.

@genuinefafa
Copy link

@chessturo i can confirm that it works now

there were some packages needed that were not there before (i did follow readme from the repo)

compilation.log

dmesg.log

fun to see that I'm running my own WSL versión 😀

@chessturo
Copy link
Collaborator

@chessturo i can confirm that it works now

there were some packages needed that were not there before (i did follow readme from the repo)

compilation.log

dmesg.log

fun to see that I'm running my own WSL versión 😀

@genuinefafa Glad to hear everything is working! And yes, being able to change WSL kernels without too much trouble is a very handy feature to have :)

I'm hoping to have a patch based on this sent upstream and included in WSL here soon. I will update this thread once that's all sorted and everyone who's affected will be able to take the noxsave out of their kernel command line.

@cuivip
Copy link

cuivip commented Aug 12, 2024

anyone can explain this ? use the config networkingMode=mirrored, wsl works。change to nat mode, has the same problem 。

PS C:\Users\shuis> cat .\.wslconfig
[wsl2]
[experimental]
dnsTunneling=true
networkingMode=mirrored
autoProxy=true
PS C:\Users\shuis> wsl
cuipeng@civcui:/mnt/c/Users/shuis$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
cuipeng@civcui:/mnt/c/Users/shuis$ exit
logout
PS C:\Users\shuis> wsl --shutdown

//remove config  networkingMode=mirrored
PS C:\Users\shuis> cat .\.wslconfig
[wsl2]
[experimental]
dnsTunneling=true
autoProxy=true
PS C:\Users\shuis> wsl
无法配置 networkingMode Nat)(网络。若要禁用网络,请在C:\Users\shuis\.wslconfig中设置“wsl2.networkingMode=None”
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/ERROR_UNHANDLED_EXCEPTION
PS C:\Users\shuis>
PS C:\Users\shuis> wsl --version
WSL 版本: 2.2.4.0
内核版本: 5.15.153.1-2
WSLg 版本: 1.0.61
MSRDC 版本: 1.2.5326
Direct3D 版本: 1.611.1-81528511
DXCore 版本: 10.0.26091.1-240325-1447.ge-release
Windows 版本: 10.0.22631.3880

@chessturo
Copy link
Collaborator

@cuivip This looks like a different problem from what this thread is discussing. I would suggest opening a new issue

@OneBlue
Copy link
Collaborator

OneBlue commented Aug 20, 2024

Thank you @heartacker. This issue was caused by the new kernel that we shipped we 2.3.11. We have reverted to the 5.5 kernel in 2.3.13 which should resolve the issue.

@OneBlue OneBlue closed this as completed Aug 20, 2024
@chessturo
Copy link
Collaborator

chessturo commented Aug 20, 2024

(In particular, anyone who added the noxsave command line parameter as a workaround should remove it after updating, as it can cause reduced performance)

@gdwnldsKSC
Copy link

I hate to pop in on this issue, but using 2.3.21 I ran into the same 0x80072749 issue as well.

CPU: Xeon Platinum 8592+

kernelCommandLine=noxsave resolved the issue for me. XSave does work in other contexts (Specifically, VMware Workstation running OpenVMS 9.2-2 and E9.2-3).

C:\Windows\System32>wsl --version WSL version: 2.3.21.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.27695.1000

Tagging this on here as I found it to be marked a dupe of #11844 which is my exact issue.

Issue was also present on the stable/production 2.2.4 on the system after initial clean installation. WSL has never worked on this setup.

Attached log capture shows a failure to launch (WSAENOTCONN), unregister, then failure to re-install without noxsave in the configuration. Second run attached with noxsave showing functional install and system.

WslLogs-2024-09-17_09-34-34.zip
WslLogs-2024-09-17_09-37-22.zip

@chessturo
Copy link
Collaborator

chessturo commented Sep 17, 2024

Ah ok, definitely looks like the same issue. noxsave should work as a stopgap for now, you can alternatively update to 6.6.36.6. The fix has also been pulled into stable 6.x kernels now, so if you run a recent custom kernel, everything should be fixed.

@chessturo chessturo reopened this Sep 17, 2024
@chessturo
Copy link
Collaborator

It seems that my original fix was actually not applied to 5.15 stable kernels and needed some tweaking. Unfortunately I still haven't been able to get access to a machine that's affected with the bug. If possible, I'd like to be able to test this backport. If anyone with an affected machine is interested in testing this, please do the following on a working WSL install (e.g., via the noxsave fix):

  1. Make sure you have all the dependencies: sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev cpio
  2. git clone [email protected]:chessturo/WSL2-Linux-Kernel.git (or git clone https://github.com/chessturo/WSL2-Linux-Kernel.git if you prefer HTTPS) and cd WSL2-Linux-Kernel
  3. git checkout fpu-fix-backport
  4. make -j`nproc` KCONFIG_CONFIG=Microsoft/config-wsl and just accept the defaults on the questions it asks (there will be a lot, you can just hold enter). Note that once building the kernel starts, it may take several minutes. You can remove the -j`nproc` if you don't want it using all your CPU cores, though this will take longer.
  5. Copy the created vmlinux file somewhere into Windows e.g., cp vmlinux /mnt/c/Users/YourUser
  6. Edit your .wslconfig to include
[wsl2]
kernel=C:\\Users\\YourUser\\vmlinux # Point this to the copied vmlinux, note the double backslashes!
# please MAKE SURE to remove the kernelCommandLine=noxsave
  1. Attempt to boot the kernel. I would really appreciate dmesg logs and confirmation for whether the fix worked or not!
  2. Remove the kernel= line from your .wslconfig (or put it back to whatever it was before). You'll also need to put back the kernelCommandLine=noxsave.

PLEASE NOTE:
Changing the kernel config option in .wslconfig is essentially as dangerous as running any other code. In general, you should be very careful about doing this. I am a Microsoft employee (as you can see from the Member along the banner of my messages on this thread, and the Microsoft badge on my profile), and you can inspect all the changes I've made.

I really appreciate all the help from the community on getting this issue resolved 😄. If anyone gets a chance to try this kernel, please let me know whether it works/helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests