Skip to content

Quoted distribution name leads to Wsl/Service/E_INVALIDARG #9859

@vault-thirteen

Description

@vault-thirteen

Windows Version

Microsoft Windows [Version 10.0.19045.2728]

WSL Version

1.1.3.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.90.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Jan 27 02:56:13 UTC 2023

Distro Version

Debian GNU/Linux 11 (bullseye)

Other Software

No response

Repro Steps

  1. Export the VM to a tar file.

wsl --export Debian "J:\WSL\ISO\Debian\wsl-debian-11.tar"

  1. Unregister the distribution.

wsl --unregister Debian

  1. Import the distribution, specifying its name with double quotes:

wsl --import "Debian 11" "J:\WSL\VM\Debian\wsl-debian" "J:\WSL\ISO\Debian\wsl-debian-11.tar"

An error occurs:

J:\WSL>wsl --import "Debian 11" "J:\WSL\VM\Debian\wsl-debian" "J:\WSL\ISO\Debian\wsl-debian-11.tar"
Import in progress, this may take a few minutes.
The parameter is incorrect.
Error code: Wsl/Service/E_INVALIDARG

When importing and specifying distro name without double quotes, it works fine.

J:\WSL>wsl --import Debian "J:\WSL\VM\Debian\wsl-debian" "J:\WSL\ISO\Debian\wsl-debian-11.tar"
Import in progress, this may take a few minutes.
The operation completed successfully.

Expected Behavior

I expect to be able to use distribution names having a space in them and specifying disto name inside double quotes.
For example, I expect to be able to specify a distro name as:

"Debian"

or

"Debian 11"

Actual Behavior

J:\WSL>wsl --import "Debian 11" "J:\WSL\VM\Debian\wsl-debian" "J:\WSL\ISO\Debian\wsl-debian-11.tar"
Import in progress, this may take a few minutes.
The parameter is incorrect.
Error code: Wsl/Service/E_INVALIDARG

Diagnostic Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions