0

=== Issue ===

I'm attempting to run Ubuntu 18 in ConEmu/Cmder in Windows 10. However, the setup for Cmder says to use this path: %windir%\system32\bash.exe ~ -cur_console:p which runs Ubuntu 14. I would like to keep the ubuntu 14 installation, but use the Ubuntu 18 installation by default, instead of Ubuntu 14.

=== Symptoms ===

# Two versions installed

Running Ubuntu from the start menu, I can choose to run "Bash on Ubuntu on Windows" which runs version 14, or Ubuntu 18.04 LTS" which is runs version 18

Two versions of Ubuntu on start menu

Both of these options bring me to a different version

enter image description here

"Bash on Ubuntu on Windows"

The "Bash on Ubuntu on Windows" shortcut refers to C:\Windows\System32\bash.exe ~. This runs version 14. When I launch it and run lsb-release -a I get this:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
RUNEDOG-HOME%       

Ubuntu 18.04 LTS

The "Ubuntu 18.04 LTS" Shortcut is some strange Windows "app" and it won't let me see the actual path of the executable. This option runs version 18, here's what I get when I launch it and run lsb_release -a

➜  ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
➜  ~

Note that the prompt is different than the 14 version, ~ vs HOME%

# Default path always runs Ubuntu 14

The default path(s) both give me Ubuntu 14. Assuming those are:

  • %windir%\system32\bash.exe
  • %windir%\system32\wsl.exe

Those two paths give me the following result with lsb_release

C:\Users\byron>%windir%\system32\wsl.exe
RUNEDOG-HOME% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
RUNEDOG-HOME% exit

C:\Users\byron>%windir%\system32\bash.exe
RUNEDOG-HOME% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
RUNEDOG-HOME%

# Other Oddities

wsl Command gives odd results

wsl -l --all only lists Ubuntu 18, but wsl runs Ubuntu 14

C:\Users\byron>wsl -l --all
Windows Subsystem for Linux Distributions:
Legacy (Default)
Ubuntu-18.04

C:\Users\byron>wsl
RUNEDOG-HOME% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
RUNEDOG-HOME%            

App Installation in Windows is Odd

Only Ubuntu 18 lists as being installed in Windows:

enter image description here

3
  • 1
    I can tell you.. However, the setup for Cmder says to use this path: %windir%\system32\bash.exe ~ -cur_console:p. This information either predates the wsl.exe exe or the person who wrote it doesn't know what they are talking about. Bash.exe will run the default instance.. wsl.exe will let you pick which instance to run. Also.. the 14.xx installation that doesn't show up with wsl.exe --list is confusing :P – Señor CMasMas Apr 23 '20 at 16:29
  • 1
    Compare where ubuntu and dir /b /s /a /ad "%ProgramFiles%\WindowsApps\*Ubuntu*" and reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ubuntu.exe" (run all from an elevated command prompt). Try running all ubuntu.exe found (if vary); is any of them version 18 or 14? – JosefZ Apr 23 '20 at 18:42
  • quick note: had to do where ubuntu1804, which gives me: C:\Users\byron\AppData\Local\Microsoft\WindowsApps\ubuntu1804.exe Also, dir /b /s /a /ad "%ProgramFiles%\WindowsApps\*Ubuntu*" says C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc Also, there's nothing like "ubuntu" under that path in the registry. Regardless, both of the paths I was able to get were Ubuntu 18. – byronaltice Apr 23 '20 at 19:53
0

Senor CmasMas and JoseFZ clued me in on the issue. Looks like bash.exe is the old way of starting ubuntu on windows, and so it's loading an old version. Instead, this seems to be the correct way to start it:

%LOCALAPPDATA%\Microsoft\WindowsApps\ubuntu1804.exe

When I put that into Cmder, it works.

I got that command from: https://waynewerner.com/blog/how-to-use-cmder-ubuntu-1804-on-windows.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.