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

Pre-check: destination is not compressed #23

Open
1 of 3 tasks
Kage-Yami opened this issue Jan 19, 2021 · 8 comments
Open
1 of 3 tasks

Pre-check: destination is not compressed #23

Kage-Yami opened this issue Jan 19, 2021 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Kage-Yami
Copy link

Describe the bug
If the destination import directory is marked as "compressed", the import stage will fail due to .vhdx files not being compressable.

Please add terminal output if possible:

jdsmi@YAMI ❯ ~\dev\scripts ❯
❯ .\Move-WSL.ps1
Getting distros...
Select distro to move:
1: docker-desktop
2: Arch
3: docker-desktop-data
1
Enter WSL target directory:
F:\docker\
Move docker-desktop to "F:\docker"? (Y|n): Y
Exporting VHDX to "F:\docker\docker-desktop.tar" ...
Unregistering WSL ...
Importing docker-desktop from F:\docker...
The requested operation could not be completed due to a virtual disk system limitation.  Virtual hard disk files must be uncompressed and unencrypted and must not be sparse.
Write-Error: Import failed. Distro not found. Export file at F:\docker\docker-desktop.tar

Disabled compression on the destination folder.

⨯ jdsmi@YAMI ❯ ~\dev\scripts ❯
❯ wsl --import docker-desktop F:\docker F:\docker\docker-desktop.tar
jdsmi@YAMI ❯ ~\dev\scripts ❯
❯

Script version:

  • Bash
  • Powershell
  • Batch
@Kage-Yami Kage-Yami added the bug Something isn't working label Jan 19, 2021
@pxlrbt pxlrbt added good first issue Good for newcomers help wanted Extra attention is needed enhancement New feature or request and removed bug Something isn't working labels Feb 25, 2021
@sumodx
Copy link

sumodx commented Aug 10, 2021

Please upgrade severity, it wiped my WSL vhdx.

Repro:

  1. Select compressed folder as target
  2. Get Error as described above.
  3. At this stage the WSL distro is unregistered and the source vhdx has been remove
  4. Uncompress target folder (containing the tar)
  5. Run BAT script again
  6. Discover its deleted the tar file, and there is no source file (ref Step 3)

@pxlrbt
Copy link
Owner

pxlrbt commented Aug 11, 2021

  1. Run BAT script again
  2. Discover its deleted the tar file, and there is no source file (ref Step 3)

How did that tar file get removed? I'd expect the second run of the script to stop after exporting, since there is nothing to export anymore? 🤔 And in that case you should be able to manually import that .tar file.

Do you have any logs of the two runs?

@sumodx
Copy link

sumodx commented Aug 19, 2021

Sorry didnt see any logs :-( I just reported my sequence of actions.

Perhaps whenever you pick up this issue you could add to your tests to see if you get a repro?

gl

@SayakMukhopadhyay
Copy link
Collaborator

I just tried reproducing this issue but could not. The distro got imported from a folder marked compressed just fine. Can one of you explain what you mean by compressed folder? As for me, I just went ahead and checked this option.
image

@Kage-Yami
Copy link
Author

Kage-Yami commented Apr 18, 2022

@SayakMukhopadhyay:
I just tried reproducing this issue but could not. The distro got imported from a folder marked compressed just fine. Can one of you explain what you mean by compressed folder?

I have no idea if this is still an issue, as I don't use WSL at this time, but the issue is when the destination is compressed, not the source folder from which your import .tar is in.

From memory, the core of the problem is that if the destination folder is marked as compressed, then Windows attempts to compress the newly-created .vhdx file (the would-be post-move distro), which is not allowed.

@SayakMukhopadhyay
Copy link
Collaborator

the core of the problem is that if the destination folder is marked as compressed, then Windows attempts to compress the newly-created .vhdx file

Yeah, I verified and that seems to be the case but it imported just fine in my case.
image
I have also ran the distro and it worked just fine. Do you have any further ideas?

@Kage-Yami
Copy link
Author

@SayakMukhopadhyay
Do you have any further ideas?

Nothing off the top of my head, other than perhaps Microsoft has removed the limitation in Windows 11?

@SayakMukhopadhyay
Copy link
Collaborator

I found this issue microsoft/WSL#4103 but weirdly I still can't reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants