WSL icon indicating copy to clipboard operation
WSL copied to clipboard

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

Open crramirez opened this issue 6 months ago • 2 comments

Windows Version

Microsoft Windows [Version 10.0.26100.4061]

WSL Version

2.5.7.0

Are you using WSL 1 or WSL 2?

  • [x] 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

crramirez avatar Jun 06 '25 16:06 crramirez

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

github-actions[bot] avatar Jun 06 '25 16:06 github-actions[bot]

Thank you @crramirez. I created #13080 to fix this issue.

Tagging @DHowett so he can fix this from the Terminal side.

OneBlue avatar Jun 09 '25 23:06 OneBlue

Fixed in 2.6.0

OneBlue avatar Jun 20 '25 19:06 OneBlue