Skip to main content
Microsoftintermediate

WSL "Catastrophic failure" - Fix the E_UNEXPECTED Error Code

Fix the WSL "Catastrophic failure" error with code Wsl/Service/CreateInstance/CreateVm/HCS/E_UNEXPECTED. Check .wslconfig, restart the Hyper-V Host Compute Service, and repair virtualization features safely.

7 min readUpdated August 2026

Launching WSL and getting "Catastrophic failure" with error code Wsl/Service/CreateInstance/CreateVm/HCS/E_UNEXPECTED? The name is worse than the problem. Here is what it actually means and how to work through it.

The Error

Catastrophic failure
Error code: Wsl/Service/CreateInstance/CreateVm/HCS/E_UNEXPECTED

Read the error path from left to right, because it narrows things down considerably:

  • Wsl/Service - the WSL service was asked to do something
  • CreateInstance - specifically, to start a distribution
  • CreateVm - which required creating the underlying virtual machine
  • HCS - handled by the Host Compute Service
  • E_UNEXPECTED - a generic COM failure code meaning "something went wrong that I have no better name for"

The important part is that the failure happens at CreateVm - before your Linux distribution begins to boot. Your files, your packages and your distribution's state are not implicated. The problem is on the Windows virtualization side.


Quick Fix

From PowerShell:

wsl --shutdown

Wait ten seconds, then start WSL again. This is safe to run at any point and clears a surprising share of transient cases, especially after the host has resumed from sleep.

If that does not work, go through the fixes below in order - they are ordered by how often each turns out to be the cause.


Fix 1: Check .wslconfig for Invalid Values

This is the most common cause of E_UNEXPECTED specifically. WSL reads %USERPROFILE%\.wslconfig when it creates the virtual machine, and a malformed value stops creation dead.

Test it by renaming the file rather than deleting it. In Command Prompt:

ren %USERPROFILE%\.wslconfig .wslconfig.bak

Then:

wsl --shutdown
wsl

If WSL starts, the file was the problem. Open the backup and look for:

  • A memory value larger than the RAM the host actually has, or larger than Windows will surrender
  • Units written incorrectly - it must be 8GB or 8192MB, not 8 GB, 8g or 8
  • A processors value exceeding your logical CPU count
  • Smart quotes or a BOM introduced by pasting from a web page into Notepad
  • A setting placed outside the [wsl2] section header

A known-good minimal file looks like this:

[wsl2]
memory=8GB
processors=4
swap=2GB

Reintroduce settings one at a time and run wsl --shutdown between each so you know which one breaks it.


Fix 2: Restart the Host Compute Service

The HCS in the error path is the Hyper-V Host Compute Service. If it has wedged, WSL cannot create a virtual machine. In an elevated PowerShell:

wsl --shutdown
Restart-Service vmcompute
wsl

If the service will not start, check its state and its dependencies:

Get-Service vmcompute, LxssManager, HvHost | Format-Table Name, Status, StartType

All three should be able to start. LxssManager is the WSL service itself; HvHost is the Hyper-V host service.


Advertisement

Fix 3: Confirm the Virtualization Features Are Enabled

WSL 2 needs two Windows optional features. In an elevated PowerShell:

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

Then reboot. Skipping the reboot is a common reason people conclude this fix "did not work".

Also confirm the hypervisor is set to launch at boot:

bcdedit /enum | Select-String hypervisorlaunchtype

If it reports Off, turn it back on and reboot:

bcdedit /set hypervisorlaunchtype auto

Off is not a default - something set it, usually an older debugging session, an anti-cheat installer, or a guide about improving game performance. Turning it back on restores WSL 2, Windows Sandbox and Hyper-V together.

Finally, check the firmware level. Open Task Manager, go to Performance > CPU, and look for Virtualization. If it reads Disabled, enable Intel VT-x or AMD-V (often labelled SVM Mode) in your BIOS or UEFI setup.


Fix 4: Update WSL

Several E_UNEXPECTED conditions have been fixed in WSL releases, particularly around interactions with Windows feature updates.

wsl --update
wsl --shutdown

If the update is blocked because the Microsoft Store is unavailable on a managed machine:

wsl --update --web-download

Confirm what you ended up with:

wsl --version

Fix 5: Check for a Conflicting Hypervisor

