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

Service appears to be running but nothing is showing up on \hosts\ #54

Open
bugpoop opened this issue Jan 30, 2021 · 9 comments
Open

Service appears to be running but nothing is showing up on \hosts\ #54

bugpoop opened this issue Jan 30, 2021 · 9 comments

Comments

@bugpoop
Copy link

bugpoop commented Jan 30, 2021

Hi, I've followed the guide from https://www.most-useful.com/ubuntu-20-04-desktop-gui-on-wsl-2-on-surface-pro-4.html however no matter what I do, I cant get wsl2-hosts working properly. I have a windows 10 pro 2004, the wsl2host service appears to be running, but (while wsl is running) when I type cat \windows\system32\drivers\etc\hosts on cmd, the wsl2host ip doesnt appear to be there.

I am a local user, I do not have an account attached to the computer. The distro I'm using is Ubuntu 20.04. I am running the latest version of wsl2-host.

I have tried both logging out and rebooting my computer. I have checked and my hosts file is not read only. On the event viewer I get failed to get infos: wsl list all failed: wsl -l -v failed: exit status 4294967295. I have tried uninstalling and re-installing the service.

Any and all help would be greately appreciated!

@toriqo
Copy link

toriqo commented Mar 8, 2021

your user most probably doesn't have the rights run services on logon. go to services and edit the WSL2 Host service to logon as Local System account

@Letlaka
Copy link

Letlaka commented Jul 3, 2021

your user most probably doesn't have the rights run services on logon. go to services and edit the WSL2 Host service to logon as Local System account

I changed the logon to Local System but still, nothing gets written to hosts.

@fy1789
Copy link

fy1789 commented Jul 11, 2021

me too

@toriqo
Copy link

toriqo commented Jul 11, 2021

Anything in the system logs? That's how I found my issue…

@AdrienGiboire
Copy link

Thanks @toriqo

That's was the thing for me!

@johny-mnemonic
Copy link

johny-mnemonic commented Sep 13, 2021

I seem to have similar issue.
When I run the service under Local System account I am getting these errors in the log:
failed to get infos: wsl list all failed: wsl -l -v failed: exit status 3221226505

And when I change the service to run under my admin account I am getting these errors:
failed to get IP for distro "Ubuntu-20.04": unable to find IP
followed by this:
GetDefaultDistro failed: unable to find IP

But when I execute the command manually from elevated prompt it works just fine:

PS C:\Users\XXX> wsl hostname -I
172.21.142.222

I have only single distro installed in WSL, so I never bothered to explicitly set it as default. Could that be an issue?

SOLVED: Seems like it is needed to restart WSL (i.e. using wsl --shutdown ) after wsl2host service is already running. It can't get the IP of already running WSL for some reason...

@AdrienGiboire
Copy link

AdrienGiboire commented Sep 14, 2021

I think I have the same issue. Would there be a way to give an order in which we want the services to launch?

EDIT: We can change the startup order of services but I don't find custom one, like go-wsl2-host.

@fjl-haha
Copy link

I have the same error

  1. I found that the default is windows docker desktop
wsl -l -v 
  1. And then I set arch as the default.
wsl -s Arch
  1. Then reset the user name and password of the wsl2host service and restart the service.

  2. Finally restart Arch, this time it works perfectly.

net stop LxssManager

net start LxssManager

@jarrard
Copy link

jarrard commented Jun 9, 2022

Yeah using default Ubuntu and I get the below
failed to get infos: wsl list all failed: wsl -l -v failed: exit status 1

wsl --shutdown and restarting a wsl service appears to work. odd indeed.

Hosts is writable now; but the service still seems to have issues and spits out that error allot and only writing to Hosts file after a wsl shutdown.

Not being able to get ip from already running WSL kind of makes this app not very useful for me.

Running wsl2host.exe debug puts the ip into hosts.. weird.

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

8 participants