Windows Subsystem for Linux

Tue, May 5, 2020 2-minute read

new-win-pc.jpg

I’ve been wanting to see WSL2 for myself, so I picked up this Thinkpad T440s off of eBay and started playing around.

I started by installing the following on the T440s:

  • Docker Desktop for Windows (Edge)
  • Windows Subsystem for Linux 2
  • Windows Terminal
  • Visual Studio Code with WSL extension
  • 2004 Windows Update

First Impressions

It was quite easy to install everything after I enabled hardware virtualization. I was running Windows 10 Pro, which uses Hyper-V to run Windows containers (If you wish to do so). Check out my article here to see the difference between Hyper-V and Windows server containers.

hardware-virt-notice.jpg

What’s Involved

I noticed that since I installed Docker Desktop (with the Windows 2004 update), and WSL is now used to run Linux containers, it prompted me to install WSL with the appropriate PowerShell command. How convenient!

wsl2-not-installed.jpg

Also, once the initial WSL2 install was complete, it suggested I install the patch (link included) via msi.

wsl2-installation-not-complete.jpg

After all this, I still needed a distribution. I grabbed Ubuntu 20.04 from the Microsoft store by just searching Ubuntu and clicking install (piece of cake). While I was in the store, I also installed Windows Terminal as an easy way to have Windows PowerShell, WSL Ubuntu, and Cloud Shell all running in the same window.

pwsh-in-win-terminal.jpg wsl-ubuntu-in-win-terminal.jpg azure-cloud-shell-in-win-terminal.jpg

I know Visual Studio Code comes with a built-in terminal, but Windows Terminal was still a pretty cool tool for working in cross-platform datacenters.

After Installing Visual Studio Code, connecting to my WSL instance was a sinch as soon as the WSL extension was added.

vscode-wsl-extension.jpg

Once the extension was added, I clicked on the green remote icon in the lower left, and vscode prompted to start a new connection.

vscode-new-remote-connection.jpg

Once I selected “New Window Using Distro” for my connection type, the distro that I installed via the Microsoft store appeared as an option to select.

vscode-pick-remote-distro.jpg

That opened up a new window and the connection to my WSL distro was complete.

wsl-remote-connection.jpg

Getting to work

Now that everything is installed, now it’s time to get to work!

To be continued….