How-To Geek
How to Install and Use the Linux Bash Shell on Windows 10

Windows 10’s Anniversary Update offers a big new feature for developers: A full, Ubuntu-based Bash shell that can run Linux software directly on Windows. This is made possible by the new “Windows Subsystem for Linux” Microsoft is adding to Windows 10.
What You Need to Know About Windows 10’s Bash Shell
This isn’t a virtual machine, a container, or Linux software compiled for Windows (like Cygwin). Instead, Windows 10 gains a Windows Subsystem for Linux, which is based on Microsoft’s abandoned Project Astoria work for running Android apps on Windows.
Think of it as the opposite of Wine. While Wine allows you to run Windows applications directly on Linux, the Windows Subsystem for Linux allows you to run Linux applications directly on Windows.
Microsoft has worked with Canonical to offer a full Ubuntu-based Bash shell that runs atop this subsystem. Technically, this isn’t Linux at all. Linux is the underlying operating system kernel, and that isn’t available here. Instead, this allows you to run the Bash shell and the exact same binaries you’d normally run on Ubuntu Linux. Free-software purists often argue the average Linux operating system should be called “GNU/Linux” because it’s really a lot of GNU software running on the Linux kernel. The Bash shell you’ll get is really just all those GNU utilities and other software.
There are some limitations here. This won’t work with server software, and it won’t work with graphical software. It’s intended for developers who want to run Linux command-line utilities on Windows. These applications get access to the Windows file system, but you can’t use Bash commands to automate normal Windows programs, or launch Bash commands from the standard Windows command-line. They get access to the same Windows file system, but that’s it. Not every command-line application will work, either, as this feature is still in beta.
How to Install Bash on Windows 10
To get started, ensure you’ve install the Windows 10 Anniversary Update. This only works on 64-bit builds of Windows 10, so it’s time to switch to the 64-bit version of Windows 10 if you’re still using the 32-bit version.
Once you’re sure you’re using the correct version of Windows 10, open the Settings app and head to Update & Security > For Developers. Activate the “Developer Mode” switch here to enable Developer Mode.

Next, open the Control Panel, click “Programs,” and click “Turn Windows Features On or Off” under Programs and Features. Enable the “Windows Subsystem for Linux (Beta)” option in the list here and click “OK.”
After you do, you’ll be prompted to reboot your computer. Click “Restart Now” to reboot your computer and Windows 10 will install the new feature.

After your computer restarts, click the Start button (or press the Windows key), type “bash”, and press “Enter.”

The first time you run the bash.exe file, you’ll be prompted to accept the terms of service. The command will then download the “Bash on Ubuntu on Windows” application from the Windows Store. You’ll be asked to create a user account and password for use in the Bash environment.

If you’d like to automate the installation of Bash instead, you can run the following command in a Command Prompt window. This will automatically agree to all prompts and set the default user to “root” with no password:
lxrun /install /y
How to Use Ubuntu’s Bash Shell and Install Linux Software
You’ll now have a full command-line bash shell based on Ubuntu. Because they’re the same binaries, you can use Ubuntu’s apt-get command to install software from Ubuntu’s repositories. You’ll have access to all the Linux command line software out there, although not every application may work perfectly–especially in the initial beta releases.
To open the Bash shell, just open your Start menu and search for “bash” or “Ubuntu.” You’ll see a “Bash on Ubuntu on Windows” application. You can pin this application shortcut to your Start menu, taskbar, or desktop for easier access.

If you’re experienced using a Bash shell on Linux, Mac OS X, or other platforms, you’ll be right at home. You don’t need to use sudo, as you’re given a root shell. The “root” user on UNIX platforms has full system access, like the “Administrator” user on Windows. Your Windows file system is located at /mnt/c in the Bash shell environment.
Use the same Linux terminal commands you’d use to get around. If you’re used to the standard Windows Command Prompt with its DOS commands, here are a few basic commands on both Bash and Windows:
- Change Directory: cd in Bash, cd or chdir in DOS
- List Contents of Directory: ls in Bash, dir in DOS
- Move or Rename a File: mv in Bash, move and rename in DOS
- Copy a File: cp in Bash, copy in DOS
- Delete a File: rm in Bash, del or erase in DOS
- Create a Directory: mkdir in Bash, mkdir in DOS
- Use a Text Editor: vi or nano in Bash, edit in DOS
It’s important to remember that, unlike Windows, the Bash shell and its Linux-imitating environment are case-sensitive. In other words, “File.txt” with a capital letter is different from “file.txt” without a capital.
For more instructions, consult our beginner’s guide to the Linux command-line and other similar introductions to the Bash shell, Ubuntu command line, and Linux terminal online.

