Score:6

Where does the double-clickable app live on Windows?

gb flag

I'm running WSL2 with Ubuntu. I want to be able to open Ubuntu via a voice command.

To do this I run Alexa Connect on my PC to write tasks that automate some PC functionality. All I need to do is link the file path in the AC app, but no matter how hard I try, I can't find Ubuntu.exe or anything else that starts up Ubuntu. My only option is to click on it in the Start menu.

To my frustration, right clicking Ubuntu in the Start menu brings up a handful of options, and none of them are Open file location. But if I can click on it in the Start menu, there must be an accessible executable somewhere in my files that I can give to Alexa Connect.

Google has shown me where to look, and the folder directories are all where Google tells me they should be, but there are no files on display for me within those folders, and of course I have Show hidden files checked.

Charles Green avatar
cn flag
I don't run wsl, as I use ubuntu native and Win10 virtual, but everything I've looked at suggests the command to start wsl, is `wsl` Is that not correct?
data avatar
cn flag
a batch file would also work, with a call to wsl.exe with parameters if you need to. .bat files are "double-clickable" in windows
NotTheDr01ds avatar
vn flag
For those that voted to close this (if you ever come back to it), please note that WSL with Ubuntu is completely on-topic here on Ask Ubuntu. While the question might have been *better* suited for Super User, as it deals more with Windows functionality than Ubuntu, we don't (and really can't) expect posters here to have that knowledge in advance. For that reason, we tend to be generous in allowing WSL questions as long as they are *related* to Ubuntu, and this one certainly was.
Score:13
vn flag

Short answer

wsl.exe or wsl should work. It can be found in C:\Windows\System32.

More detail

But if I can click on it in the start menu, there must be an accessible executable

Well ... There is for Ubuntu, but there doesn't have to be. Apps installed from the Microsoft Store are not traditional Windows "executables". They are Appx packages with a manifest and resources, and they aren't launched with a traditional "command line." For some "extra reading" on the topic, check out my two answers (yes, two) on this Super User question. But do that later -- Finish reading here for a "quick-and-dirty" answer.

Ubuntu does provide a "fake .exe" that is known as an "App Execution Alias" to launch the Store/UWP/Appx app/package. For some other WSL distributions, that's not an option. If you ever come across this, the answer is in that other Super User question I linked to.

But if you aren't finding ubuntu.exe, then it's likely that you installed a "versioned" Ubuntu from the Store. There are (currently) three "releases" in the Microsoft Store:

  • "Ubuntu": The "Ubuntu" without a version number is always the latest LTS release available. Before 20.04 came out, if you were to install "Ubuntu" (without a version), you would have installed 18.04. Now, this installed 20.04. The app execution alias for this is simply ubuntu.exe. Since that's not working for you, my guess is you installed one of the other two.

    When 22.04 comes out (presumably) it will be updated to 22.04. But note that your WSL instance won't be automatically updated; just the Store package. It's a bit confusing, and I attempt to explain it better in this answer.

  • "Ubuntu 20.04": Always installs 20.04 and will always install 20.04, even after the "latest" has changed. So currently, "Ubuntu 20.04" and "Ubuntu" install the same thing on your system. The app execution alias, however, is different -- ubuntu2004.exe.

  • "Ubuntu 18.04": Which was the latest at one point, but since it is still a supported release, it is still installable from the Store. It's app execution alias is ubuntu1804.exe.

  • "Ubuntu 16.04": Has been removed from the Store, but some systems may still have it around.

You can see the App Execution Aliases on your system by going to "Manage app execution aliases" in the Start Menu or Settings. You can turn off the alias, so if you find that your Ubuntu (whatever version) is turned off, simply re-enable it.

But don't use the App Execution Alias under most circumstances

All that being said, launching WSL via ubuntu.exe or any of the app execution aliases is the "old way". The wsl.exe command is the "replacement" for day-to-day use. You should just be able to run wsl and have Ubuntu launch, assuming it is your only installed WSL instance.

If you had more than one instance installed, you could use wsl -d <distro>. Or wsl -u root to launch as root in your instance. wsl --help will give you the full list of flags and options.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.