Yes, you can load your Linux distribution from an HDD via WSL2.
Yes, you can load your Linux distribution from an HDD via WSL2.
I prefer skipping the initial setup and avoiding dual-booting to save space.
That would also be fine, my work is quite simple. I think VM should handle it.
With a Linux setup, you can simply connect VirtualBox to the physical hard drive and it will start up.
Actually, you can (I think). On your Linux system: $ sudo su - # cd / # tar -cpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys / Then copy the backup.tar.gz to your windows system. Now, here's the thing I am not entirely sure. I know for a fact you can import this file into a docker container and run it. I also know for a fact you can export a docker container and sideload it as a distribution into WSL2. So my assumption is you can import this directly into WSL2 as well. gunzip the file so you end up with the file backup.tar (you can also omit the z flag in the tar command above, but you will end up with a huge file to move around) Then open a CMD window and issue: wsl --import "<Your_Distro_Name>" "<Location_to_store_your_Distro>" "PATH/TO/<archive.tar>" --version 2 This _should_ work. If it doesn't, the quick solution would be to import the tar.gz into a new Docker container, en then export it from Docker so you can then import the resulting file into WSL2. Hope this helps. I have no tested this, but I have used Docker exports to create and sideload my own Slackware distribution for WSL2 that is not available otherwise.
I can verify the procedure now, as I found it intriguing enough to experiment with. What I did: 1) set up the Deepin Linux distribution from an ISO inside a virtual machine. I used Hyper-V, though any host could work. 2) once installed and set up, I exported the entire system as a tar archive. Because of Deepin’s specifics, I excluded /run and /media. Ensure you have sufficient space at the target location—files can grow large depending on your system. 3) executed WSL --import with the resulting archive. 4) launched WSL using a fully set-up Deepin installation, including its base setup. The whole process finished in under 30 minutes. This method offers a fast way to run Linux distributions unavailable on the MS Store, whether you need a VM in WSL or a complete running system. Just make sure the architecture matches. Avoid trying to package a Raspberry Pi install into a tar file and run it in WSL on an x86 machine.