There’s a little-known feature now in Windows 10 which is a fairly awesome piece if you know Linux/Ubuntu and, say, you’re a coder. Microsoft and Canonical got together to add an Ubuntu on Windows subsystem in the 14393.0 “Anniversary Update” OS Build.
The feature is also called the Windows Subsystem for Linux. What’s interesting is that from
bash you can actually invoke a Windows executable or one compiled for Ubuntu. It can run DOS batch files as well as shell scripts.
- Turn on
Developer Modein Windows 10 -> Settings -> Update & Security -> For developers
- Turn on the
Windows Subsystem for Linux (Beta)in Windows 10 -> search for “Turn Windows features” -> select Turn Windows features on or off
- Restart Windows 10
- Go to a command prompt
bashand type a
yto continue, noting that this step will take about 20 minutes
- When finally prompted, enter a UNIX username (it’s case-sensitive) and a password (again, case-sensitive) which are completely separate from your other credentials
From this point you can run an Ubuntu
bash prompt either from the added Start entry or by entering
bash in an MS-DOS or PowerShell prompt.
- It’s probably not a good idea to use
Notepador similar Windows tools to edit configuration files within the Ubuntu space.
- You should be able to
sudofrom this first user as you might expect.
- Once logged in, you’ll land in a
/mnt/c/Users/usernamelocation from a Unix perspective.
- Since the OS is Ubuntu, you would run
sudo apt-get updateto install things.
- If you want to invoke Windows executables from a
bashsession, you probably want to start by adding the SYSTEM32 folder to your path, for example:
export PATH=$PATH:/mnt/c/Windows/System32but since this is UNIX you’ll need to make sure that the capitalization is right for each path.
lsb_release -aif you’d like to see which release of Ubuntu is running.
- In theory, you could run
bashscripts within a PowerShell script.
- At this time, it does not support GUI applications.