You’ll need to use the apt-get command to install and update the Ubuntu environment’s software. Be sure to prefix these commands with “sudo”, which makes them run as root–the Linux equivalent of Administrator. Here are the apt-get commands you’ll need to know:
- Download Updated Information About Available Packages: sudo apt-get update
- Install an Application Package: sudo apt-get install packagename (Replace “packagename” with the package’s name.)
- Uninstall an Application Package: sudo apt-get remove packagename (Replace “packagename” with the package’s name.)
- Search for Available Packages: sudo apt-cache search word (Replace “word” with a word you want to search package names and descriptions for.)
- Download and Install the Latest Versions of Your Installed Packages: sudo apt-get upgrade
Once you’ve downloaded and installed an application, you can type its name at the prompt and press Enter to run it. Check that particular application’s documentation for more details.

Bonus: Install the Ubuntu Font for a True Ubuntu Experience
If you want a more accurate Ubuntu experience on Windows 10, you can also install the Ubuntu fonts and enable them in the terminal.
Download the Ubuntu Font Family from Ubuntu’s website. Open the downloaded .zip file and locate the “UbuntuMono-R.ttf” file. This is the Ubuntu monospace font, which is the only one used in the terminal. It’s the only font you need to install.

Double-click the “UbuntuMono-R.ttf” file and you’ll see a preview of the font. Click “Install” to install it on your system.

To make the Ubuntu monospace font become an option in the console, you’ll need to add a setting to the Windows registry.
Open a registry editor by pressing Windows+R on your keyboard, typing regedit , and pressing Enter. Navigate to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont

Right-click in the right pane and select New > String Value. Name it 000 .
Double-click the “000” string you just created and enter Ubuntu Mono as its value data.

Launch a Bash window, right-click the titlebar, and select “Properties”. Click the “Font” tab and select “Ubuntu Mono” in the font list.

Remember, software you install in the Bash shell is restricted to the Bash shell. You can’t access it from the Command Prompt, PowerShell, or elsewhere in Windows. Software in the Bash shell also can’t interact directly with or launch Windows programs, although the Bash environment and Windows have access to the same files on your computer.
However, you can create Bash shell scripts (.sh scripts) and run them with the Bash shell.

I think the comparison with wine isn't a good one. Wine emulates the win32 api for apps to run while, as you say further, bash for windows runs with windows binaries without emulation.
@BlueTech As far as I understand it will actually be running Ubuntu binaries by redirecting API calls, which is indeed quite similar to what Wine does.
Anyway, I will be interested to see how well this stacks up. Cygwin has some serious draw-backs founded in limitations of the Windows APIs, such as very slow subprocess invocations due to a slow emulation of a Unix-like fork-operation.
Ideally this system may spare me from an awkward mix of GnuWin32, Cygwin and native Python/Perl (with commonly failing cpan/pip) in the future, essentially making Windows 10 combine my preferred parts of Linux with my preferred parts of Windows.
The mentioned limited interaction between native Windows binaries and Bash-for-Windows binaries could sabotage that though, as could the limitations for server software.
This is a great move by Mircosoft. Many people have been using bash (or variants) for decades. Bash is far superior to windows batch or powershell. I think this will be a big hit. However, it really needs to be on Windows Server.
and be able to do administrative stuff, because I believe ms will have greatly reduced bash's capabilities
I've been doing stuff like this for a long time, starting under MSDOS, and you don't need to wait for the Win10 preview build to get a version of Bash. The question is why you might want to. Most of the efforts I've seen are focused on developers who want the Gnu/Linux toolchain available to use in development under Windows.
Cygwin had the intent of porting the Gnu/Linux toolchain to Win32 Rather than rewriting everything to use Windows APIs instead of *nix system calls, they implemented a POSIX compatibility layer encapsulated as a DLL. A lot of *nix code builds out of the box using GCC under Cygwin because it links against the DLL and sees the *nix system routines it expects. It works fine, but takes a serious speed hit because of the differences between how *nix and Windows do things, like the issues with forking processes. And when you are under Cygwin, you are in a *nix compatible command line environment, and must use / as a PATH separator and - as an option control character, and jump through various hoops when interacting with native commands that don't grok that in consequence.
An alternative is the AT&T UWin effort, an open source environment taking an approach similar to Cygwin in using a compatibility layer, with a port of the Korn shell as a centerpiece. (The project was run by Korn Shell creator Dr. David Korn.)
The MinGW project and companion MSYS took a different approach, building things via GCC to use Windows runtimes, and many *nix commands are available that way as well as a version of GCC configured to compile to native Windows binaries. I have it on my desktop under Win7.
The fullest implementation of bash and friends I've seen is part of Git for Windows. Install it, and you get a version of the Git DVCS for Windows and a full set of Gnu/Linux utilities in native Windows builds, including bash. Bash itself can be had from an assortment of sources, as can tcsh, zsh, and others, but those versions will be based on older code.
The interesting thing about this effort isn't bash per se - it's the addition of the libraries to Windows providing the support that makes it possible to implement bash. Right now, I'd call bash and friends a proof-of-concept demonstrating it's possible. Seeing the ability to run Ubuntu graphical apps under Windows down the road would come as no surprise. (There is a moribund project to get the KDE desktop environment under Windows using Cygwin, that actually had a working KDE desktop for Windows back in the WinXP days, so it's certainly doable.)
Powershell gives virtually access to all the .Net framework, Win32 and native libraries. So I would not say that bash is "far" superior to it.
Chris wrote, "There are some limitations here. This won’t work with server software, and it won’t work with graphical software."
Well, turns out that at least some graphical software can be made to work with it.Neowin has an article by Andrew Stevenson showing where someone has the gui based improved vi (vim) running via bash shell on Windows 10.
see http://www.neowin.net/news/bash-plus-windows-10-equals-linux-gui-apps-on-the-windows-desktop
I don't know if GNOME apps would run on windows, since it would be the equivalent of two oses size on HDD and that wouldn't be very useful
plus, MS has no interest in making that possible, the only thing they would love to do would be to integrate Linux into Windows server to get a bigger piece of the cake in the server space
I followed your indications but can´t find such option as you can see in this picture.
I am using Windows 10, Home Edition. May that be the problem?
I really can't see this as being a real feature for the average user, however I can totally see this on Windows Server. Maybe not on 2012R2, but on Server 2016- which hasn't been released yet but is the same kernel as 10. So, this may be aimed at developers. I'm quite sure Microsoft does not have any interest in getting Linux apps running on Windows when there are 1000's of alternative Windows equivalents already.
Either way, this is brilliant for Microsoft. Seeing as they fully support UNIX/Linux on Hyper-V, they are moving to incorporate a wider Professional audience; and Linux Desktop user's aren't it. I suspect their goal is to move into the UNIX space down the road. Think, LAMP on Server 2016.
Thanks Chris for the write up.
I'm able to install Ubuntu on my Win10 machine but I'm unable to figure out how to change directory to mapped network drives. I can do 'cd /mnt/c/Windows' to go to C:\Windows, but cannot go to any network drives. Under /mnt there's only the c folder.
have you tried to manually mount the other drives?
Hello alenguav!
I am not 100% sure, but the problem is most likely that you're not running an Insider Preview (Windows for beta-testers, that is), but a regular Windows 10.
I am not sure if I can recommend you to opt-in for Insider, because the last time I used that it was very unstable, but see for yourself.
WINE stands for "Wine is not an emulator", since it doesn't emulate the win32 API, it translates it and provides alternate DLLs.
HI, I am trying to use this feature but for me when I run the bash.exe and enter y the command prompt will show downloading from windows store ... 0% and will be stuck there ... and finally disappear . On running again it starts from the start again asking to accept terms and again the same loop..
The part about not needing to worry about sudo and being logged in with Administrator rights has me a little concerned but hopefully they wall of the Windows side in some way. Otherwise that seems like a potential security hole.
But then maybe only Administrators are the only one that are supposed to be able to enable this feature to begin with.
As far as I understand it is meant for developers. In corporate environments however developers are apparently quite likely not to be administrators, as they are supposed to develop software, not to do OS maintenance.
Likewise users of the code may need to compile it inside a restricted account (e.g. when using code on a computation cluster) and thus code should if possible also be developed within a restricted account.
No matter how I look at it, I can't think of any way to think of "not needing sudo" as positive.
My best guess: They will add restricted accounts later.
<<<< great if you want to run Linux apps in a Linux way. <<
Useless if you want to use the Linux "functionality" is a way that isfully windows compatible and 100% integrated with standard windows programs and standard windows path-name requirements.
These limitations are insanely un-acceptable.
What we need is a mks version that is 100% windows compatibleso we have the full bebefit of the bash shell and bash scripts to controlour windows environment
All the other approaches are just shims to enable Linux programs to run in a Linux-fashion that is totally non windows compatible
The ming-gw (msys) and Cygwin and git which also uses msysare not windows compatible the /mnt/xx or /C/ methodology
causes windows programs to get confused; also all of the aboveshell versions change re-map the path env from windowsformat to linux format which also causes windows programs to get confused