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

generateResolvConf = false did not work in wsl.conf #8030

Closed
1 of 2 tasks
mikezerosix opened this issue Feb 8, 2022 · 10 comments
Closed
1 of 2 tasks

generateResolvConf = false did not work in wsl.conf #8030

mikezerosix opened this issue Feb 8, 2022 · 10 comments
Labels
Store WSL Issue specific to WSL in the Microsoft Store

Comments

@mikezerosix
Copy link

mikezerosix commented Feb 8, 2022

Version

Windows 10 Enterprise H20

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

OpenSuse15.3 and Ubuntu 20.4

Other Software

nada

Repro Steps

Create file in linux :

/etc/wsl.conf

containing text

[network]
generateResolvConf = false

Expected Behavior

when you start the WSL with current distro the /etc/resolv.conf in no autogenerated and file is overwritten.
Per the Micker Mouse WSL documentation.

Actual Behavior

/etc/resolv.conf is always overwritten. It does matter that you restart wsl or the wsl service or the whole computer. This setting has no effect no matter what you do. /etc/resolv.conf is ALWAYS auto generated and overwritten.

Diagnostic Logs

No response

@mikezerosix
Copy link
Author

mikezerosix commented Feb 8, 2022

No matter what you restart or what distro you use, the setting is still not working in WSL 2.

ch mod+own are same as other files in the /etc (a+r, root )

File is written with vim in linux so encoding nor LF is not messed up.

It is 100% identical text to what the auto generated resolv.conf comment says. Half a dozen ppl in our dev team report same problem.

@ghost ghost self-assigned this Feb 8, 2022
@ghost ghost added the Store WSL Issue specific to WSL in the Microsoft Store label Feb 8, 2022
@ghost
Copy link

ghost commented Feb 18, 2022

@mikezerosix I've been investigating this issue, and I wanted to double-check and see something first. Do you and the others having this issue have the resolvconf package installed? Could you post the output of running wsl --exec resolvconf? Also, how are you making changes to the /etc/resolv.conf file?

@ghost
Copy link

ghost commented Feb 22, 2022

@mikezerosix for a quick fix, try deleting /etc/resolv.conf and re-making it with your changes. If generateResolvConf = false those changes should persist after restarting WSL.

@ghost
Copy link

ghost commented Mar 1, 2022

@mikezerosix has this resolved your issue?

@mikezerosix
Copy link
Author

It is completely random and inconsistent. I made changed I restarted WSL service per documentation. Then I do nothing and few days later when I restart the whole machine and it takes effect.

I copy working resolve.conf copy over the auto generated. I have wsl.conf per instructions and it does not seem to work. chattr -i /etc/resolv.conf after whole machine reboot seemd to work preventing the overwriting of manually edited file.

@ghost
Copy link

ghost commented Apr 5, 2022

@mikezerosix this issue has been fixed in Store WSL, please update if you haven't done so. Thanks!

@ghost ghost closed this as completed Apr 5, 2022
@nmofonseca
Copy link

nmofonseca commented May 9, 2022

hello @owenschupp,

I don't believe this should be closed, I am facing this issue, when you say Store WSL what does this mean?

Unfortunately, I can't use the Windows store since it's blocked by my IT, to install WSL I needed to follow the manual instructions provided by Microsoft here

I am using Ubuntu 20.04.4 LTS which was downloaded from the link available in the instructions mentioned.

I don't want to open a new issue without confirming there is something I can still do but if not I will open a new issue.

@onomatopellan
Copy link

@nmofonseca Are you in Windows 11? Since you are blocked I think it's worth trying to install the store version manually. Download the latest .msixbundle file from https://github.com/microsoft/WSL/releases and install it from elevated Powershell like this:

Add-AppxPackage .\Microsoft.WSL_0.58.3.0_x64_ARM64.msixbundle

@nmofonseca
Copy link

nmofonseca commented May 25, 2022

Add-AppxPackage .

Hello @onomatopellan ,

I believe this has sorted my issue, In have installed the latest release as you described, and this is the output I get now from --version:

wsl --version
WSL version: 0.58.3.0
Kernel version: 5.10.102.1
WSLg version: 1.0.33
MSRDC version: 1.2.2924
Direct3D version: 1.601.0
Windows version: 10.0.22000.675

Then I removed the immutable flag from my /etc/resolv.conf and restarted wsl using wsl --shutdown and when my Ubuntu started again the /etc/resolv.conf is still there intact.

I have also started a new fresh Debian distro and can also confirm that everything worked as expected.

Thank you so much for your help.

Cheers

@asaf92
Copy link

asaf92 commented Jul 7, 2022

@onomatopellan
Thanks!

It's weird that double clicking the msixbundle file doesn't work, but running this specific command from an elevated PS which is not documented anywhere except for your GH comment does work 🤔

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Store WSL Issue specific to WSL in the Microsoft Store
Projects
None yet
Development

No branches or pull requests

4 participants