Skip to content

wsl --unregister Triggers Unhandled Exception in v2.4+ #13004

@qkflies

Description

@qkflies

Windows Version

10.0.26100.4351

WSL Version

2.4.10.0, 2.5.7.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.167.4-1, 6.6.87.1-1

Distro Version

Ubuntu 24.04.2 LTS (Noble Numbat) - Canonical WSL root filesystem image

Other Software

FSLogix 2210 hotfix 4 (2.9.8884.27471)

Repro Steps

Assume FSLogix profiles are in use.

  1. Register distribution with vhd location in FSLogix local profile:

    wsl --import Ubuntu-24.04 "$(Join-Path -Path $(Join-Path -Path $($(Get-ChildItem HKCU:\Software\FSLogix\Profiles\).GetValue('LocalProfilePath')) -ChildPath Temp) -ChildPath Ubuntu-24.04)" "C:\WSL\ubuntu2404.tar.gz" --version 2
    
  2. Sign out, then sign back in.

    • Note: This removes the local FSLogix profile, which then is recreated at next sign in.
  3. Attempt to unregister the distribution:

    wsl --unregister Ubuntu-24.04
    

Expected Behavior

The unregister command completes successfully.

Actual Behavior

The unregister command returns the following error:

{Application Error} The exception %s (0x
Error code: Wsl/Service/ERROR_UNHANDLED_EXCEPTION

This is only encountered after the full sign out/sign in cycle, which raises suspicion about the unregister command not liking the disappearance of the VHD from the local profile path.

Diagnostic Logs

Logs will be submitted directly to Microsoft via email.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions