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/HCS_E_CONNECTION_TIMEOUT #10196

Closed
1 of 2 tasks
piggy2011 opened this issue Jun 15, 2023 · 3 comments
Closed
1 of 2 tasks

Comments

@piggy2011
Copy link

piggy2011 commented Jun 15, 2023

Windows Version

Microsoft Windows [Version 10.0.22621.1702]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

kali-linux 2023.2

Other Software

No response

Repro Steps

To access USB Storage Device on WSL2, I follow the instruction https://github.com/jovton/USB-Storage-on-WSL2/blob/master/README.md . I create the file ".wslconfig" on my Windows host's "Users\your-user-name" folder and the content is as below

[wsl2]
kernel=C:\\Users\\XXX YY ZZZ\\bzImage
swap=0
localhostForwarding=true

After executing the command "wsl --shutdown" and "wsl", the system displays the following message.

PS C:\WINDOWS\system32> wsl
The operation timed out because a response was not received from the virtual machine or container.
Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT

I modify the content of the file ".wslconfig" as below.

[wsl2]
kernel=C:\Users\XXX YY ZZZ\bzImage
swap=0
localhostForwarding=true

It seems well but there is also a line message shown.
wsl: Invalid escaped character: 'U' in C:\Users\XXX YY ZZZ.wslconfig:2
I am not sure if " kernel=C:\Users\XXX YY ZZZ\bzImage" is correct. Would you pls give the comments? Thanks!

Expected Behavior

No error messages are shown after executing the command "wsl".

Actual Behavior

Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT

and

wsl: Invalid escaped character: 'U' in C:\Users\XXX YY ZZZ.wslconfig:2

Diagnostic Logs

No response

@elsaco
Copy link

elsaco commented Jun 15, 2023

@piggy2011 user \\ instead for kernel path, like kernel=C:\\Users\\XXX YY ZZZ\\bzImage Also, if your username contains spaces, need to be escaped.

@piggy2011
Copy link
Author

piggy2011 commented Jun 15, 2023

@piggy2011 user \\ instead for kernel path, like kernel=C:\\Users\\XXX YY ZZZ\\bzImage Also, if your username contains spaces, need to be escaped.

Hi, my username contains spaces. How to escape spaces in defining kernel path? Thanks!

@piggy2011
Copy link
Author

@piggy2011 user \\ instead for kernel path, like kernel=C:\\Users\\XXX YY ZZZ\\bzImage Also, if your username contains spaces, need to be escaped.

To specify a path with spaces in the .wslconfig file for WSL2, I use double quotes to enclose the path. kernel="C:\Users\XXX YY ZZZ\bzImage"
Now, the problem is solved.

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

2 participants