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

Upgrading to latest WSL (Windows Store version) stops the GO-WSL2-HOST working #67

Open
jaycangel opened this issue Dec 29, 2021 · 7 comments

Comments

@jaycangel
Copy link

WSL has recently moved to a "windows store" application. I upgraded by running wsl.exe --update. My wsl ubuntu server works fine buut go-wsl2-host no longer detects the change in IP and updates host file.

I'm not sure what's changed in the underlying architecture anymore but sadly the service doesn't work anymore. I'm on Windows 11 - latest everything

@jaycangel jaycangel changed the title Upgrading WSL to Windows Store stops the service working Upgrading to latest WSL (Windows Store version) stops the GO-WSL2-HOST working Dec 29, 2021
@jaycangel
Copy link
Author

For more information on what i mean by Windows Store Application here is the release article - https://devblogs.microsoft.com/commandline/a-preview-of-wsl-in-the-microsoft-store-is-now-available/

@mrebello
Copy link

After update to "ubuntu" (instead of ubuntu2004) and install docker:
C:\xxx>wsl2host debug

wsl2host.info(1): starting wsl2host service
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x50c352]

goroutine 1 [running]:
github.com/shayne/go-wsl2-host/cmd/wsl2host/pkg/service.Run(0x5812a0, 0xc000058570, 0x2, 0x0)
/workspaces/go-wsl2-host/cmd/wsl2host/pkg/service/service.go:92 +0x742
github.com/shayne/go-wsl2-host/cmd/wsl2host/internal.(*windowserver).Execute(0x687be0, 0xc000058590, 0x1, 0x1, 0xc00006a120, 0xc00006a180, 0xc00000a560)
/workspaces/go-wsl2-host/cmd/wsl2host/internal/service.go:33 +0x523
golang.org/x/sys/windows/svc/debug.Run(0x554639, 0x8, 0x57fc20, 0x687be0, 0x0, 0x0)
/go/pkg/mod/golang.org/x/sys@v0.0.0-20190626221950-04f50cda93cb/windows/svc/debug/service.go:40 +0x153
github.com/shayne/go-wsl2-host/cmd/wsl2host/internal.RunService(0x554639, 0x8, 0xc000010001)
/workspaces/go-wsl2-host/cmd/wsl2host/internal/service.go:81 +0x1bf
main.main()
/workspaces/go-wsl2-host/cmd/wsl2host/main.go:42 +0x384

@Ars3n3-Lupin
Copy link

WSL has recently moved to a "windows store" application. I upgraded by running wsl.exe --update. My wsl ubuntu server works fine buut go-wsl2-host no longer detects the change in IP and updates host file.

I'm not sure what's changed in the underlying architecture anymore but sadly the service doesn't work anymore. I'm on Windows 11 - latest everything

I didn't find if you solwed this issue but I have found the same problem after upgrading to windows 11 last version.

Resolving is so easy.

Navigate to hosts file
C:\Windows\System32\drivers\etc\hosts
-> right click on hosts file
-> untick (read-only)
if it was not ticked
-> go to the security card and change user privilages to the same as admin has

Here is how you can do it
https://techcult.com/fix-access-denied-when-editing-hosts-file/
it is marked as method 2 and 3

The next step is
.\wsl2host.exe stop
.\wsl2host.exe remove
.\wsl2host.exe install

that's it . Maybe it helps to other users ;)

@Ars3n3-Lupin
Copy link

Hi

After the last Windows 11 update => latest version 22H2 (OS build 22621.608) I can only run wsl2host.exe in debug mode.

.\wsl2host.exe install => it succeeded. I logged in as local user. I checked windows services and it's running good until I tried ping ubuntu2004.wsl. Ping is not working. IP address in hosts file is not changed after restarting system. But windows services running properly. Auto-start and logging in works good.

I tried remove wsl2host.exe and install it again and again but it doesn't help.

Everything I can do is run wsl2host.exe in debug mode. This starts wsl2host.exe properly.

I looked into Event viewer in windows and I have found one repeated wsl2host error.
"failed to get infos: wsl list all failed: wsl -l -v failed: exit status 1"
But after typing wsl -l -v in powershel , it shows me results of running distros properly.

Is there a way how to solve this problem to run wsl2host not just in debug mode as I run before?

@bayard
Copy link

bayard commented Nov 30, 2022

Wsl2host is broken in latest update of windows 11 (Only work in debug mode, service mode result in "wsl -l -v error" and cannot obtain ip address of wsl.). I wrote a script in linux to complete the job, see: https://github.com/bayard/WSL2_UPDATE_HOSTS

@Kwaadpepper
Copy link

Kwaadpepper commented Feb 9, 2023

Are there any instructions on how to configure this properly as a workaround for now ?
I mean for using wsl2host

@gdragon-git
Copy link

Would also love a fix

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

6 participants