Getting started with Ubuntu on Windows (Windows Subsystem for Linux)

This week I was building in Azure a Linux Server (Ubuntu 14). I’d deployed my new Ubuntu Server and I went to connect to it. But I was on a brand new laptop. No tools with SSH installed. Damn. As I was about to go and get my usual windows favorite SSH tools I remembered a session of Build 2017 and Microsoft starting to talk more loudly about Windows Subsystem for Linux. Yes, Ubuntu on Windows, with SUSE and Fedora coming soon. TechCrunch story here.

Now it is still listed as Beta, but the changes appear to coming pretty fast. I figured it should have more than enough for what I needed, and I could hopefully avoid having to install other 3rd party tools and maybe even finally say goodbye to Cygwin. So I dove in, and here is my quick-start guide to get you started.

Prerequisite

Your computer must be running (at a minimum) a 64-bit version of Windows 10 Anniversary Update. OS Build 14393

Windows Subsystem for Linux - Windows 10 Anniversary Update
Windows Subsystem for Linux – Windows 10 Anniversary Update

Installing Windows Subsystem for Linux

To configure your Windows 10 machine to accept WSL go to Windows => Settings and select Update & Security.

Windows Subsystem for Linux - Windows 10 Developer Mode
Windows Subsystem for Linux – Windows 10 Developer Mode

Select For developers and enable Developer Mode.

Windows Subsystem for Linux - Windows 10 Developer Mode
Windows Subsystem for Linux – Windows 10 Developer Mode

Agree to the warning.

Windows Subsystem for Linux
Windows Subsystem for Linux

Now open Turn Windows Features on or off and select the checkbox for Windows Subsystem for Linux 

Windows Subsystem for Linux
Windows Subsystem for Linux

Restart your workstation

Windows Subsystem for Linux - Restart
Windows Subsystem for Linux – Restart

After the restart from an elevated command prompt type Bash to attempt to start a Bash Shell. As it is the first time, you will be prompted to install Ubuntu.

Windows Subsystem for Linux - Bash
Windows Subsystem for Linux – Bash

Following installation you will be prompted to create a Linux User. This is purely for the Linux environment so does not have anything to do with your Windows Login and Password.

Windows Subsystem for Linux - Create Linux User
Windows Subsystem for Linux – Create Linux User

Using SSH from WSL

Now that I have a bash shell on my Windows laptop, lets use SSH to connect to my new Ubuntu Server.

Windows Subsystem for Linux SSH Connected
Windows Subsystem for Linux SSH Connected

And I’m in. Happy days.