Windows Subsystem for Linux (WSL) allows users to run GNU/Linux environment directly on Windows. This tutorial will show you how to run Ubuntu in your windows 10 environment.
This installation includes the utilization of some command-line tools, utilities, and applications.
Enable Windows Subsystem Linux (WSL) in Windows 10
Windows Subsystem for Linux is available on the desktop version of Windows for Windows 10 Anniversary (Redstone1 - 1607) and Creators update (Redstone2 - 1703) or later. Check the version of your Windows by
Settings -> System -> About
This article is based on Windows 10 Fall Creator (Redstone3 - 1709).
To install any Linux distribution for WSL, you must enable the feature "Windows Subsystem for Linux". Open your PowerShell as an administrator
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
After you will be prompted to restart
1) Install Ubuntu on Windows 10
To install Ubuntu you will need to go through the windows store application. Launch the research of Ubuntu
We will install Ubuntu 18.04
2) Run Ubuntu on Windows 10
Now that your download is finished, you can run your Linux subsystem by clicking the launch button in the Windows Store through the Windows start menu. A new terminal will be launched asking to provide a username and password for your new system
You can use your Ubuntu commands
It means that you can normally update the repo cache
3) Run some graphics application
This article will not try to explain how to have a full GUI compatibility with WSL. You must keep in mind that by default you are not able to run any application which can need graphics interface such as gedit. First install gedit, now if you try to run the gedit command, you will have some errors as below
You will need to install an X11 display server for Microsoft OS on your Windows 10 in order to use some small graphics applications which don't require a high system capacity. In our case, we will use Xming
After the installation make sure to allow Xming to the firewall
Now we need to run some command on your Ubuntu terminal to point any GUI activity at the correct display
export DISPLAY=:0.0 echo "export DISPLAY=:0.0" >> ~/.bashrc
Now you can run gedit again, you will see that it will work this time
You can install firefox
Then try. You can see that it works.
Now you have a working Ubuntu 18.04 which allow you to run small Linux graphics apps on your Windows 10 system. The Windows Subsystem Linux also proposes some others Linux systems such as Debian, Kali, OpenSuse etc. You can enjoy your new system once installed.