The Wandering Developer
January 5, 2019

Windows 10 and Linux

Posted on January 5, 2019  •  4 minutes  • 646 words

As Microsoft continues to reinvent itself under the leadership of Satya Nadella, one of the more interesting things to happen to Windows in recent years is the addition of the Windows Subsystem for Linux, or WSL for short. It was included in the Windows 10 Anniversary Update as a beta feature but has since grown into a mature part of Windows 10, supporting a variety of Linux distros that are available from the Microsoft Store.

Before we get started with installing a Linux distro from the Microsoft Store we’ll first need to check what build of Windows 10 we’re running. Installing one of the Linux distros from the store requires Windows 10 Fall Creator’s Update (build 16215) or later. The easiest way to find the Windows build number is by going to Settings -> System -> About and scrolling down to the Windows specifications section.

About Windows 10

If the OS build number is 16215 or greater you are good to go, however, there’s one more thing we need to check before we can download and install our Linux distro. The Windows Subsystem for Linux feature needs to be enabled under Windows Features. You can get to the Windows Features from the Control Panel under Control Panel -> Programs -> Turn Windows features on or off or by typing “windows features” into the search bar. Once there you can scroll down and make sure Windows Subsystem for Linux is checked.

Windows 10 Features

Now that we’ve made sure we have a Windows build that supports WSL and that the Windows feature is enabled lets open up the Windows Store app and search for the Linux distro we’re going to install.

Windows 10 Store Linux

I’m personally more comfortable working with Ubuntu Linux since that’s the distro that was installed when WSL was a beta feature. We’ll go ahead and use the non-specific “Unbuntu”, which should install the latest stable Ubuntu LTS. If the distro needs to be installed then press “Install” and wait for the download to complete. The download is usually fairly quick but this depends on your internet connection.

Windows 10 Store Ubuntu

Once downloaded the “Install” button will change to “Launch” and will open a console window to start the initialization process. The ellipsis […] next to the “Launch” button gives you the options to pin a shortcut to the taskbar or the start menu. The initialization of the distro usually takes a few minutes (as suggested by the initial message in the console window). Once complete you will be asked to set up your user account by providing a username and password.

Windows 10 Ubuntu Start

After your user account is set up the initialization process is done. Now it’s time to upgrade any software packages that come preinstalled. To do this we’ll need to run a couple of commands.

$ sudo apt update
$ sudo apt upgrade -y

There’s a lot of examples out there that show using apt-get instead of apt but I prefer to use apt since it seems to be a more streamlined version of apt-get that has some nice features like a progress bar during installs and upgrades. The first command will update all the package lists and the second command upgrades all the packages that are listed as “upgradable”. The “-y” is a flag that will bypass the “Do you want to continue?” message during the upgrade process by automatically accepting that you want to continue. If you leave that off you can see what packages will be upgraded and you’re given the opportunity to abort the upgrade.

Windows 10 Ubunutu Update

One thing I like to do after all the preinstalled programs have been upgraded is install a program called screenfetch that will display the system information in a colorful ASCII block.

$ sudo apt install screenfetch -y

Windows 10 Ubuntu Screenfetch

At this point you are pretty much ready to rock and roll with your new WSL distro and enjoy the beauty of using Linux on your Windows 10 machine!

Follow me

Software Architect | DevOps | Identity & Security | Infrastructure as Code | Azure Cloud Solutions