WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Running ubuntu1804.exe outputs error: "Cannot find the specified path"

Open Suhail opened this issue 7 years ago • 20 comments

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.17763.379] 2019 Server

  • 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.)
PS C:\Users\Administrator\Ubuntu> .\ubuntu1804.exe
The system cannot find the path specified.

PS C:\Users\Administrator\Ubuntu> bash
The system cannot find the path specified.
  • What's wrong / what should be happening instead:

I would've expected to be in a bash prompt to run Linux commands

  • Other information

My directory:

PS C:\Users\Administrator\Ubuntu> ls


    Directory: C:\Users\Administrator\Ubuntu


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        4/14/2019  11:03 AM                AppxMetadata
d-----        4/14/2019  11:03 AM                Assets
------        8/17/2018   3:15 AM         212438 AppxBlockMap.xml
------        8/17/2018   3:15 AM           3835 AppxManifest.xml
------        8/17/2018   3:17 AM          11112 AppxSignature.p7x
------        8/17/2018   3:15 AM      223983209 install.tar.gz
------        8/17/2018   3:15 AM           5400 resources.pri
------        8/17/2018   3:15 AM         211968 ubuntu1804.exe
------        8/17/2018   3:15 AM            744 [Content_Types].xml

I've added the dir C:\Users\Administrator\Ubuntu to my PATH

PS C:\Users\Administrator\Ubuntu> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux


Path          :
Online        : True
RestartNeeded : False

I followed this guide: https://docs.microsoft.com/en-us/windows/wsl/install-on-server

Suhail avatar Apr 15 '19 18:04 Suhail

Could you please collect log files?

benhillis avatar Apr 15 '19 23:04 benhillis

Do you know how I can get/run strace?

PS C:\Windows\system32\WindowsPowerShell\v1.0> strace
strace : The term 'strace' is not recognized as the name of a cmdlet, function, script file, or operable program.

Suhail avatar Apr 16 '19 02:04 Suhail

@Suhail can you run wslconfig /l in powershell and show the output here?

zetrustin avatar Apr 23 '19 12:04 zetrustin

PS C:\Windows\system32\WindowsPowerShell\v1.0> wslconfig /l Windows Subsystem for Linux Distributions: Ubuntu-18.04 (Default)

Suhail avatar Apr 23 '19 15:04 Suhail

If you want, you should be able to uninstall via wslconfig /unregister Ubuntu-18.04 and then reinstall.

bitinerant avatar Jun 29 '19 11:06 bitinerant

If you want, you should be able to uninstall via wslconfig /unregister Ubuntu-18.04 and then reinstall.

After all the work to configure it???? Come on

tengusantoso avatar Sep 06 '19 16:09 tengusantoso

Exact same problem on Windows 10: Microsoft Windows [Version 10.0.18362.356]

Hadn't used it for a while, so I can't pinpoint the update that broke it, but I get the same response for wslconfig /l and the same result for wsl.

strace is a Linux command, so it can't be run from either PowerShell or CMD.

Catch-22 on logs: I can't run the logging commands unless I'm administrator, but when I'm in the administrator enable shell, wslconfig /l tells me there is no registered kernel. From a normal kernel, it tells me that I have Ubuntu 18.04 installed, but I'm not allowed to run the logging commands.

I also think that it is pretty absurd that, after installing Anaconda python, creating custom scripts, compiling and installing in-house code that I need for work, setting up cron jobs, installing ssh keys, etc., the only solution is to wipe the slate clean and start from scratch.

craigim avatar Sep 23 '19 19:09 craigim

Windows Update applied KB4534132 to my Windows 10 (1903) laptop this morning and then prompted me to reboot. After rebooting, my Ubuntu 18.04 distro is no longer available under WSL. (Ubuntu 18.04 does still show up under Add/Remove programs but there are no files available under C:\Users<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs or C:\Users\0017919\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState.)

Launching WSL gave me the following error:

There is no distribution with the supplied name.

Running "wsl /?" displayed the following error:

Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

I went ahead and uninstalled Ubuntu 18.04 and WSL rebooted and reinstalled both. Now when I try to execute wsl or bash, I get the following error:

The system cannot find the path specified.

When I execute wslconfig /l, it shows the following:

Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)

Unfortunately, I've run out of ideas on how to fix this. This is extremely disappointing as I had everything set up to do development within WSL but Windows Update wiped everything out and seems to have made it impossible to get it working again. This is completely unacceptable and my only option is to switch back to Linux.

I gave Microsoft a chance and they blew it. Microsoft says that they love Linux and that they love developers but they prove otherwise with very poorly designed systems like WSL. Why should developers trust Microsoft when their development tools are so brittle and broken?

microngust avatar Feb 03 '20 21:02 microngust

I installed ubuntu18.04 and removed it carelessly. And I struggled to reinstall ubuntu18.04, after all, I failed. But I can install ubuntu16.04 again.

yaochx avatar Mar 12 '20 12:03 yaochx

Hyper-V is a stable, usable option, but very slow response

yaochx avatar Mar 12 '20 12:03 yaochx

If you want, you should be able to uninstall via wslconfig /unregister Ubuntu-18.04 and then reinstall.

This worked for me on a Server 2019 which was throwing the same error "The system cannot find the path specified". Unregistered the Ubuntu from wslconfig command

PS C:\Distros\Ubuntu1804> wslconfig /unregister Ubuntu-18.04 Unregistering... The system cannot find the path specified.

