shayne / go-wsl2-host

Automatically update your Windows hosts file with the WSL2 VM IP address
1.65k stars 140 forks source link

Doesn't Work #4

Closed sidgrafix closed 4 years ago

sidgrafix commented 5 years ago

Downloaded 0.11 zip and .exe

Placed in directory on my Win10 system and extracted the zip (extracted files and .exe all in same directory, opened CMD as administrator in directory ran .\go-wsl2-host.exe install and entered my username and password when asked.

Launched Debian WSL2

Opened HOST file no IP added and no wsl.host in list.

Stopped Debian and restarted windows.

Launched Debian, still nothing added to HOST file, running ping wsl.local returns "could not find host!

Did I do something wrong??? I would really like for this to work! updating the HOST file manually every time I reboot is a real pain.

Going to try alpha 0.1.0 now to see if that is any better!

Thank You, sidgrafix

sidgrafix commented 5 years ago

UPDATE: Got it sorted-kinda

I removed 0.1.1-alpha with .\go-wsl2-host.exe remove then switched to directory with 0.1.0-alpha and ran .\go-wsl2-host.exe install (input user and password when requested.)

HOWEVER, once I Ctrl-C out of debug mode in CMD prompt the service reports stopping...

Next I opened Windows Services find wsl2host (service is not running and lists as automatic startup) -Try to start service, get permissions error (which is weird considering using debug forced the service to start (while it was in debug mode,meaning credentials should be good)

All seams to be working properly now! Not sure if this is a bug or not, but I couldn't find anything else relating to the service and checking it manually so I figured it out myself and thought I would update this in case someone else ran into a similar issue.

Thank you for the utility as it eleviates a headache when dealing with the changes in IP handling between WSL2 and WSL

~sidgrafix

mpcjanssen commented 5 years ago

@sidgrafix It is essential that the service is running as the same user as the WSL user. Otherwise the WSL install will not be found. The permission denied errors you see strongly suggest this is your problem.

When you use debug you are not starting the service, you are just running the script as the current user. Which is why it works in that scenario.

lucaskds commented 5 years ago

It wasn't working for me because my password was too long and the service was failing silently. So I changed the password manually on the service config(WSL2 Host). After this, it worked fine :)

j842 commented 5 years ago

I needed to set the password in the Services control panel after installing (I have a very long password). Worked fine after that.

shayne commented 4 years ago

Give 0.2.0 a try. Just released. Make sure you check the case sensitivity of your username by running net user from CMD.

You can always Start->Run services.msc and locate the WSL2 Host service, go to properties then the Log On tab and set your username and password there.

diqidoq commented 4 years ago

This issue isn't fixed nor has the user reported back that something else has caused this issue. Not sure why this issue is closed then.

Narimm commented 4 years ago

The OP reported he had resolved his issue on July 24 - the title of this issue is also unhelpful and non specific.

diqidoq commented 4 years ago

The OP reported he had resolved his issue on July 24 - the title of this issue is also unhelpful and non specific.

True but...

1.) From what I know about issue queues, is that if a title is unhelpful the title will be changed regarding the real issue to keep track of the underlying problem for later reference.

UPDATE: Got it sorted-kinda

2.) Does may sound "kinda" fixed from a users perspective, but do not really sound like fixed from a developers perspective. And the follow up posts of other users sound like open questions to the maybe underlying issue at least? And there are reasons to believe that these 2 issues are maybe connected: https://github.com/shayne/go-wsl2-host/issues/1 Never mind, Just thoughts...