Engineer's Guide To Windows: WSL
Tags: programming, windows, debian, wsl
Published: 2021-03-02 23:15:26

---
title: Engineer's Guide To Windows: WSL
published: true
date: 2021-02-08 05:00:00 UTC
tags: programming,windows,debian,wsl
canonical_url: https://www.ramimassoud.com/2021/02/08/code-with-wsl-setup
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b67p7aj4bg878ejo2il0.png
series: Engineer's Guide To Windows
---

These days I mostly write Ruby, and from what I hear, it’s a nightmare on Windows proper.

{%twitter 1109834294665592834 %}

{%twitter 1110022037928464384 %}

Thanks to the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about), enough of the headaches have been smoothed out for me to give this a shot.

> The Windows Subsystem for Linux lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual boot setup.

### Enabling WSL
Starting from a [clean slate](https://dev.to/ramimassoud/engineer-s-guide-to-windows-start-fresh-160p), it's time to start the Linux adventure.

I followed along with a helpful [Microsoft article](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get up and running. First, open up an admin PowerShell window, and enable the WSL feature with

```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```

It’s important to end up with WSL 2 because of all of the [performance improvements](https://docs.microsoft.com/en-us/windows/wsl/compare-versions), so make sure to grab all of the Windows updates to get at least to version 1903 with build 18362. Then enable the Virtual Machine platform with

```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```

_**Make sure to restart the computer!**_ Something I missed at first. Once that's done, download and run the Linux kernel update package

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Now pop back into an admin Powershell to set the default WSL version to 2 with

```powershell
wsl --set-default-version 2
```

![windows-store-debian](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/67n6s5olmu2mh1xrjz5a.png) 

Finally, head over to the Microsoft Store to find your favorite Linux distribution, [Debian](https://www.microsoft.com/store/productId/9MSVKQC78PK6), and download/install that.

### Virtualization Issues

![debian-install-fail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2r3u8h20l6mxzpo7x4l0.png) 

Even if WSL avoids “the overhead of a traditional virtual machine,” it still takes advantage of virtualization tech. Initially, when I tried to open up the Debian app, I hit `Error 0x80370102`.

![amd-cpu-virtualization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jnkw1ca9weuj9kncdh6.jpg) 

After some digging, [I found that this meant some virtualization features on my system weren’t enabled](https://github.com/microsoft/WSL/issues/4120#issuecomment-502322017). I have a newer Ryzen build and found a BIOS setting for SVM (AMD Secure Virtual Machine) Mode, disabled. Once I flipped that on and booted back into Windows, I was back in business.

### Wrapping Up

![debian-install-win](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75ea7ae9047wtp5m126u.png) 

Once successfully installed, create a primary user with a secure password, update with the system package manager, and hang tight for the next time where I’ll be getting my development environment ready for my day-to-day work!

### Bonus: Windows Terminal

![windows-store-windows-terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rvyoqdva791p6f4vwxy5.png) 

Microsoft has been doing a great job with their tooling for developers, and the [Windows Terminal app](https://www.microsoft.com/store/productId/9N0DX20HK701) is no exception! Grab it from the Microsoft Store, and it can be a great alternative to the more basic terminal experience you get from the WSL apps themselves.

Windows Terminal is super customizable, and all from editing an easy-to-read JSON file. Check out the [documentation for the various options](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/global-settings) and even some cool [custom color schemes](https://docs.microsoft.com/en-us/windows/terminal/custom-terminal-gallery/custom-schemes).