WSL2 Nested on a Windows VPS: Hyper-V Requirement, Memory Reservation and When It Will Not Start

WSL2 is not a compatibility layer like its predecessor. It runs a real Linux kernel inside a lightweight utility VM, which means it needs the Windows hypervisor — the same one Hyper-V uses. On a desktop that is usually free; on a Windows VPS it depends entirely on what your provider exposes. Half of all “WSL2 will not start on my VPS” cases come down to a missing virtualisation flag, and the other half to a memory reservation nobody accounted for.

This article covers the requirements, the exact error messages and their causes, how to cap WSL2’s memory footprint so it does not eat the host, and when the whole idea is a bad fit for a rented server. If you are choosing an instance for mixed Windows/Linux development, compare Windows VPS plans with the numbers below in hand — WSL2 is memory-hungry in a way that is easy to underestimate.

The Real Requirements

WSL2 requires Windows 10 version 2004 or later, Windows 11, or Windows Server 2019/2022/2025 with the Microsoft-Windows-Subsystem-Linux and VirtualMachinePlatform optional features enabled. Enable them with Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux,VirtualMachinePlatform -All, then reboot. On Server editions the Store is often absent, so use the MSI or wsl --install --no-distribution from a recent WSL release.

Underneath, WSL2 needs the Hyper-V hypervisor running at boot. On Windows Server that means installing the Hyper-V role (or merely enabling the hypervisor with bcdedit /set hypervisorlaunchtype auto, which is what the VirtualMachinePlatform feature does). Check the current state with bcdedit /enum {current} | findstr hypervisorlaunchtype. If it says off, WSL2 will refuse to start no matter how many times you reinstall the distro.

Critically, enabling the hypervisor changes the operating system’s relationship with the physical CPU. Windows itself becomes a guest of Hyper-V, and systeminfo will report “A hypervisor has been detected. Features required for Hyper-V will not be displayed.” That is expected — but it also means any other virtualisation software that needs raw VT-x (older VMware Workstation versions, VirtualBox pre-7, some Android emulators) will now fail or fall back to painfully slow emulation.

When It Will Not Start: The Error Messages

WslRegisterDistribution failed with error: 0x80370102 — “The virtual machine could not be started because a required feature is not installed.” This is the nested-virtualisation error. The provider’s hypervisor is not exposing VT-x/AMD-V to your guest. On KVM-based hosts this is the nested=1 module option and a CPU model of host-passthrough; on Hyper-V parents it is Set-VMProcessor -ExposeVirtualizationExtensions $true. If you are on a fully virtualised container or a “VPS” that is really a slice of a shared kernel, it will never work.

error: 0x80370114 — “The operation could not be started because a required feature is not installed.” Usually the hypervisor is not launching at boot (see hypervisorlaunchtype) or the VirtualMachinePlatform feature never finished installing. 0x8007019e appears when the Windows Subsystem for Linux feature is off entirely, and 0x800701bc means the WSL2 kernel update package is missing — install the wsl_update_x64.msi or run wsl --update.

WSL_E_VM_MODE_INVALID_STATE or Catastrophic failure at distro launch typically indicates the utility VM is stuck. wsl --shutdown then restart; if it persists, Get-Service LxssManager | Restart-Service. For a stubborn case, wsl --unregister <distro> is destructive but decisive — export first with wsl --export <distro> D:\backup.tar.

Memory: The Default Is Greedy

By default WSL2 claims up to 50 percent of total host RAM for its utility VM, and it does not always give it back promptly. On an 8 GB VPS that means 4 GB you can no longer rely on for IIS, SQL Server Express or an RDS session — and the Windows kernel does not see it as available. When the host starts paging, everything slows down and the cause is invisible in Task Manager’s main view.

Cap it in %UserProfile%\.wslconfig:

[wsl2]
memory=3GB
processors=2
swap=2GB
localhostForwarding=true

Apply with wsl --shutdown and confirm inside the distro with free -h and nproc. A sensible rule for a shared VPS: leave at least 2 GB for the Windows side above what your Windows workloads need, and never allocate more than half of installed RAM to WSL. For a 4 GB instance running only developer tools, 2 GB in WSL is the ceiling before the host becomes unstable.

Swap is a separate file (%LOCALAPPDATA%\Temp\swap.vhdx by default) sitting on the system disk. On a VPS with modest storage this file grows silently. Get-ChildItem -Recurse $env:LOCALAPPDATA\Temp -Filter *.vhdx shows the damage; keep swap small or set it to zero when the workload is bursty and stateless.

Disk, Filesystem and Cross-Boundary Performance

Distros live in an ext4 VHDX under %LOCALAPPDATA%\Packages\...\LocalState. Files accessed across the boundary — Windows paths mounted at /mnt/c — go through a 9P filesystem bridge and are dramatically slower than native ext4. Building a Node or .NET project with node_modules on /mnt/c can be five to ten times slower than the same project inside the Linux filesystem. Keep repositories in ~/, not on the Windows drive.

Growth is unbounded by default in recent WSL versions but older images are sparse files that never shrink. wsl --manage <distro> --set-sparse true helps; otherwise compact with Optimize-VHD -Path <vhdx> -Mode Full after a wsl --shutdown.

Nested Hyper-V Inside WSL2

Running Docker inside WSL2 works because Docker Desktop uses a separate hidden distro. Running full Hyper-V VMs inside WSL2 does not — WSL2’s kernel is a Microsoft-built kernel without the Hyper-V role, and nested virtualisation inside the utility VM is not supported. If you need containers, use Docker inside WSL; if you need Windows VMs, use the host’s Hyper-V role, which is already enabled.

That is also why WSL2 and Hyper-V VMs compete for the same resource: both are guests of the same root hypervisor. A VPS running three Hyper-V test VMs and a WSL2 distro is really running four VMs’ worth of memory pressure on one host. Plan the total, not the individual pieces.

When a VPS Is the Wrong Place for WSL2

If your provider does not expose nested virtualisation, no configuration will fix it, and a Linux VPS with SSH or a separate container host is the honest answer. If you only need a Linux shell for scripting or building a Go binary, the same result comes from a cheap Linux instance alongside the Windows one, without the hypervisor overhead.

Where WSL2 on a Windows VPS does earn its keep is a single-box development environment: Visual Studio on Windows, the build and test toolchain in Ubuntu, and no second machine to manage. For that, start from 8 GB RAM and 4 vCPU and set the .wslconfig cap before the first distro launch. Our Windows VPS guides cover provisioning choices; pick the instance with the memory headroom, because WSL2 will find every spare megabyte.

Leave a Comment