Do you want quick and easy access to Linux on your Windows PC? The best option is to use the Windows subsystem for Linux.
This will give you a Linux bash shell, a terminal window that runs on Windows. The process essentially installs Linux on Windows 10 – here's what you need to know.
What is the Windows Subsystem for Linux?
The Windows subsystem for Linux is included for the first time in the Windows 10 Anniversary Update 2018 and was made available to all users in the Fall Creators Update.
This is a feature built into Windows. In contrast to installing Linux in a virtual machine, the Windows subsystem for Linux can be called up immediately via the start menu.
However, for this to work you need to enable the feature first.
Once the Windows Subsystem for Linux is installed on Windows 10, you can run Linux in command line mode. This gives you an almost fully functional Linux terminal for Windows 10.
Linux Bash Shell: Only for 64-bit Windows 10
Before you begin, make sure you are running a 64-bit version of Windows 10. Unfortunately, the Windows subsystem for Linux does not work on 32-bit systems. Check to see if your computer is running 32-bit or 64-bit Windows.
To check your computer for 64-bit compatibility, press WIN + I to open Settings, then System> About. Under "Device Specifications" you can see the System type listed; for Windows Subsystem for Linux it should read 64-bit operating system.
If not, you'll need to upgrade your Windows 10 system from 32-bit to 64-bit. However, this will only work if you have 64-bit hardware.
How to install the Linux bash shell on Windows 10
Before proceeding, note that some systems cannot have the Windows subsystem for Linux and virtual machines (VM) enabled at the same time. Therefore, if you want to run Linux in a VM, you must disable the Windows Subsystem for Linux before using the virtual machine again.
Ready to Install Bash on Windows? Begin by clicking Start and typing "turn windows". The Turn Windows features on or off Item should appear, so click on it to open it. Wait while the list is filled in, then scroll down to Windows subsystem for Linux.
This check box should be checked. If it doesn't, add a check mark, then click OK to confirm.
You will be prompted to restart Windows, follow these instructions. After the restart, open Start> Windows Store. Use the search function to find Linux-related entries and select your preferred version of Linux to install. Whichever one you choose determines the bash experience. For example, you can install Ubuntu on Windows 10.
To install the linux operating system then wait. When you're done, click Start from the Windows Store or open it from the begin Menu. The first time you run it, you will be prompted for a username and password to create a user account.
Other methods are available to start your chosen Linux environment. In the start menu you can enter:
Both are displayed as an "Execute Command" that can be selected to open the bash shell immediately. The difference in using either of these methods is that they are in the. to open / mnt / c / Windows / System32 Directory. This means that you can browse the System32 subdirectory in Windows 10.
Note that it is not possible to break Windows 10 using the Linux environment. Any commands you enter will only damage the Windows subsystem for Linux and the selected operating system. Windows 10 stays safe and secure.
You also need the Windows 10 developer mode in settings to run bash.
How is the Bash Shell Terminal different from Windows PowerShell?
With the Linux Terminal for Windows 10 running, you can enter a variety of command line instructions.
But how is this different from just using Windows Command Prompt or PowerShell?
Well, of course, the two systems are quite different. With PowerShell or Command Prompt, you are limited to commands that are specific to Windows. This means, for example, the use of the to you Command to display the contents of a directory; on Linux is the equivalent ls.
Basically, these two text environments differ in the differences between Windows and Linux. The advantage of the bash shell in Windows 10 is that you can easily access Linux from within Windows. This saves time setting up a virtual machine or rebooting into a dual boot installation of Linux.
What can you do with Bash in Windows 10?
With the bash shell set up on Windows 10, you can use it just like you would on a Linux PC.
Standard commands like Help show you how to use the preinstalled apps and tools. For example, appropriate help will demonstrate the use of the package manager. You can use sudo apt update to get the latest packages like you would on a Linux PC.
Likewise the sudo apt upgrade Command updates Linux to the latest version of the operating system.
Other standard commands are now also available. You can check your network connection with ifconfig, check the current directory with pwd, and switch to another directory with CD.
You can also get a quick list of the last 10 entries with the history Command.
In short, it's like using Linux within the Windows 10 operating system.
Windows 10 Bash brings Linux to every PC
Setting up the Windows subsystem for Linux and accessing the bash shell is easy. It's also faster than running a virtual machine and far less complicated than relying on dual-boot.
To recap, all you need to do to run the Linux Bash shell on Windows 10 is:
Check if you are using 64-bit Windows 10.
Enable the Windows Subsystem for Linux in the Windows Features screen.
Install your chosen Linux environment from the Windows Store.
Run Linux from the start menu.
From then on, you can use the Linux Terminal for Windows for standard command line tasks. Or you can use Windows 10's Linux subsystem to install a desktop environment.
Almost all Linux commands can now be used in the Bash shell under Windows. A little rusty or need help learning some Linux command line tricks.
Become a Linux command line master with these tips and tricks
Whether you are new to Linux or a seasoned Linux veteran, the command line has a wide variety of uses. Try these tips to master the command line.
About the author
(1500 published articles)
Deputy Editor for Security, Linux, DIY, Programming and Tech Explained and a really useful podcast producer with extensive experience in desktop and software support
As a contributor to Linux Format Magazine, Christian is a Raspberry Pi tinkerer, Lego lover and retro gaming fan.
By Christian Cawley
Subscribe to our newsletter
Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive offers!
One more step …!
Please confirm your email address in the email we just sent you.
Expand to read the full story