-
Notifications
You must be signed in to change notification settings - Fork 822
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 from WSL1 to WSL2 breaks custom hostnames #5780
Comments
WSL2 Wish-List Feature Fix ?? PROBLEM DESCRIPTION: "DOUBLE TROUBLE" NON UNIQUE WSL2 HOST NAME CREATES UNNECESSARY "NAME RESOLUTION" CONFUSION WHICH CAN CURRENTLY ONLY BE WORKED AROUND BY USING FULLY-QUALIFIED HOST NAME Example of problem (Accessing Windows Host X-Serv) The following will not work: DISPLAY=HOSTNAME:0 THE WORK AROUND IS DISPLAY=HOSTNAME.WINHOST-DOMAIN:0 Additional wsl.conf Network Keywords ?? Allow custom configuration of HOSTNAME file so that WSL2 VM machine network name is unique and different from windows host machine name ( I would prefer the default to be the linux distribution name ) this would of course impact the HOST file as well |
I am not sure if this feature is documented or available in stable Windows OS versions. For my case, I have tried this in latest Windows Insider build and it works. Create a [network]
hostname = HelloWorld Change the host name as you want. |
That doesn't expose the hostname to Windows. Whether that is by-design or WIP I can't say. |
In |
The somehow is you can |
Whatever circuitous path Yoga and Acrylic are taking, the result is an ipv4 address is being given to Chrome. There's no ipv4 listener on the WSL2 side. Similar #5844 (message), your options are: (a) get Chrome to point at ipv6 Spiritually related #4592 (message), whether bouncing DNS queries off of two third-party Windows networking services is a good idea can be left to the beholder. For an alternate approach to accomplishing a similar end result, folks may want to consider |
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Need to restart to see the change. What this does is change the name /etc/hosts file; where as, changing in the host file does not persist. In this case the wsl.conf settings will not persist. |
Environment
Steps to reproduce
Install Ubuntu 20.04 with WSL 1
Install Apache2 in WSL
Restart Acrylic
Install Yoga DNS
Define Acrylic as a DNS server for Yoga DNS
Define a Yoga DNS rules to route DNS queries to Acrylic for *.test.tld
Check browsing to http://local.test.tld works in Chrome
Upgrade your WSL to version 2 in PowerShell as admin
Expected behavior
Chrome still displays a page at http://local.test.tld
Actual behavior
Chrome displays an error page at http://local.test.tld "ERR_CONNECTION_REFUSED"
Additionnal information
Accessing http://localhost/ works in Chrome in WSL2
Using the WSL 2 with the IP found with
ip addr | grep eth0
does not work neither with:The text was updated successfully, but these errors were encountered: