WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Hosts file is not inherit on bash

Open yupal opened this issue 10 years ago • 9 comments

Maybe this is more a feature than a bug, but the hosts file in Windows should be linked to one in linux

yupal avatar Apr 12 '16 06:04 yupal

ln -sf /mnt/c/WINDOWS/System32/Drivers/etc/hosts /etc/hosts?

nuclearmistake avatar Apr 12 '16 16:04 nuclearmistake

Interesting idea. At this point we have deliberately not tried to keep WSL in sync with Windows files simply due to the confusion on if one or the other changes. This is something we should revisit in the future.

I would suggest putting this in User Voice.

russalex avatar Apr 12 '16 23:04 russalex

Closing for now. Please add to https://aka.ms/winbashuv if you would like us to revisit.

bitcrazed avatar Sep 28 '16 23:09 bitcrazed

I'd like to keep this one open. I plan on looking at this soon.

benhillis avatar Sep 29 '16 01:09 benhillis

Hello, how's it going? I know that I can link hosts file by myself, but I think, it should be added by default

kamil7x avatar Dec 05 '16 14:12 kamil7x

Any news on this? I can link the file and open it but it is read only. "/etc/hosts" [readonly][dos] 139L, 4077C. Is there another work around?

ctcampb3 avatar Aug 29 '17 13:08 ctcampb3

/etc/hosts now inherits from the Windows hosts file since Insider build 16184. But, this change is currently only available on Windows Insider build, but, will also be available on Fall Creators Update.

sunilmut avatar Aug 29 '17 17:08 sunilmut

I just tested the feature in the Insider build and works well. Thanks very much for this feature!

iencodev avatar Oct 29 '17 22:10 iencodev

Found this: https://github.com/shayne/go-wsl2-host

strarsis avatar Aug 28 '21 15:08 strarsis