Last year, Microsoft and Canonical partnered up to create Windows Subsystem for Linux (WSL). With it, you could run Ubuntu and Bash on native Windows 10. Starting with the August 2016 release of Windows 10 Anniversary Update, anyone could use Ubuntu and Bash on Windows 10. Now, Hannes Kühnemund, SUSE Linux Enterprise senior product manager, has found that you can run openSUSE Leap 42.2 on Windows 10.
This is not native Linux. WSL emulates a Linux kernel interface on top of the Windows NT kernel. For system programmers, that's not good enough, but for developers, it enables you to combine the best of Windows and Linux.
Before starting on this, you should know, as Microsoft Senior Program Manager Rich Turner recently explained, that WSL is still a work in progress: "We're not done yet. We have a long way to go yet until we can fully say that this thing is really comprehensibly compatible with the majority of [developer] tools that you want to use."
In addition, Turner said WSL is for shell-users and programmers. Microsoft doesn't object to you trying to run X Window graphic programs, but don't expect much help from them either.
One final word of warning: If you do this, you're replacing Ubuntu on WSL with SUSE. It's a one-way trip.
Now, on with the show.
First, boot up Windows 10, then turn on Developer Mode (via Settings > Update & security > For developers), and search for "Windows Features." Next, choose "Turn Windows features on or off" and enable Windows Subsystem for Linux (Beta).
After that, to install Bash, you must open the Windows Command Prompt and type "bash." You'll be asked to accept the terms of service and download Ubuntu. This download is a bit less than 1GB. Once installed, you'll be running a userspace version of Ubuntu 14.04 on top of WSL. With 2017's Windows 10 Creator Update, you'll be moving up to the newer Ubuntu 16.04.
You'll then need to create a non-root user. The first time you run Ubuntu, you'll be prompted to create this user and give it a password. This user ID and password has nothing to do with your Windows username and password.
You're now ready to run Ubuntu and Bash on WSL. Before moving on, you should update Ubuntu to the latest versions. To do that, run the following commands from the Bash shell:
- apt-get update
- apt-get upgrade
Run a few commands and make sure all's well with your newly refreshed Ubuntu system. Now it's time to give SUSE a try.
Start by downloading the openSUSE Docker userspace. You do this with the following command:
- wget -O openSUSE-42.2.tar.xz https://github.com/openSUSE/docker-containers-build/blob/openSUSE-42.2/docker/openSUSE-42.2.tar.xz?raw=true
Now, create a new root file system and extract the openSUSE userspace with the following commands and then exit the shell.
- $ sudo mkdir rootfs
- $ sudo tar -C rootfs -Jxf openSUSE-42.2.tar.xz
- $ exit
Next, open a Windows Command Prompt (cmd) to back up the Ubuntu rootfs and open the SUSE rootfs.
- cd %localappdata%\lxss\
- rename rootfs rootfs.ubuntu
- move .\home\<linux_user>\rootfs .\
This SUSE Linux will not have the Ubuntu user, so you need to create a new one. For now, Kühnemund recommends just using root for the user. To do this, run the following command from cmd:
- lxrun /setdefaultuser root
When you next run Bash, you'll now be running openSUSE Leap 42.2 environment on top of WSL.
Kühnemund also claims you can run SUSE Linux Enterprise Server (SLES) 12 SP2 on WSL.
If this sounds to you like it may be possible to run other Linux distributions on WSL, you're right. You can.
There is a GitHub project, WSL-Distribution-Switcher, which seeks to enable you to switch Ubuntu on WSL with any other Linux distribution published on Docker Hub. These distributions include CentOS, Fedora, and Debian.
While Ubuntu will remain Microsoft's first choice for WSL, you should soon be able to run almost any Linux on top of WSL.