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

/etc/resolv.conf gets removed on shutdown/startup #6977

Open
TotiTolvukall opened this issue May 22, 2021 · 73 comments
Open

/etc/resolv.conf gets removed on shutdown/startup #6977

TotiTolvukall opened this issue May 22, 2021 · 73 comments
Assignees

Comments

@TotiTolvukall
Copy link

Environment

Windows build number: 21387.co_release.210518-1436 / 10.0.21387.1
Your Distribution version: Ubuntu 20.04
Your WSLg version: [Open 'Apps and Features' and check the version of 'Windows Subsystem for Linux GUI app support', e.g: 0.2.3.13]

Steps to reproduce

Create the /etc/wsl.conf containing the two magic lines:
user@host:/etc$ cat wsl.conf
[network]
generateResolvConf = false
user@host:/etc$

Make sure you have your own resolv.conf:
user@host:/etc$ sudo rm -f resolv.conf && sudo cat > resolv.conf << EOT
nameserver 1.1.1.1
nameserver 8.8.8.8
domain mydomain.com
search mydomain.com
EOT
Password:
user@host:/etc$

In CMD, do a wsl --shutdown

Start WSL Ubuntu 20.04 session again, and check for the /etc/resolv.conf.

It will be gone.

WSL logs:

The wsl logs reveal nothing about resolv.conf

Expected behavior

Expected is that MY resolv.conf is left alone. As it did in the WSL (pre-g release) version.

Actual behavior

Actually my resolv.conf is being forcefully removed - which IS making WSLg unusable until a new one has been put in place.

@spronovo
Copy link
Collaborator

Thanks for your report @TotiTolvukall, WSLg doesn't touch this file. This sounds like a possible recent regression in WSL core. @benhillis as fyi.

I'll move this issue to the main WSL github to get this investigated further.

@spronovo spronovo transferred this issue from microsoft/wslg May 23, 2021
@0xbadfca11
Copy link

0xbadfca11 commented May 23, 2021

sudo cat > resolv.conf

Suspicious command line.
Isn't this command line unsuccessful anyway?

@TotiTolvukall
Copy link
Author

@0xbadfca11 how about at least making an attempt at understanding what's being done before commenting like that?

No, it's not unsuccessful. It's perfectly successful.

try it on a different file.

sudo rm -f filethatdidntexist && sudo cat > filethatdidntexist << EOT
I should have tried this myself before making me look smart on github
EOT

You will be asked for a password - type it in correctly and the SECOND sudo will run without a password.

But THIS is a digression. The original problem is that of resolv.conf being deleted at boot/shutdown and that is what this ticket should address, not script semantics (regardless if you do understand them or not).

@SheepReaper
Copy link

Check out #5420 (comment) See if that sequence helps

@TotiTolvukall
Copy link
Author

@SheepReaper the problem isn't the shutdown itself (and I wouldn't have reported it unless I'd tried all kinds of WSL shutdowns - including full computer reboots). The problem is the procedure running (I suspect at start-up, not shutdown as you normally want your autogenerated resolv.conf to be generated from the current settings, not the settings when you last turned off your computer) at start-up. Without having dug into it, my gut feeling tells me;
It should be like this:

  • if /etc/wsl.conf exists
    • if it contains "generateResolvConf" and it's set to "false"
  • : don't do anything
    
    • else
  • : delete /etc/resolv.conf
    
  • : symlink to /run/resolvconfsomething
    

But is more like this

  • delete /etc/resolv.conf
  • if /etc/wsl.conf exists
    • if it contains "generateResolvConf" and it's set to "false"
  •  : don't do anything
    
  • .
  • .
  • .

Just a gut feeling, but it matches up to what I'm seeing.

For now, I have a /etc/resolv.conf.real which is my actual resolv.conf file, and then at EVERY reboot of my computer or fresh startup of WSL, I do "sudo ln -s /etc/resolv.conf.real /etc/resolv.conf"

@therealkenc
Copy link
Collaborator

image

@therealkenc therealkenc added the needs-investigation likely actionable and/or needs more investigation label May 25, 2021
@therealkenc therealkenc changed the title /etc/resolv.conf gets removed on shutdown/startup of WSLg container /etc/resolv.conf gets removed on shutdown/startup May 25, 2021
@clodbrasilino
Copy link

clodbrasilino commented May 27, 2021

Same issue here.

Edition Windows 10 Pro
Version Dev
Installed on ‎5/‎23/‎2021
OS build 21387.1
Experience Windows 10 Feature Experience Pack 321.13101.0.3

EDIT: Linux version - Ubuntu 20.04 LTS

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\WINDOWS\system32> wsl
clod@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32$ sudo su
[sudo] password for clod:
root@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32# cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
root@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32# touch /etc/resolv.conf
root@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32# echo 'nameserver 1.1.1.1' > /etc/resolv.conf
root@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32# cat /etc/resolv.conf
nameserver 1.1.1.1
root@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32# cat /etc/wsl.conf
[network]
generateResolvConf = false
root@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32# exit
exit
clod@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32$ exit
logout
PS C:\WINDOWS\system32> wsl --shutdown
PS C:\WINDOWS\system32> wsl
clod@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32$ sudo cat /etc/resolv.conf
[sudo] password for clod:
cat: /etc/resolv.conf: No such file or directory
clod@DESKTOP-9QBVQDR:/mnt/c/WINDOWS/system32$

@wjzhou
Copy link

wjzhou commented Jun 10, 2021

I got the same result.

a working workaround for now:
sudo chattr +i /etc/resolv.conf

Full configuration:

# add config to /etc/wsl.conf
# or manually edit if you have other config in wsl.conf
sudo tee /etc/wsl.conf << EOF
[network]
generateResolvConf = false
EOF
# some document says need restart the wsl once for the configure to work
# for me, it works without it, keep it here for reference
# run in windows command
# wsl --shutdown

# /etc/resolv.conf is a symbol link, delete it to create a regular file
sudo rm /etc/resolv.conf
sudo tee /etc/resolv.conf << EOF
nameserver 8.8.8.8
nameserver 8.8.4.4
# search local
EOF

# this is the real bug in wsl GUI version reported here
# for some reason it always delete the /etc/resolv.conf when generateResolvConf = false
# this +i will prevent delete of the file
# to edit the file again please use
# sudo chattr -i /etc/resolv.conf
sudo chattr +i /etc/resolv.conf

The real bug here is that the /etc/resolv.conf file got deleted when generateResolvConf = false. (without creating new file)
So (my guess), there is a delete statement that deletes blinding without checking the generateResolvConf = false option.

But despite the current bug, I still think this whole process needs some design, at least more clear document in /etc/resolv.conf

  1. need to /etc/wsl.conf, the document is clear, so it's ok
  2. some document says need to wsl --shutdown for the option to take effect
  3. need to rm /etc/resolv.conf to remove the symbol link, this step is very easy to forget

@ajfpay
Copy link

ajfpay commented Aug 6, 2021

I got the same result.

a working workaround for now:
sudo chattr +i /etc/resolv.conf

Full configuration:

# add config to /etc/wsl.conf
# or manually edit if you have other config in wsl.conf
sudo tee /etc/wsl.conf << EOF
[network]
generateResolvConf = false
EOF
# some document says need restart the wsl once for the configure to work
# for me, it works without it, keep it here for reference
# run in windows command
# wsl --shutdown

# /etc/resolv.conf is a symbol link, delete it to create a regular file
sudo rm /etc/resolv.conf
sudo tee /etc/resolv.conf << EOF
nameserver 8.8.8.8
nameserver 8.8.4.4
# search local
EOF

# this is the real bug in wsl GUI version reported here
# for some reason it always delete the /etc/resolv.conf when generateResolvConf = false
# this +i will prevent delete of the file
# to edit the file again please use
# sudo chattr -i /etc/resolv.conf
sudo chattr +i /etc/resolv.conf

The real bug here is that the /etc/resolv.conf file got deleted when generateResolvConf = false. (without creating new file)
So (my guess), there is a delete statement that deletes blinding without checking the generateResolvConf = false option.

But despite the current bug, I still think this whole process needs some design, at least more clear document in /etc/resolv.conf

  1. need to /etc/wsl.conf, the document is clear, so it's ok
  2. some document says need to wsl --shutdown for the option to take effect
  3. need to rm /etc/resolv.conf to remove the symbol link, this step is very easy to forget

Omg, this script worked, thank you very very much

@benhillis
Copy link
Member

Typically this is happening because /etc/resolv.conf is a symlink to tmpfs. If you want to take ownership of this file, set the /etc/wsl.conf setting, and replace the /etc/resolv.conf symlink with a regular file.

@TotiTolvukall
Copy link
Author

It would be respectful to ALL the people in this thread @benhillis to at least glance over the discussion so far before replying with an entry that has zero weight.

It has already been concluded that by disabling WSL from messing with the resolver, it removes all traces of resolv.conf - symbolic links as well as regular files. And does so repeatedly (i.e. on every startup/restart.)

Thus the issue.

@benhillis
Copy link
Member

@TotiTolvukall - I appreciate you taking the time to file this issue, turns out there was some refactoring that introduced this issue. I'll get this sorted out.

This issue has a very common signature of a common pitfall people often run into, I apologize I got this conflated with that one.

@benhillis benhillis added the bug label Aug 10, 2021
@benhillis benhillis self-assigned this Aug 10, 2021
@benhillis benhillis removed the needs-investigation likely actionable and/or needs more investigation label Aug 12, 2021
@bjolivot
Copy link

hi!
Any news on that bug ?

@trexmaster
Copy link

@benhillis any news on this ? I'm also having this issue on Windows 11 build 22000.318

@Mr-EmPee
Copy link

Same problem, Windows 11 build 22000.318

@withinboredom
Copy link

sudo chattr +i /etc/resolv.conf

keeps the file after a reboot for me. It's not great, but serious kudos for suggesting that!

@azilber
Copy link

azilber commented Dec 7, 2021

This bug is damn annoying, and open since May, and now has wheedled itself into Windows 11.

@nwestra
Copy link

nwestra commented Dec 7, 2021

I don't recall seeing this behavior in Win10, but definitely confirm this behavior in Win11

@SheepReaper
Copy link

Not that there aren't valid use cases for specifying /etc/resolv.conf, but the examples above seem to want to use google dns.
Can you not use the default behavior (sets nameserver to hyper-v host network interface) and set your computer's DNS instead? (As a temp workaround, I mean)

@nwestra
Copy link

nwestra commented Dec 7, 2021

For me at some point last year whatever value WSL came up (within the linked resolv.conf) stopped working, so I ended up manually configuring /etc/resolv.conf (telling WSL to leave resolv.conf alone through /etc/wsl.conf).
This worked fine until I made the switch to Windows 11

@SheepReaper
Copy link

So 2 questions then:

  1. Were you on an insiders build on Win 10 with WSL2?
  2. Did you run wsl --install or wsl --update after upgrading to Win 11?

@nwestra
Copy link

nwestra commented Dec 7, 2021

  1. Nope, regular Win 10 builds from 1909 all the way to 21H2 before upgrading to Win11, at some point upgraded WSL to WSL2, not sure when
  2. Didn't use either, is that required?

@udoyhasan
Copy link

udoyhasan commented Sep 9, 2022

I was also facing this problem but I fixed it by following steps:

  • I deleted my default resolv.conf file and created a new one with my custom configurations and after that, I stopped the auto-deleting of the file by giving it read-only permission.
    sudo rm /etc/resolv.conf
    sudo touch /etc/resolv.conf
    sudo echo "nameserver 1.1.1.1" >> /etc/resolv.conf
    sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf
    sudo chattr +i /etc/resolv.conf 
  • Then I stop the auto wsl resolv configuration rewrite on startup.
    sudo rm /etc/wsl.conf
    sudo touch /etc/wsl.conf
    sudo echo "[network]\ngenerateResolvConf = false" >> /etc/wsl.conf

Hope this will also fix your issue :)

@luxzg
Copy link

luxzg commented Oct 24, 2022

W11 Pro 22H2 with WSL2 Preview (from Store) and Ubuntu (from Store), all fully updated including W11 patch that arrived just a day or two ago (one that enables File Explorer tabs i stable builds). No Insider builds.

  • file
    /etc/wsl.conf
  • contents
[boot]
systemd=true
[network]
generateResolvConf = false
  • file
    .wslconfig
  • contents
[wsl2]
networkingMode=bridged
vmSwitch=WSL_external
dhcp=false
  • file
    /etc/resolv.conf

  • contents
    nameserver 8.8.8.8

  • versions

wsl --version
WSL version: 0.70.0.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.675
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

For me personally resolv.conf remains intact after PC reboot or WSL instance restart after using generateResolvConf = false. Thanks for the suggestion. And sorry that it doesn't work for others.

@NickFall
Copy link

Hi @benhillis I think you forgot about this one

@boner-cmd
Copy link

boner-cmd commented Dec 7, 2022

It's possible this is being ignored (frustratingly, because it should at least be closed if they are going to ignore it...) because the documented solution looks like it works now. I'm not the first user to suggest it here, or the second, but here is more system detail if it helps.

> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 11 Home
OS Version:                10.0.22621 N/A Build 22621

> wsl --version --verbose
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819

> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2

Freshly installed and updated version of WSL2, running freshly-installed Ubuntu (the generic distro, not a specific version) from the Microsoft App Store. Installed WSL itself from Windows, not the App Store. Encountered the common problem where my distro could not connect to the internet. Searching led to #5420, which led to this issue.

  • Opened the distro, then ran wsl --shutdown in PowerShell in the background

  • Manually created /etc/wsl.conf and added as suggested in the tip from resolv.conf:

