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

Windows hosts file is not updated #2

Open
rbutera opened this issue Dec 14, 2020 · 2 comments
Open

Windows hosts file is not updated #2

rbutera opened this issue Dec 14, 2020 · 2 comments

Comments

@rbutera
Copy link

rbutera commented Dec 14, 2020

Thanks @hndcrftd for the great utility.

However, I am unable to get it to work as the windows hosts file is not updated.

No error is produced on my system when running the install script

windowshost.local is successfully added to /etc/hosts but the hostname entered in the script is never added to windows hosts.

Output on my machine:

➜ cd ~;\
➜ curl -s https://raw.githubusercontent.com/hndcrftd/wsl2ip2hosts/master/install.sh > wsl2ip2hosts.install.sh;\
➜ chmod +x wsl2ip2hosts.install.sh;\
➜ sudo PATH="$PATH" ~/wsl2ip2hosts.install.sh
[sudo] password for rai:
Would you like to add your Windows IP to your WSL /etc/hosts? [y/n] (default: y) :y

Enter hostname for Windows (default: windowshost.local) :

Would you like to start httpd web server when WSL starts? [y/n] (default: y) :

For your WSL enter a hostname or multiple, separated by space
:wsl.local

Populating IPs, this will take a few seconds...
Installation completed. The following entries are now in effect:
172.17.80.1 windowshost.local
172.17.94.115 wsl.local

@giovannicandido
Copy link

Same thing here, not working

@zb140
Copy link

zb140 commented Dec 1, 2021

If anyone's still looking for a solution to this, the issue I was having was that none of the calls to Windows exes were working. I fixed it by changing https://github.com/hndcrftd/wsl2ip2hosts/blob/master/install.sh#L8 and https://github.com/hndcrftd/wsl2ip2hosts/blob/master/install.sh#L39 to use sudo PATH="$PATH" WSL_INTEROP="$WSL_INTEROP" instead and now it works. But I was getting some extra errors in my console that helped track it down, and I don't see them in the output above, so maybe it's a different problem.

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

3 participants