GithubHelp home page GithubHelp logo

hndcrftd / wsl2ip2hosts Goto Github PK

View Code? Open in Web Editor NEW
26.0 1.0 3.0 106 KB

Updates WSL2 IP and fqdn in Windows etc/hosts on WSL start

License: MIT License

Shell 85.16% PowerShell 14.84%
wsl2 hostnames ipv4

wsl2ip2hosts's People

Contributors

hndcrftd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wsl2ip2hosts's Issues

Access to the path 'C:\WINDOWS\system32\Drivers\etc\hosts' is denied.

Hi,

when I try to run wsl2ip2winhosts.ps1 it will always throw the error -
image

I've tried to set permissions on host file for EVERYONE to FULL CONTROLL but still receiving the same error. I can edit it via Notepad but not with PS :(.

How did you make it to edit host file by PS?

How can i use it

Hi, my first use it.but when I get the script to my wsl2 host.then use "sh XXXX.sh",nothing happeded

How to remove the script execution

Hi, thank you for your work.

How can I remove everything that the script does...I have pretty complex use-cases and this script does not write correctly the WSL /etc/hosts for in my machine.

I tried to re-run the installation to avoid it running every time i start the WSL but it always update my hosts files...

may you help me please?

Windows hosts file is not updated

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.