The Windows Subsystem for Linux (WSL) was introduced by Microsoft in the Windows 10 Anniversary Update. It allows users to run a full Linux user space in Windows. It is a much nicer approach for most applications than Cygwin, or using a Linux VM. It is not an emulator either. Think of it as GNU/Linux/Windows (apologies to Richard Stallman). This guide starts off with Microsoft’s instructions for installing the WSL, and then goes a few steps further by describing how to run graphical Linux applications.
Your PC must be running (at a minimum) a 64-bit version of Windows 10 with the Anniversary Update. The Creator’s Update is recommended.
To find your PC’s CPU architecture and Windows version/build number, open Settings>System>About. Look for the System Type and Version fields respectively, as shown in the screenshot below.
If your build is below 14393, try checking for updates.
You can enable the feature using a GUI or command-line interface.
Open a PowerShell prompt as administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Restart your computer when prompted.
It is important that you DO restart when prompted as some of the infrastructure which Bash on Windows requires can only be loaded during Windows’ boot-up sequence.
Linux distributions can be installed using a script, or by using the Microsoft Store links below:
After installation your Linux distribution will be located at:
%localappdata%\lxss\ This directory is marked as a hidden system folder for a very good reason:
Avoid creating and/or modifying files in this location using Windows tools and apps! If you do, it is likely that your Linux files will be corrupted and data loss may occur. Please read this blog post for more information.
The Linux distribution in Windows, you will be prompted to create a UNIX username and password.
This UNIX username and password has no relationship to your Windows username and password, and it can be different.
Use the same username that you use on remote Linux/UNIX systems, so you won’t need to specify it in individual configuration files, or every time you run commands like
ssh. Read more.
After you have set up your user, update the OS.
To do this on Debian/Ubuntu based distributions, run:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y
In order to run Linux GUI applications on Bash On Ubuntu on Windows, you must:
In order to run graphical Linux applications, you’ll need an X server.
VcXsrv is the only fully open source and up-do-date native X server for windows.
You may receive a prompt to allow it through your firewall. Cancel/deny this request! Otherwise, other computers on your network could access the server.
A X icon will appear in your system tray.
echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
sudo apt-get install x11-apps
A new window will open, containing a pair of eyes that will follow your mouse movements.
To use a GUI application from a server, simply use the
-X switch with the
ssh command, for example:
ssh -X email@example.com
And run the GUI application from the shell prompt.
Reference: Official install guide from Microsoft
This post was last modified on October 2, 2019 1:51 am