Skip to content

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

Open
@TotiTolvukall

Description

@TotiTolvukall

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions