Skip to main content This browser is no longer supported. Show
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Troubleshooting Windows Subsystem for Linux
In this articleWe have covered some common troubleshooting scenarios associated with WSL below, but please consider searching the issues filed in the WSL product repo on GitHub as well. File an issue, bug report, feature requestThe WSL product repo issues enables you to:
You can also:
Installation issues
Note In my case, the LocalState folder for my Ubuntu 18.04 distribution was located at C:\Users<my-user-name>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc Check WSL Docs GitHub thread #4103 where this issue is being tracked for updated information.
Common issuesI'm on Windows 10 version 1903 and I still do not see options for WSL 2This is likely because your machine has not yet taken the backport for WSL 2. The simplest way to resolve this is by going to Windows Settings and clicking 'Check for Updates' to install the latest updates on your system. See the full instructions on taking the backport. If you hit 'Check for Updates' and still do not receive the update you can install KB KB4566116 manually. Error: 0x1bc when wsl --set-default-version 2This may happen when 'Display Language' or 'System Locale' setting is not English. wsl --set-default-version 2 Error: 0x1bc For information on key differences with WSL 2 please visit https://aka.ms/wsl2The actual error for 0x1bc is: WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernelFor more information, please refer to issue 5749 Cannot access WSL files from WindowsA 9p protocol file server provides the service on the Linux side to allow Windows to access the Linux file system. If you cannot access WSL using \\wsl$ on Windows, it could be because 9P did not start correctly. To check this, you can check the start up logs using: dmesg |grep 9p, and this will show you any errors. A successful output looks like the following: [ 0.363323] 9p: Installing v9fs 9p2000 file system support [ 0.363336] FS-Cache: Netfs '9p' registered for caching [ 0.398989] 9pnet: Installing 9P2000 supportPlease see this Github thread for further discussion on this issue. Can't start WSL 2 distribution and only see 'WSL 2' in outputIf your display language is not English, then it is possible you are seeing a truncated version of an error text. C:\Users\me>wsl WSL 2To resolve this issue, please visit https://aka.ms/wsl2kernel and install the kernel manually by following the directions on that doc page. command not found when executing windows .exe in linuxUsers can run Windows executables like notepad.exe directly from Linux. Sometimes, you may hit "command not found" like below: $ notepad.exe -bash: notepad.exe: command not foundIf there are no win32 paths in your $PATH, interop isn't going to find the .exe. You can verify it by running echo $PATH in Linux. It's expected that you will see a win32 path (for example, /mnt/c/Windows) in the output. If you can't see any Windows paths then most likely your PATH is being overwritten by your Linux shell. Here is a an example that /etc/profile on Debian contributed to the problem: if [ "`id -u`" -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" fiThe correct way on Debian is to remove above lines. You may also append $PATH during the assignment like below, but this lead to some other problems with WSL and VSCode.. if [ "`id -u`" -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" else PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:$PATH" fiFor more information, see issue 5296 and issue 5779. "Error: 0x80370102 The virtual machine could not be started because a required feature is not installed."Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
Learn more about how to Configure Nested Virtualization when running Hyper-V in a Virtual Machine. Bash loses network connectivity once connected to a VPNIf after connecting to a VPN on Windows, bash loses network connectivity, try this workaround from within bash. This workaround will allow you to manually override the DNS resolution through /etc/resolv.conf.
Once you have disconnected the VPN, you will have to revert the changes to /etc/resolv.conf. To do this, do:
Starting WSL or installing a distribution returns an error codeFollow these instructions to collect detailed logs and file an issue on our GitHub. Updating WSLThere are two components of Windows Subsystem for Linux that can require updating.
Apt-get upgrade errorsSome packages use features that we haven't implemented yet. udev, for example, isn't supported yet and causes several apt-get upgrade errors. To fix issues related to udev, follow the following steps:
"Error: 0x80040306" on installationThis has to do with the fact that we do not support legacy console. To turn off legacy console:
"Error: 0x80040154" after Windows updateThe Windows Subsystem for Linux feature may be disabled during a Windows update. If this happens the Windows feature must be re-enabled. Instructions for enabling the Windows Subsystem for Linux can be found in the Manual Installation Guide. Changing the display languageWSL install will try to automatically change the Ubuntu locale to match the locale of your Windows install. If you do not want this behavior you can run this command to change the Ubuntu locale after install completes. You will have to relaunch bash.exe for this change to take effect. The below example changes to locale to en-US: sudo update-locale LANG=en_US.UTF8Installation issues after Windows system restore
No internet access in WSLSome users have reported issues with specific firewall applications blocking internet access in WSL. The firewalls reported are:
In some cases turning off the firewall allows for access. In some cases simply having the firewall installed looks to block access. If you are using Microsoft Defender Firewall, unchecking "Blocks all incoming connections, including those in the list of allowed apps." allows for access. Permission Denied error when using pingFor Windows Anniversary Update, version 1607, administrator privileges in Windows are required to run ping in WSL. To run ping, run Bash on Ubuntu on Windows as an administrator, or run bash.exe from a CMD/PowerShell prompt with administrator privileges. For later versions of Windows, Build 14926+, administrator privileges are no longer required. Bash is hungIf while working with bash, you find that bash is hung (or deadlocked) and not responding to inputs, help us diagnose the issue by collecting and reporting a memory dump. Note that these steps will crash your system. Do not do this if you are not comfortable with that or save your work prior to doing this. To collect a memory dump
Check your build numberTo find your PC's architecture and Windows build number, open Look for the OS Build and System Type fields. To find your Windows Server build number, run the following in PowerShell: systeminfo | Select-String "^OS Name","^OS Version"Confirm WSL is enabledYou can confirm that the Windows Subsystem for Linux is enabled by running the following in an elevated PowerShell window: Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-LinuxOpenSSH-Server connection issuesTrying to connect your SSH server is failed with the following error: "Connection closed by 127.0.0.1 port 22".
If you do see such messages and the keys are missing under /etc/ssh/, you will have to regenerate the keys or just purge&install openssh-server: sudo apt-get purge openssh-server sudo apt-get install openssh-server"The referenced assembly could not be found." when enabling the WSL optional featureThis error is related to being in a bad install state. Please complete the following steps to try and fix this issue:
Correct (SSH related) permission errorsIf you're seeing this error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0777 for '/home/artur/.ssh/private-key.pem' are too open.To fix this, append the following to the the /etc/wsl.conf file: [automount] enabled = true options = metadata,uid=1000,gid=1000,umask=0022Please note that adding this command will include metadata and modify the file permissions on the Windows files seen from WSL. Please see the File System Permissions for more information. Running Windows commands fails inside a distributionSome distributions available in Microsoft Store are yet not fully compatible to run Windows commands out of the box. If you get an error -bash: powershell.exe: command not found running powershell.exe /c start . or any other Windows command, you can resolve it following these steps:
Unable to boot after installing WSL 2We are aware of an issue affecting users where they are unable to boot after installing WSL 2. While we fully diagnose those issue, users have reported that changing the buffer size or installing the right drivers can help address this. Please view this Github issue to see the latest updates on this issue. WSL 2 errors when ICS is disabledInternet Connection Sharing (ICS) is a required component of WSL 2. The ICS service is used by the Host Network Service (HNS) to create the underlying virtual network which WSL 2 relies on for NAT, DNS, DHCP, and host connection sharing. Disabling the ICS service (SharedAccess) or disabling ICS through group policy will prevent the WSL HNS network from being created. This will result in failures when creating a new WSL version 2 image, and the following error when trying to convert a version 1 image to version 2. There are no more endpoints available from the endpoint mapper.Systems that require WSL 2 should leave the ICS service (SharedAccess) in it's default start state, Manual (Trigger Start), and any policy that disables ICS should be overwritten or removed. While disabling the ICS service will break WSL 2, and we do not recommend disabling ICS, portions of ICS can be disabled using these instructionsng-application-guard-) Using older versions of Windows and WSLThere are several differences to note if you're running an older version of Windows and WSL, like the Windows 10 Creators Update (Oct 2017, Build 16299) or Anniversary Update (Aug 2016, Build 14393). We recommend that you update to the latest Windows version, but if that's not possible, we have outlined some of the differences below. Interoperability command differences:
Uninstall legacy version of WSLIf you originally installed WSL on a version of Windows 10 prior to Creators update (Oct 2017, Build 16299), we recommend that you migrate any necessary files, data, etc. from the older Linux distribution you installed, to a newer distribution installed via the Microsoft Store. To remove the legacy distribution from your machine, run the following from a Command Line or PowerShell instance: wsl --unregister Legacy. You also have the option to manually remove the older legacy distribution by deleting the %localappdata%\lxss\ folder (and all it's sub-contents) using Windows File Explorer or with PowerShell: rm -Recurse $env:localappdata/lxss/. FeedbackSubmit and view feedback for |