Windows logo with warning sign “beware of penguins”

A quick look into LxRun.exe: Windows 10’s new Linux downloader and installer

Microsoft announced their new Windows Subsystem for Linux (WSL) last week at their //BUILD developer conference. Just a short week later, and they’ve already started shipping the feature to early adopters in the Windows Insider program! I haven’t had much time to play with it yet, but I took a closer look at their fascinating new beachhead installer for Linux.

LxRun.exe is available after you enabled the Windows Subsystem for Linux as an optional feature for Windows 10. As with Hyper-V virtualization and other subsystems for “professional users of Windows”, WSL isn’t available as an an Optional Feature in the Settings app: System: Apps and Features, but only through Control Panel: Programs: Turn Windows features on and off. So much for abolishing the Control Panel.

You can run LxRun.exe in one of two ways:

  • Press Start, search for Bash, and launch it; or
  • Open Command Prompt and run LxRun.exe /install

Both methods will ask you whether you want to install “Ubuntu on Windows, distributed by Canonical”. If you accept the license (as of right now this is the unmodified standard Ubuntu service license) it will install the Ubuntu 14.04 Long-Term Support userland and binaries. The wording here is interesting as Microsoft claims it’s being “distributed by Canonical” — the company behind Ubuntu. However, after accepting the license and starting the download it will say “Downloading from the Windows Store…” Neither of these conflicting statements appear to be true, as two files will actually be downloaded from Microsoft’s Azure server hosting solution. The Windows Store doesn’t seem to be involved at all except for the name-dropping.

The two files being downloaded are:
# trusty-server-cloudimg-amd64-root.tar.gz
# ubuntu.ico

The compressed archive downloads in 188 MiB, doesn’t contain the Linux kernel nor anything too interesting beside the base Ubuntu system, and installs in 527 MiB.

The installer then unpacks the downloaded ubuntu.tar.gz file (something Windows Shell still can’t do natively) into %LOCALAPPDATA%\lxss\rootfs. This folder is a hidden system folder to protect it’s contents. A few aliases for the Linux home directories at /home and /root are created in the non-hidden parent folder at %LOCALAPPDATA%\lxss to facilitate easy file sharing between Linux and Windows. This also means the installation happens in each user’s home folder; creating instance isolation on shared systems.

The second file is a high quality multi-sized ubuntu.ico file used to create an entry for “Bash on Ubuntu on Windows” in the Start menu.

There are also some other commands available from LxRun:

Performs administrative operations on the LX subsystem
    /install - Installs the subsystem
        Optional arguments:
            /y - Do not prompt user to accept
    /uninstall - Uninstalls the subsystem
        Optional arguments:
            /full - Perform a full uninstall
            /y - Do not prompt user to accept
    /update - Updates the subsystem
        Optional arguments:
            /critical - Perform critical update. This option will close all running LX processes when the update completes.

The /update argument is somewhat interesting. It literally invokes Bash and runs the well-known command sequence apt update && apt dist-upgrade -y! I’d never thought I’d live to see the day Microsoft would include a wrapper for good old apt in as a Win32 executable in Windows!

Other things of note is the new “LxssManager” service that describe itself thusly: “The LXSS Manager service supports running native ELF binaries. The service provides the infrastructure necessary for ELF binaries to run on Windows. If the service is stopped or disabled, those binaries will no longer run.”

The Windows Subsystem for Linux doesn’t look like it’s still in an early stage of development for this feature — despite what Microsoft would have us believe. It’s branded as a beta and not an alpha or pre-release. Most basic things seems to be working remarkably well in Bash. This article was written based on Windows Insider build 14316, which was the first build that enabled WSL for early adopters. To my great surprise, Windows Subsystem for Linux isn’t limited to Windows 10 Professional and Enterprise but is at least for now also available for Windows 10 Home.

I’m personally very pleased to see Bash and the Linux userland coming to Windows! I use the GNU/Linux toolset every day and having access to it on Windows will definitely improve my everyday workflow.

20 thoughts on “A quick look into LxRun.exe: Windows 10’s new Linux downloader and installer”

  1. Can I install it directly from the LxRun.exe file without Insider Program?. On build 10586 I say.

    1. No, you cannot. At the moment, this is only available to Windows Insiders in the fast ring. Go ahead and join if you want to play with this. If not, you’ll have to wait a few months at least.

  2. It’s been used for decades, internally! If you want to see how old this “beta” is, don’t go like uname -a, but cat /proc/version!!! New lies from Redmond with love… and of course, nothing works… apt update freezes, etc.

      1. I don’t understand then. I’ve tried lxrun /uninstall /full but when I lxrun /install it downloads the file *immediately*

        Is it cached somewhere else?

        1. Same situation here. Did Lxrun /uninstall and now there´s no way to make it work again -_-
          Any suggestion?

          1. Clean up the %LOCALAPPDATA%\lxss folder manually. Sometimes it is impossible to it from your current Windows OS or even from the Recovery Environment command line.

            The best solution is to run some Linux (e.g. some USB Live Linux) and delete the nasty LXSS folder.

    1. It should be auto-configured. Be sure to report the issue in the Insider Hub. Normal networking troubleshooting for Linux applies. I had to manually configure /etc/resolv.conf on one computer. You could look into that first.

    1. No, I can’t. It’s exclusively distributed by Microsoft as part of Windows 10. Currently, it’s only available to Windows 10 users who have opted in to the Windows Insider Program, and installed the latest Windows Insider preview version of Windows 10. It’s free to join, but you have to accept some loss of system stability in return for testing things out early. I believe this feature will become available to all Windows 10 uses sometime late this summer.

  3. Thank you for this. These are useful detail then I haven’t found in the ‘official’ blog posts/documentation.

    I’m getting errors when I try to compile a standard ‘helloworld.c’ with GCC. Solution might be to upgrade 14.02 to 16.02 but it ‘screen’ doesn’t run (required for commandline upgrade).


  4. Hi!
    How install ubuntu subsystem from tar.gz archive?
    I want to install it on PC without Internet.

  5. I tried to enable this, but it said it couldn’t connect to the Windows Store (which I delete from every 8.x/10 install). However, I can download from the link posted, so I presume MS is forcing you to download from the store to be tracked.

    1. As I say in the article, the download process has nothing to do with the Store – it just says it’s getting it from there. It’s actually just pulling the above URL. I’ll guess you’re experiencing some form of networking issues?

      1. i tried 2 times with the same error but today it seems to work. sadly that we can’t install from the tar.gz file directly, i tried to untar it to the %LOCALAPPDATA%\lxss\rootfs but winrar cannot read it properly and bash.exe doesn’t recognize it

  6. So to reset and reinstall WSL you have to run lxrun.exe /uninstall /full? It seems to work! Thank you

Leave a Reply

Your email address will not be published. Be courteous and on-topic. Comments are moderated prior to publication.