Windows Subsystem for Linux 2

 

Table of Contents

Installing Windows Subsystem for Linux. 1

Overview. 1

Check Windows Version. 2

Enable Intel Virtualization Technology. 2

Enable WSL. 2

Enable Virtual Machine Platform.. 2

Set WSL2 as the Default 3

Install a Linux Distribution. 3

Start the Linux Distribution. 3

Using Windows Subsystem for Linux. 4

Software Updates. 4

Printing. 4

Using GUI 4

Other Ubuntu Linux Information. 4

Help. 4

Other Windows Information. 5

Make the Current User the Administrator 5

Enter UEFI Firmware. 5

List Installed WSL Linux Distributions. 5

Open the Control Panel 5

Windows Keyboard Shortcuts. 5

 

Copyright © 2020 by Bruce Blinn

Installing Windows Subsystem for Linux

Windows Subsystem for Linux, WSL, creates a Linux terminal environment where you can execute shell Linux commands, install Linux software packages, and run Linux applications. Linux is installed in WSL via an app from the Microsoft Store.  Each app that is installed creates a separate root file system, and thus, it is a separate Linux installation.

When you run the Linux app, for example, from the Start Menu, a terminal window will be opened.  If you run the app multiple times, multiple terminal windows will be opened.

Windows file systems are available in the Linux environment via the /mnt file system.  Each Windows file system is mounted under its corresponding letter name.  For example, C:/ is mounted at /mnt/c.

Overview

1.     Check Windows Version.

2.     Enable Intel Virtualization Technology.

3.     Enable WSL.

4.     Enable Virtual Machine Platform.

5.     Set WSL2 as the Default.

6.     Install a Linux Distribution.

7.     Start the Linux Distribution.

Check Windows Version

·         WSL 2 requires Windows 10, version 2004.

·         To find out the current version of Windows, go to Settings->Update & Security->Windows Update.

Enable Intel Virtualization Technology

·         Enter Unified Extensible Firmware Interface (UEFI), which is a replacement for the BIOS, by pressing the shift key and restarting Windows.

·         When the system enters UEFI, select Troubleshoot.

·         Select UEFI Firmware Settings, then press the Restart button.  The system will reboot into the setup utility where you can only use the console display and console keyboard.

·         Press the right arrow to select Configuration.

·         Press the down arrow to select Intel Virtual Technology.

·         Press Fn + F5 to toggle the value until it is enabled.

·         Press Fn + F10 to save and exit.

You can wait to enable Intel Virtual Technology until later.  If it is not enabled, you will get the following error when the Linux distribution is first started.  If you see this error, follow the steps to enable Intel Virtual Technology.

Installing, this may take a few minutes...

WslRegisterDistribution failed with error: 0x80370102

Error: 0x80370102 The virtual machine could not be started because a required feature is not installed.

Enable WSL

·         Go to Settings->Apps.

·         Under Related settings, click on Programs and Features.

·         In the left pane, click on Turn Windows features on or off.

·         Find Windows Subsystem for Linux and make sure it is checked to enable or unchecked to disable.

·         Click the OK button.

·         Restart Windows.

Enable Virtual Machine Platform

·         Go to Settings->Apps.

·         Under Related settings, click on Programs and Features.

·         In the left pane, click on Turn Windows features on or off.

·         Find Virtual Machine Platform and make sure it is checked to enable or unchecked to disable.

·         Click the OK button.

·         Restart Windows.

Set WSL2 as the Default

·         Open a shell window by selecting Start Menu->Windows Powershell->Windows Powershell.

·         Execute wsl --set-default-version 2.

·         If this fails, you may need to install Windows update KB4566116.

Install a Linux Distribution

·         Open the Microsoft Store by selecting Start Menu->Microsoft Store.

·         In the search field, enter “Linux” and press enter.  LTS in a distribution name stands for “Long Term Support”.

·         Ubuntu is the same as the most recent Ubuntu LTS distribution available.

·         Updating the distribution app in the Microsoft Store does not update the distribution installation.  To update the distribution installation, execute do-release-upgrade from a command line in the distribution.

·         Click on a distribution to get more information about it.

·         Click on Install in the upper right corner of the information page.  This only takes 2-3 minutes.

Start the Linux Distribution

·         Run Ubuntu Linux by selecting Start Menu->Ubuntu.

·         Or, execute ubuntu from a Windows command line.

 

·         The installation will be completed the first time you start Ubuntu.

Installing, this may take a few minutes...

Please create a default UNIX user account. The username does not need to match your Windows username.

For more information visit: https://aka.ms/wslusers

Enter new UNIX username: groot

New password: IAmGroot

Retype new password: IAmGroot

passwd: password updated successfully

Installation successful!

To run a command as administrator (user "root"), use "sudo <command>".

See "man sudo_root" for details.

 

Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 4.19.128-microsoft-standard x86_64)

 

 * Documentation:  https://help.ubuntu.com

 * Management:     https://landscape.canonical.com

 * Support:        https://ubuntu.com/advantage

 

  System information as of Tue Sep 15 16:50:46 PDT 2020

 

  System load:  0.08               Processes:             8

  Usage of /:   0.4% of 250.98GB   Users logged in:       0

  Memory usage: 1%                 IPv4 address for eth0: 172.18.8.27

  Swap usage:   0%

 

1 update can be installed immediately.

0 of these updates are security updates.

To see these additional updates run: apt list --upgradable

 

The list of available updates is more than a week old.

To check for new updates run: sudo apt update

 

This message is shown once once a day. To disable it please create the

/home/bruce/.hushlogin file.

bruce@Pleasure-Way:~$

Using Windows Subsystem for Linux

Software Updates

To keep Ubuntu up to date, periodically execute the following commands.

$ sudo apt update

$ sudo apt upgrade –y

 

Printing

$ sudo apt install cups lpr

$ sudo service cups start

$ sudo service lpd start

 

lpadmin -p printer -E -v device -m ppd Lpadmin

Using GUI

$ DISPLAY=:0.0

$ export DISPLAY

Other Ubuntu Linux Information

Help

For help go to:

·         Awesome-WSL

·         Using Ubuntu on WSL

·         Ubuntu server documentation

·         Ubuntu package management

Other Windows Information

Make the Current User the Administrator

·         Open the Control Panel.

·         Click on User Accounts.

·         Click on Change your account type.

·         Select the Administrator radio button.

·         Press the Change Account Type button.

Enter UEFI Firmware

·         UEFI-based computers have generally replaced BIOS based computers when Windows 8 came out.  To access the UEFI firmware settings, press the shift key while restarting Windows.

List Installed WSL Linux Distributions

·         Open a shell window by selecting Start Menu->Windows Powershell->Windows Powershell.

·         Execute wsl --list –verbose.

PS C:\Users\bruce> wsl --list --verbose

Windows Subsystem for Linux has no installed distributions.

Distributions can be installed by visiting the Microsoft Store:

https://aka.ms/wslstore

Open the Control Panel

·         To open the control panel, press the Windows Key + R.  This will bring up the Run dialog. Enter “Control Panel” and press enter.

·         Or, select Start Menu->Windows System->Control Panel.

Windows Keyboard Shortcuts

Ctrl + Esc               Open Start Menu

Win + E                  Open File Explorer

Win + I                    Open Settings Menu

Win + R                  Open the Run Window

Win + X                  Open secret Start Menu

Win + Prnt Scrn       Capture screen shot of desktop

Win + X  I                Windows Powershell