Older releases of VirtualBox and VMware Workstation claimed exclusive use of the CPU's virtualization extensions, which left nothing for the Windows hypervisor and broke WSL 2. Current versions - VirtualBox 7.x and VMware Workstation 17 - run on top of the Windows hypervisor platform and coexist without trouble.

If you are on an older release, updating is the fix. Uninstalling is not necessary and rarely the real solution.


Last Resort: Re-register the Distribution

Only if everything above has failed and you suspect the distribution's virtual disk is corrupt.

Back it up first. wsl --unregister permanently deletes the distribution's entire filesystem, and there is no undo:

wsl --export Ubuntu C:\backup\ubuntu.tar

Then:

wsl --unregister Ubuntu
wsl --import Ubuntu C:\wsl\Ubuntu C:\backup\ubuntu.tar

After an import, the distribution starts as root rather than your normal user. Set the default back:

ubuntu config --default-user yourusername

Verify the Fix

# WSL version and kernel
wsl --version

# Installed distributions and their state
wsl -l -v

Expected output from wsl -l -v:

  NAME      STATE           VERSION
* Ubuntu    Running         2

Then confirm the distribution actually works:

wsl -- uname -a

Prevention

  • Treat %USERPROFILE%\.wslconfig as code: change one setting at a time, and keep a known-good copy alongside it.
  • Leave headroom in the memory value. Allocating nearly all of the host's RAM to WSL is the setting most likely to produce a failure to create the virtual machine.
  • Run wsl --update periodically, and again after any Windows feature update.
  • Prefer wsl --shutdown over killing processes when WSL misbehaves; it releases the virtual machine cleanly.
  • Keep an export of any distribution you have invested configuration in. wsl --export takes a minute and makes the destructive fix survivable.

Summary

  1. First: wsl --shutdown, then start WSL again
  2. Most likely cause: rename %USERPROFILE%\.wslconfig and retest
  3. Service: Restart-Service vmcompute from an elevated prompt
  4. Features: enable VirtualMachinePlatform, confirm hypervisorlaunchtype auto, reboot
  5. Update: wsl --update
  6. Only with a backup: wsl --export before any wsl --unregister

Frequently Asked Questions

Find answers to common questions

Despite the alarming name, it is a generic Windows COM error (E_UNEXPECTED) passed up from the Host Compute Service when it could not create the WSL virtual machine. Your Linux files are almost never involved. The error path in the code - CreateInstance/CreateVm/HCS - tells you the failure happened before the distribution even started booting.

An invalid or malformed %USERPROFILE%.wslconfig file. A typo in a memory or processor value, a stray character, or a memory allocation larger than the host has available will all stop the virtual machine from being created, and the resulting error is this one.

Rename it rather than deleting it - 'ren %USERPROFILE%.wslconfig .wslconfig.bak' in Command Prompt - then run 'wsl --shutdown' and try again. If WSL starts, the file was at fault and you can reintroduce settings one at a time.

Not with any of the first five fixes; they all operate on host services and configuration. The only destructive command is 'wsl --unregister', which permanently deletes that distribution's entire filesystem. Export a backup before you consider it.

Sometimes. Check Task Manager, Performance tab, CPU - if "Virtualization" reads Disabled, you need to enable Intel VT-x or AMD-V in your firmware settings. But a machine where WSL previously worked and now fails is more likely to have a configuration or service problem than a firmware one.

In an elevated PowerShell, run 'Restart-Service vmcompute'. If WSL had been working earlier in the same Windows session and stopped, a wedged vmcompute service is a common explanation.

Not the full Hyper-V role, but WSL 2 does need the Virtual Machine Platform optional feature, which provides the same underlying hypervisor. Enabling it requires a reboot.

Older versions could, because they took exclusive control of the hardware virtualization extensions. Current VirtualBox 7.x and VMware Workstation 17 releases coexist with the Windows hypervisor, so update rather than uninstall if you hit this.

It terminates every running distribution and the shared WSL utility virtual machine, then releases the memory back to Windows. It is safe to run at any time, though unsaved work in a running distribution is lost.

Run 'wsl --export Ubuntu C:\backup\ubuntu.tar' from PowerShell. You can restore it later with 'wsl --import Ubuntu C:\wsl\Ubuntu C:\backup\ubuntu.tar'. Do this before any command that includes the word unregister.