You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your Windows build number: (Type ver at a Windows Command Prompt)
Microsoft Windows [Version 10.0.17763.253]
What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
After installing Ubuntu 16.04 and 18.04 (at various times) via the Microsoft store, it works for a while. After a number of reboots, WSL completely stops functioning. Launching "bash.exe" displays "Element not found." with no additional information.
What's wrong / what should be happening instead:
WSL should actual launch
For WSL launch issues, please [collect detailed logs]
I've had this happen now with both Ubuntu 16.04 and 18.04. I've uninstalled and reinstalled the distros, as well as disabled and reenabled the Windows Subsystem for Linux in Apps / Features. I'm really at a loss at what to do here.
Thanks for filing. It looks like creating /etc/hosts failed with ENOENT. This probably means that the /etc directory was deleted. This probably shouldn't be a fatal error, I will change that.
So what might be happening here is that since I use vagrant with Hyper-V, I had deleted the /etc/hosts file and created a symlink to /mnt/c/Windows/system32/drivers/etc/hosts. I'm guessing at some point that link got mangled, causing this error?
If that's the case, I'd agree, missing a hosts file shouldn't be fatal.
Also, is there a way, other than closing all WSL windows and reopening a new one to get the /etc/hosts file to update, aside from what I did? Since Hyper-V / Vagrant doesn't let you specify a static IP for your VMs, I use the Vagrant Hostmanager plugin which updates the hosts file as you boot VMs. As such, is there a way to get the WSL environment to reread the hosts file?
Justin Cherniak (@jcherniak) - easiest way is to restart the lxssmanager service, or use wslconfig to terminate the distro (might not be available in your version).
I've been unable to launch wsl2 recently - "element not found" every time. I've tried restarting lxssmanager and rebooting. I don't have KB4571756 in my list of updates, but I believe this started after some recent patch, possibly KB5007253 or KB5007289 which were both installed last week. Tried to install KB4577063 but the OS told me it was not installable. I'm unable to access the filesystem at \wsl$\ubuntu . Any workarounds for getting wsl2 to launch again?
Also posted to #5880 as it seems to describe the same problem.
Activity
benhillis commentedon Feb 1, 2019
Thanks for filing. It looks like creating /etc/hosts failed with ENOENT. This probably means that the /etc directory was deleted. This probably shouldn't be a fatal error, I will change that.
jcherniak commentedon Feb 1, 2019
So what might be happening here is that since I use vagrant with Hyper-V, I had deleted the /etc/hosts file and created a symlink to /mnt/c/Windows/system32/drivers/etc/hosts. I'm guessing at some point that link got mangled, causing this error?
If that's the case, I'd agree, missing a hosts file shouldn't be fatal.
Also, is there a way, other than closing all WSL windows and reopening a new one to get the /etc/hosts file to update, aside from what I did? Since Hyper-V / Vagrant doesn't let you specify a static IP for your VMs, I use the Vagrant Hostmanager plugin which updates the hosts file as you boot VMs. As such, is there a way to get the WSL environment to reread the hosts file?
benhillis commentedon Feb 20, 2019
Fixed in 18342.
benhillis commentedon Feb 20, 2019
Justin Cherniak (@jcherniak) - easiest way is to restart the lxssmanager service, or use wslconfig to terminate the distro (might not be available in your version).
lucndm commentedon Jun 11, 2019
you have recreate file hosts at : %localappdata%\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc
ajkessel commentedon Dec 15, 2021
I've been unable to launch wsl2 recently - "element not found" every time. I've tried restarting lxssmanager and rebooting. I don't have KB4571756 in my list of updates, but I believe this started after some recent patch, possibly KB5007253 or KB5007289 which were both installed last week. Tried to install KB4577063 but the OS told me it was not installable. I'm unable to access the filesystem at \wsl$\ubuntu . Any workarounds for getting wsl2 to launch again?
Also posted to #5880 as it seems to describe the same problem.
ajkessel commentedon Dec 15, 2021
Update: the resolution described here fixed this problem for me. Specifically, downloading and running the https://aka.ms/easyfix20159 easy fix, followed by a reboot. Hopefully this will help others.