PS C:\Distros\Ubuntu1804> wslconfig /l Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https://aka.ms/wslstore

And then from File explorer double clicked the ubuntu1804.exe file

Installing, this may take a few minutes... Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username: *********** Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Installation successful! To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.

user@server:~$

steadyF0x avatar Jun 09 '20 20:06 steadyF0x

The solution here basically claimed WSL is unusable since it would suddenly disappear and the only thing you could do is starting over (and configuring everything probably cost you months)

littleq0903 avatar Jun 13 '20 19:06 littleq0903

No answer from Apr 2019 for a show stopper issue? The same issue appears in CentOS8 wsl distro. I suppose one solution will be suitable for all distros. Meanwhile, 16 Months * the number of broken distros * the number of users has been lost.

PavelSosin-320 avatar Aug 22 '20 07:08 PavelSosin-320

wslconfig /unregister Ubuntu-18.04

This helped me..

Wondering why such weird error msg if wsl can't find default distribution?

PS C:\Users\user> wsl
The system cannot find the path specified.
PS C:\Users\user> wsl.exe
The system cannot find the path specified.
PS C:\Users\user> wslconfig /l
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)
PS C:\Users\user> wslconfig /unregister Ubuntu-20.04
Unregistering...
The system cannot find the path specified.
PS C:\Users\user> wslconfig /l
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
PS C:\Users\user> wsl.exe
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
PS C:\Users\user>

rgrm avatar Sep 10 '20 07:09 rgrm

Windows Update applied KB4534132 to my Windows 10 (1903) laptop this morning and then prompted me to reboot. After rebooting, my Ubuntu 18.04 distro is no longer available under WSL. (Ubuntu 18.04 does still show up under Add/Remove programs but there are no files available under C:\Users\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs or C:\Users\0017919\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState.)

Launching WSL gave me the following error:

There is no distribution with the supplied name.

Running "wsl /?" displayed the following error:

Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

I went ahead and uninstalled Ubuntu 18.04 and WSL rebooted and reinstalled both. Now when I try to execute wsl or bash, I get the following error:

The system cannot find the path specified.

When I execute wslconfig /l, it shows the following:

Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)

Unfortunately, I've run out of ideas on how to fix this. This is extremely disappointing as I had everything set up to do development within WSL but Windows Update wiped everything out and seems to have made it impossible to get it working again. This is completely unacceptable and my only option is to switch back to Linux.

I gave Microsoft a chance and they blew it. Microsoft says that they love Linux and that they love developers but they prove otherwise with very poorly designed systems like WSL. Why should developers trust Microsoft when their development tools are so brittle and broken?

sandeepsharma-devops avatar Oct 16 '20 11:10 sandeepsharma-devops

Windows Update applied KB4534132 to my Windows 10 (1903) laptop this morning and then prompted me to reboot. After rebooting, my Ubuntu 18.04 distro is no longer available under WSL. (Ubuntu 18.04 does still show up under Add/Remove programs but there are no files available under C:\Users\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs or C:\Users\0017919\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState.) Launching WSL gave me the following error:

There is no distribution with the supplied name.

Running "wsl /?" displayed the following error:

Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

I went ahead and uninstalled Ubuntu 18.04 and WSL rebooted and reinstalled both. Now when I try to execute wsl or bash, I get the following error:

The system cannot find the path specified.

When I execute wslconfig /l, it shows the following:

Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)

Unfortunately, I've run out of ideas on how to fix this. This is extremely disappointing as I had everything set up to do development within WSL but Windows Update wiped everything out and seems to have made it impossible to get it working again. This is completely unacceptable and my only option is to switch back to Linux. I gave Microsoft a chance and they blew it. Microsoft says that they love Linux and that they love developers but they prove otherwise with very poorly designed systems like WSL. Why should developers trust Microsoft when their development tools are so brittle and broken?

I am facing same issue, could you please help if resolved at your machine

sandeepsharma-devops avatar Oct 16 '20 11:10 sandeepsharma-devops

This is a repeating issue: Please, check issues to find many like this. The problem is that some distros, even paid, from Microsoft store don't put the rootfs virtual disk image, vhdx file, to the correct place during installation. The CentOS8 was my case. Obviously, you can't correct it if you don't know where is it. I think that it is up to the WSL team to provide instructions and script which help to recover from such a situation and put the distro vhdx to the Default/Desired place, for example to my huge and ultra-fast secondary ssd disk.

PavelSosin-320 avatar Oct 18 '20 05:10 PavelSosin-320

I'm also trying to fix this issue. Actually, I had to resort to manually installing WSL because trying to install any app on the Microsoft Store simply doesn't work. Anybody else?

betweenvenus avatar Nov 05 '20 00:11 betweenvenus

@crramirez has a good workaround until the solution is available: make sure your distros install on the system drive to ensure that they are not encrypted. Closing this issue and marking as workaround-available and fixinbound. Duplicate of #4272

bpulliam avatar May 07 '21 12:05 bpulliam

previously I had this issue of Ubuntu which showed "The system cannot find the path specified. Press any key to continue... " after starting , so I tried somethings after going through this discussion , after some time I tried the command "wslconfig /unregister Ubuntu" given above (thank you) then I again installed the Ubuntu distro(tried randomly) for wsl using the command "wsl --install -d Ubuntu" in powershell and then ubuntu got installed and then I started it from windows start button and boom it started working again , I think it must work like that . good luck

LegioN2004 avatar Jul 10 '22 10:07 LegioN2004