Skip to content

wsl --import writes shortcut.ico path with \\?\ in json fragment and makes Windows Terminal fail #13064

@crramirez

Description

@crramirez

Windows Version

Microsoft Windows [Version 10.0.26100.4061]

WSL Version

2.5.7.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

6.6.87.1-1

Distro Version

Ubuntu 24.04.2 LTS

Other Software

No response

Repro Steps

  1. Install a new architecture enabled distro: wsl --install -d Ubuntu
  2. Export it: wsl --export Ubuntu ubuntu.wsl
  3. Import it as another one: wsl --import Ubuntu2 C:\Users\hcram\WSLDistros\Ubuntu2 .\ubuntu.wsl
  4. Open Windows Terminal and Open the menu

Expected Behavior

The icon is shown in the menu for the new distro and no error is displayed

Actual Behavior

  1. Windows Terminal shows an error: Found a profile with an invalid "icon". Defaulting that profile to have no icon.
    Make sure that when setting an "icon", the value is a valid file path to an image.
  2. The icon is not shown in the menu.

But if you do the same with --install it works perfectly fine: wsl --install --name Ubuntu2 --location C:\Users\hcram\WSLDistros\Ubuntu2 --from-file .\ubuntu.wsl

Screenshots:

Image

Image

Image

Diagnostic Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions