Skip to main content

Completing my WSL installation

Updated 2 min readMarkdown
Part of seriesBuilding the LSM-tree Storage Engine
Completing my WSL installation

To use TSan, I required a working WSL terminal. But the moment I opened it, it would instantly crash. This is how I got it to work(all of the following was conducted while running Windows PowerShell as an administrator).

Firstly, I tried:

wsl

It showed:

Windows Subsystem for Linux has no installed distributions.

You can resolve this by installing a distribution with the instructions below:

Use 'wsl.exe --list --online' to list available distributions and 'wsl.exe --install <Distro>' to install.

I tried:

wsl --list --online
wsl --install -d Ubuntu

It would tell me to reboot to see the changes, but it would show the earlier (”Windows subsystem.. ..to install.”) output. Upon GPT’s suggestion, I put:

wsl --status

It showed:

Default Version: 2
WSL1 is not supported with your current machine configuration.
Please enable the "Windows Subsystem for Linux" optional component to use WSL1.
WSL2 is unable to start since virtualization is not enabled on this machine.
Please ensure the "Virtual Machine Platform" optional component is enabled and virtualization is turned on in your computer's firmware settings.

Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution" 

I put:

wsl --install --no-distribution

This required another reboot. After that, I checked whether my Virtualization was enabled(Go to Task Manager→Performance→CPU). Thankfully, it was enabled(if it’s not, you need to enable virtualisation in your BIOS/UEFI).

The next two commands really revealed what was inhibiting the wsl installation. For wsl to install, both of the following commands..

Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

..must return Status: Enabled among its outputs. But in my case, for the latter one, it returned Status: Disabled. To enable it, I had to run:

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

The operation completed successfully. I rebooted the pc as per GPT’s suggestion. Finally, for the last time, when I put in:

wsl --install -d Ubuntu

It started its proper installation and asked for my Linux username and password.

19 views

About the author

  • Low-level C++ engineer specializing in database storage architectures. Currently deconstructing analytical query engines and implementing LSM write paths under strict ASan, TSan, and memory-ordering constraints.

No comments yet. Be the first to comment.

Building the LSM-tree Storage Engine

Part 1 of 6

This series details the structural evolution of a Log-Structured Merge (LSM) tree storage engine in C++. The architecture is developed sequentially from volatile memory primitives to persistent disk storage. The implementation begins with a MemTable backed by a custom Arena allocator for localized memory control. Concurrency is established via a lock-free SkipList. Data durability is enforced through Write-Ahead Logging (WAL) protocols. The system finalizes by flushing volatile data structures to immutable Sorted String Table (SSTable) blocks on disk. The documentation traces the exact engineering progression required to assemble high-throughput database internals from the ground up.

Up nextFixing the Silent Data RaceMy skiplist.h code had a bug capable of causing data races at higher throughput. Initially, when I ran my test harness with just two threads, each with one insert function, it compiled and ran success

More from this blog