[network]
generateResolvConf = false
  • Purely to test, closed the distro and reopened it. Now no resolv.conf is created at all, as other users noted.

  • Shutdown WSL again via PowerShell just in case.

  • Manually created resolv.conf and added a DNS.

nameserver 1.1.1.1
  • Closed the distro and reopened it. My custom resolv.conf is still there, and WSL didn't overwrite it. My custom wsl.conf telling WSL not to overwrite resolv.conf is also still there.

Happy to provide any additional system info. Tried to start from as clean a setup as possible.

Not endorsing the fact that Microsoft let the community struggle with this bug for years, just suggesting that the bug may have been quietly fixed by restoring the intended (but still obtuse) behavior of requiring wsl to be shutdown to make sure changes stick.

I did not try a single other intended solution first to preserve integrity, and like many others refused to use the "immutable file" kludge. Hope this helps someone.

@luxzg
Copy link

luxzg commented Dec 7, 2022

As I mentioned about a month and a half ago, like @boner-cmd I have no issues with my custom resolv.conf, and wsl.conf option generateResolvConf = false works for me just fine. But just as described above, I've also started with fresh WSL2 install, on fresh OS, with fresh Ubuntu distro. If someone is still having issues perhaps their workarounds from yesteryear are now working against you. I'm now on 1.0.0 as well, and all works as expected.

@lucastheisen
Copy link

For me, i was able to get it working again by editing my /etc/resolv.conf then immediately wsl.exe --shutdown. After that it did stick around for next wsl shutdown. Also could be worth mentioning that a resolv.conf is still getting generated at /mnt/wsl/resolv.conf, but it is not replacing mine.

@jimklimov
Copy link

Thanks for all the suggestions here. Just one pattern repeated by many seems fishy: sudo CMD >> /etc/filename: the redirection >> should be done by your user shell, so unprivileged and unable to write to a system-protected file. I do not know if distros for WSL handle it differently, but in all other OSes people jump through hoops to get such files opened and written by a privileged process - often via cmd | sudo tee (-a) /etc/filename pattern.

Hope this helps :)
Jim Klimov

@AnonDrew
Copy link

OS Name             : Microsoft Windows 11 Home
OS Version          : 10.0.22621 N/A Build 22621
OS Manufacturer     : Microsoft Corporation
OS Configuration    : Standalone Workstation

I encountered this issue after a fresh W11 install a few days ago.
I installed WSL through the "Windows Features" checkbox GUI, whatever that does to install WSL.
Note that wsl --version did not work and did not seem to show up in the --help list in this version of WSL I got.

I wanted to avoid sudo chattr +i /etc/resolv.conf.
I used wsl --set-default-version 2 and reinstalled Ubuntu (latest) and still had the same problem.
The fresh install comments suggested to me that I should completely uninstall WSL; did so following this article:
https://pureinfotech.com/uninstall-wsl-windows-11/
I then reinstalled WSL using wsl --install in PowerShell.
Deleted Ubuntu (Default), then reinstalled Ubuntu with wsl --install Ubuntu.

At this point, I am in Ubuntu and manually created the wsl.conf with

[network]
generateResolvConf = false

Exited Ubuntu and did wsl --shutdown.
Went back in and created my custom resolv.conf.
Restarted WSL and ls /etc/ and my resolv.conf was not overridden and still has not after more WSL restarts.

PS C:\Users\Anon> wsl --version
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1105

@luxzg
Copy link

luxzg commented Feb 11, 2023

@AnonDrew

I encountered this issue after a fresh W11 install a few days ago.
I installed WSL through the "Windows Features" checkbox GUI, whatever that does to install WSL.
Note that wsl --version did not work and did not seem to show up in the --help list in this version of WSL I got.

For whatever reason, version installed from Microsoft Store is NEWER.

I'd suggest to uninstall WSL, reboot host PC, and install from MS Store.

Running version after that should work. That will also shiw version 1.x.x being installed confirming latest WSL2 version.

From there on just keep updating from Store.

I'm not sure why there's disparity between the installed versions, but several new features are absent as well from non-store versions.

@mb555444
Copy link

This bug still exists no matter what. resolv.conf gets deleted from /etc upon shutdown of WSL.

@leiflinse-trivector
Copy link

leiflinse-trivector commented Aug 14, 2023

I still have the issue and I noticed that for me wsl --version says it doesn't support the --version parameter. I have checked for windows updates.

PS C:\Users\anon> wsl --version
Invalid command line option: --version
Copyright (c) Microsoft Corporation. All rights reserved.

