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

Error 0x80070490 after modifying /etc/hosts from Windows #735

Closed
mhujer opened this issue Aug 3, 2016 · 8 comments
Closed

Error 0x80070490 after modifying /etc/hosts from Windows #735

mhujer opened this issue Aug 3, 2016 · 8 comments

Comments

@mhujer
Copy link

mhujer commented Aug 3, 2016

When I edit /etc/hosts from Windows with Notepad++ (the edited file is c:\Users\Martin\AppData\Local\lxss\rootfs\etc\hosts) the bash won't start again (I added one new line).

  • Expected results: The bash starts normally.
  • Actual results
C:\Users\Martin>bash
Error: 0x80070490
  • Windows build number: 14393.10 (Anniversary update)
@benhillis
Copy link
Member

Modifying files inside of %localappdata%\lxss from Windows is not supported. We store the Linux uid, gid, mode, etc in an extended attribute of the file and many editors stomp over this information when they save files.

To recover I would delete %localappdata%\lxss\rootfs\etc\hosts from Windows, relaunch bash.exe, and edit /etc/hosts using vi or nano inside of the bash Window.

@oujesky
Copy link

oujesky commented Sep 6, 2016

I ran to similar issue, when creating a symlinked /etc/hosts file from bash.

sudo rm /etc/hosts
sudo ln -s /mnt/c/Windows/System32/drivers/etc/hosts /etc/hosts
  • When opening a new bash session while the original one where the symlink was created is still open, no problems are encountered.
  • When opening a new bash session after all other were closed, Error: 0x80070490 is thrown.

After that I have to manually delete %localappdata%\lxss\rootfs\etc\hosts to have bash run again.

Windows build 14393.51

@mmmpop
Copy link

mmmpop commented Nov 25, 2016

@oujesky Yeah I did the exact same thing and got the exact same results, which led me to this. It's not a deal-breaker (I mean, it's Ubuntu on Windows, let's be thankful), but sorely disappointing to have to update two hosts files on my workstation multiple times a day.

@kamil7x
Copy link

kamil7x commented Dec 17, 2016

Any updates on this? I got same problem after symlinking, and I think it would be nice to have one hosts file on machine

@CherryDT
Copy link

+1, I also thought I was clever trying to do that, and it works great in existing bash, but starting a new bash doesn't work. Sounds to me like just a simple bug in the bash launching procedure...

@ghost
Copy link

ghost commented Jan 25, 2017

Just run bash as an administrator: WindowsKey+Q, type cmd in search box, right click > Run as administrator > bash

@CherryDT
Copy link

@mdragosGit and then you have a bash with full privileges to f*ck up your computer, I believe that this is not a good thing.

@etherealite
Copy link

@CherryDT, you don't have to run run WSL as administrator. Give your Windows login account write permission on C:\Windows\System32\drivers\etc and you should be good to go.

Maybe someday they will give WSL a UAC prompt and this will no longer be necessary.

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

8 participants