bash on windows
It’s real; it’s here.

The Windows 10 Anniversary Update has landed, and is rolling out to support devices now.

—what? Oh, no; you’re not on the wrong site.

I’m covering a Windows 10 update because it includes a VERY cool new feature: Bash on Windows — an Ubuntu-based tool to run Linux apps on Windows, natively.

Say what?!

Microsoft calls it the “Windows Subsystem for Linux” or WSL (we prefer to incorrectly call it the “Linux Subsystem for Windows 10” since those words in that order make more sense – at least to us).

Anyway, chances are you know that. The mainstream tech press has been agog with coverage on WSL (aka Bash on Windows) since its announcement at Microsoft BUILD.

You’re here to learn about how to enable Ubuntu Bash on Windows 10 anniversary update, and, being a helpful chap, I’m here to show you how.

But, before we dive in to the how-to part I want to make sure your expectations on what Bash on Windows is and isn’t are in tune with reality:

  • It’s not a virtual machine
  • It’s not a container
  • It’s not a chroot
  • It’s not a full Linux distribution

So what is it? It’s a way to run (mostly terminal-based) Linux applications and Bash commands natively on Windows, and give them access to the Windows file system (so you don’t have top copy files to/from Windows and the Bash environment).

Microsoft teamed up with Canonical to include a full Ubuntu-based Bash shell in Windows 10 Anniversary Update. It runs atop a Linux-compatible kernel interface which, to confuse you further, does not use Linux code.

Instead, it translate Linux system calls to Windows NT ones (think Wine, but the opposite what around).

Microsoft say its Windows Subsystem for Linux approach uses “fewer resources than a full virtualized machine”, and add it “allows you to run Linux command-line tools and apps alongside your Windows command-line, desktop and store apps, and to access your Windows files from within Linux.”

Got it?

Good. On we go!

Enabling Ubuntu on Bash/WSL on Windows 10

You will need the following:

  • A 64-bit PC running a 64-bit version of Windows 10 (sorry 32-bit users)
  • The ‘Windows 10 Anniversary Update’ installed (see here for details)
  • A freshly brewed cup coffee (optional)

Enable Bash on Windows 10 Bash in 5 Easy Steps

1. Enable Developer Mode

step-1-bash-on-windows
Enabling developer mode in Windows 10 Anniversary Update

If you want to play with features aimed at developers you gotta enable developer mode first. To do this on Windows go to Settings > Update & Security > For Developers > Developer Mode.

You may be asked to reboot here.

2. Enable Windows Subsystem for Linux

windows bash step 2
Turning on Windows Subsystem for Linux in Windows 10

Once you have Developer Mode enabled, open the Start Menu and search for “Turn Windows Features On or Off“.

A window will open. Tick the box next to the option that reads: “Windows Subsystem for Linux (Beta)”.

Hit OK to apply your changes.

3. Reboot!

Windows loves a reboot and you’ll be prompted to reboot again. This is so that Windows can install the Bash feature. You cannot skip this so step; save your work, close your windows, and restart like the reluctant champ you are.

4. Open ‘Bash’

bash-windows-step-4
Running Bash in Windows 10

When you’re back, open the Start Menu and search for ‘Bash’. Click on the icon that appears.

Now, the first time you run Bash you will be asked to accept the terms of service. Doing so will proceed to download “Bash on Ubuntu on Windows” from the Windows Store.

Once completed you’ll then be prompted to create a user account and password for use in the Bash environment. This user name and password is different from your Windows username and password. You can set it to anything you like.

Once everything has completed you can…

step-5-ubuntu-on-bash-on-windows
Opening Bash on Ubuntu on Windows

5. Open ‘Ubuntu’.

Open the Start Menu and search for ‘Ubuntu’.

Click on the orange circle of doohoo Ubuntu logo to launch Bash on Ubuntu on Windows!

What does Bash on Windows do?

bash
This screenshot doesn’t exactly sell it, right?

Using the Ubuntu Bash shell you can run standard GNU command line tools, such as grep, sed, awk, vi, emacs, nano, ssh, etc.

Microsoft say they support five key areas of interest:

  1. GNU command line tools such as grep, sed, and awk
  2. File system and symlink support within the WSL environment
  3. Ability to run apt & apt-get for installs, updates, and package testing
  4. Basic functionality for languages such as NodeJS/npm, Python, Perl
  5. Command line tools such as Vim, Emacs, Git, and SSH

Keep in mind that it takes a lot of effort to get graphical apps up running on Ubuntu on Bash on Windows (it can be done, but it’s not exactly useable).

You cannot open, edit or delete Windows apps from the Bash shell, or modify Windows system settings, e.g., registry keys.

Do you use Windows 10? Will you be enabling Ubuntu on Bash on Windows?