Usage: wsl.exe [Argument] [Options...] [CommandLine]

Reading in wsl --help of this version it seems there is a wsl --update command that updates the wsl engine.

EDIT: After backing up my wsl container I ran wsl --update and now after I created /etc/resolv.conf it does no longer gets deleted when I restart wsl.

TL;DR
If wsl --version does not work, or even if it does, you might be running on an old WSL engine despite having installed all windows updates. To update it, run wsl --update. Then create /etc/resolv.conf once more and it hopefully stays for you too.

@SheepReaper
Copy link

SheepReaper commented Aug 14, 2023 via email

@SheepReaper
Copy link

@kdolgikh
Copy link

kdolgikh commented Oct 2, 2023

I have the same issue on Win 11 Enterprise, wsl --version below:

WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2283

My workaround is to modify "/etc/wsl.conf" first, then do wsl --shutdown, then modify "/etc/resolv.conf". I run a script to install and configure WSL Debian, this solution has worked reliably so far.

@joebaca
Copy link

joebaca commented Oct 12, 2023

This is really effing annoying BS. Typical MS shit.

@CaspervdKerk
Copy link

#6977 (comment)

My workaround is to modify "/etc/wsl.conf" first, then do wsl --shutdown, then modify "/etc/resolv.conf". I run a script to install and configure WSL Debian, this solution has worked reliably so far.

This seems to be the solution for now. It would seem that on first wsl reboot after generateResolvConf has been set to false it removes /etc/resolv.conf, but after that it doesn't touch it anymore.

@ayushshukla7777
Copy link

Why isn't this getting fixed. Every now and then, I have to spend whole day fixing these issues on wsl. I guess thats why developers are using macbook. Simply- the OS shouldn't come in way of user.

@joebaca
Copy link

joebaca commented Dec 26, 2023

Ya, fix this BASIC functionality. I know we all want to contribute to core kernel but this shit is important too!!

@aprescott706
Copy link

Also seeing this issue.

OS: Windows 11
WSL: ubuntu 20.04

/etc/wsl.conf contains
[network]
generateResolvConf = false

I manually create /etc/resolv.conf, shutdown the running instance, start back up and /etc/resolv.conf is gone.

Workaround I'm using is "sudo chattr +i /etc/resolv.conf"

@asampal
Copy link

asampal commented Mar 27, 2024

@aprescott706 are you using the latest, 2.2.1 at the moment, version of WSL?

@aprescott706
Copy link

@aprescott706 are you using the latest, 2.2.1 at the moment, version of WSL?

I'm not sure to be honest. The command wsl --version/-v doesn't work.

File version on wsl.exe is 10.0.22621.1

@SheepReaper
Copy link

That's because you have the 'in box' version of wsl. You must install wsl from the M$ Store.

easiest way to determine you have the wrong version installed.

when the M$ store version is installed the output is thus:

wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3296

@SheepReaper
Copy link

@asampal
Copy link

asampal commented Mar 27, 2024

Sometimes, based on issues addressed, you might want to install the latest preview version here, https://github.com/microsoft/WSL/releases. You can find the binaries by expanding the "Assets" section.

@joebaca
Copy link

joebaca commented Mar 28, 2024

I have the version you show here an still had to use the posted workaround. This should not require the suggested workaround. (Taut is what you are suggesting, the workaround was required because the user did not have the latest version?).

@AyushSehrawat
Copy link

Also seeing this issue.

OS: Windows 11 WSL: ubuntu 20.04

/etc/wsl.conf contains [network] generateResolvConf = false

I manually create /etc/resolv.conf, shutdown the running instance, start back up and /etc/resolv.conf is gone.

Workaround I'm using is "sudo chattr +i /etc/resolv.conf"

Same issue, disabled the automatic generation and on restart the file is gone

WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3296

@jrausch12
Copy link

Experiencing the issue as well

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22621.3958

@ragmel
Copy link

ragmel commented Sep 6, 2024

Same issue:

WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.4112

@SheepReaper
Copy link

Still don't know if it's a bug or not. But can confirm that disabling resolv.conf generation does in fact delete it, but only for the first wsl --shutdown for me. If I set generation to false, logout, and then call wsl --shutdown, on the next boot /etc/resolv.conf is missing. But then I can create it, and it persists for every other wsl reboot.

So maybe not bug, but very annoying behavior. Why not just leave the file there even if it was originally generated? (Asking MS here)

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4112

@chuanqisun
Copy link

My resolv.conf just disappeared randomly. There was no shut-down or restart. I was using it just fine and suddenly I lost domain name resolution.

WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests