1

Ostensibly, wsl --import-in-place <Distribution Name> <FileName> is documented here:

Imports the specified .vhdx file as a new distribution. The virtual hard disk must be formatted in the ext4 filesystem type.

wsl --import <Distribution Name> <InstallLocation> <FileName> --vhd can already do that—the only difference I see is --import requires a <InstallLocation>.

What does wsl --import-in-place do (differently from --import)?

3
  • It allows you to use a vhdx file from say a Hyper-V VM and use it for a WSL instance. The description of the command, "Imports the specified .vhdx file as a new distribution.", clearly indicates the only requirement is that the virtual hdd must be formatted as ext4. wsl --import exist primaryly to import .tar files and WSL1 instances.
    – Ramhound
    Commented Jan 26 at 2:02
  • @Ramhound Let me see if I'm understanding you correctly. --import is supposed to accept the output of --export; --import-in-place accepts non-WSL Virtual Machines (too?)? Commented Jan 26 at 2:22
  • The documentation says it does provided its formatted as EXT4.
    – Ramhound
    Commented Jan 26 at 5:10

1 Answer 1

1

When you import a distro, WSL copies the drive to InstallLocation/ext4.vhdx. This might cause conflicts if this file already exists.

To avoid collisions, using import-in-place creates a new distro that will not conflict on the disk with any existing one.

2
  • So if I'm understanding this correctly, it's effectively --import but it 1) only accepts vhdx files and 2) sets <InstallLocation> for you? Commented Jan 27 at 4:03
  • 1
    Yes, it makes for a simpler interface and perhaps a unified storage scheme for all distributions. The specs say only for vhdx with ext4.
    – harrymc
    Commented Jan 27 at 8:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .