Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsl --import/--export does not handle paths with spaces or quoted paths correctly #3932

Closed
0xbadfca11 opened this issue Mar 22, 2019 · 6 comments
Assignees

Comments

@0xbadfca11
Copy link

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.18362.1]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

C:\Users\JohnDoe> wsl --export Ubuntu "Ubuntu.tar"
The filename, directory name, or volume label syntax is incorrect.

image

C:\Users\JohnDoe> wsl --import Ubuntwo C:\Ubuntu "C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2018.817.0_x64__79rhkp1fndgsc\install.tar.gz"
The filename, directory name, or volume label syntax is incorrect.

image

  • What's wrong / what should be happening instead:
    Both file paths should be treated correctly.
@0xbadfca11
Copy link
Author

  • Workaround
    Use stdin/stdout.
> wsl --import Ubuntwo C:\Ubuntu - < "C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2018.817.0_x64__79rhkp1fndgsc\install.tar.gz"

@benhillis
Copy link
Member

Good find, I'll sort this out.

@benhillis benhillis added the bug label Mar 28, 2019
@benhillis benhillis self-assigned this Mar 28, 2019
@Brian-Perkins
Copy link

Fixed in Windows Insider Build 18890

@jarmo
Copy link

jarmo commented Nov 30, 2019

My Windows version is 10.0.18362.476.

I have the same problem - I cannot even export.

wsl -l shows:

Legacy (Default)

Trying to export it:

wsl --export "Legacy (Default)" ubuntu.tar

Shows me the exact same error as above:

The filename, directory name, or volume label syntax is incorrect.

I tried to pipe it directly to file like this:

wsl --export "Legacy (Default)" > ubuntu.tar

ubuntu.tar will include the exact same error message.

I suspect that the problem is with the distribution name (Legacy (Default)) itself. Can I rename distribution somehow to test it out? How would I solve this problem with a workaround?

@jarmo
Copy link

jarmo commented Nov 30, 2019

Forgot to mention - I tried different working directories without having any positive effect.

@jarmo
Copy link

jarmo commented Nov 30, 2019

After upgrading Windows to 10.0.19033.1 via Insider Program I managed to export like this:

wsl --export "Legacy" ubuntu.tar

Note, that I had to omit " (Default)". I also tried that with the previous version and got an error message that Distribution with the name "Legacy" was not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants