Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Joe Jackman

Can you Side load your Linux distro from your HDD using WSL2

On 6/16/2020 at 6:36 PM, Joe Jackman said:

 

Basically i don't wanna do all my Configure from the beginning and i really don't wanna delete (dual booting) it to make way.

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.

 

 

slack.png

Recommended Posts

Posted · Original PosterOP

What is Windows Subsystem for Linux (WSL and WSL2)? -- Linux in ... 

Basically i don't wanna do all my Configure from the beginning and i really don't wanna delete (dual booting) it to make way.

Link to post
Share on other sites

No. You can do that with a virtual machine though.


...is there a question here? 🤔

sudo chmod -R 000 /*

What is scaling and how does it work? Asus PB287Q unboxing! Console alternatives :D Watch Netflix with Kodi on Arch Linux Sharing folders over the internet using SSH Beginner's Guide To LTT (by iamdarkyoshi)

Sauron'stm Product Scores:

Spoiler

Just a list of my personal scores for some products, in no particular order, with brief comments. I just got the idea to do them so they aren't many for now :)

Don't take these as complete reviews or final truths - they are just my personal impressions on products I may or may not have used, summed up in a couple of sentences and a rough score. All scores take into account the unit's price and time of release, heavily so, therefore don't expect absolute performance to be reflected here.

 

-Lenovo Thinkpad X220 - [8/10]

Spoiler

A durable and reliable machine that is relatively lightweight, has all the hardware it needs to never feel sluggish and has a great IPS matte screen. Downsides are mostly due to its age, most notably the screen resolution of 1366x768 and usb 2.0 ports.

 

-Apple Macbook (2015) - [Garbage -/10]

Spoiler

From my perspective, this product has no redeeming factors given its price and the competition. It is underpowered, overpriced, impractical due to its single port and is made redundant even by Apple's own iPad pro line.

 

-OnePlus X - [7/10]

Spoiler

A good phone for the price. It does everything I (and most people) need without being sluggish and has no particularly bad flaws. The lack of recent software updates and relatively barebones feature kit (most notably the lack of 5GHz wifi, biometric sensors and backlight for the capacitive buttons) prevent it from being exceptional.

 

-Microsoft Surface Book 2 - [Garbage - -/10]

Spoiler

Overpriced and rushed, offers nothing notable compared to the competition, doesn't come with an adequate charger despite the premium price. Worse than the Macbook for not even offering the small plus sides of having macOS. Buy a Razer Blade if you want high performance in a (relatively) light package.

 

-Intel Core i7 2600/k - [9/10]

Spoiler

Quite possibly Intel's best product launch ever. It had all the bleeding edge features of the time, it came with a very significant performance improvement over its predecessor and it had a soldered heatspreader, allowing for efficient cooling and great overclocking. Even the "locked" version could be overclocked through the multiplier within (quite reasonable) limits.

 

-Apple iPad Pro - [5/10]

Spoiler

A pretty good product, sunk by its price (plus the extra cost of the physical keyboard and the pencil). Buy it if you don't mind the Apple tax and are looking for a very light office machine with an excellent digitizer. Particularly good for rich students. Bad for cheap tinkerers like myself.

 

 

Link to post
Share on other sites
Posted · Original PosterOP
7 minutes ago, Sauron said:

No. You can do that with a virtual machine though.

oh that would work too, my work is very minimal tbh. guess VM can do the trick.

Link to post
Share on other sites
Posted · Original PosterOP
15 hours ago, Sauron said:

No. You can do that with a virtual machine though.

Can you tell me how to though, i really cannot find any tutorials to do that.

 

Link to post
Share on other sites
2 hours ago, Joe Jackman said:

Can you tell me how to though, i really cannot find any tutorials to do that.

 

https://www.serverwatch.com/server-tutorials/using-a-physical-hard-drive-with-a-virtualbox-vm.html

 

If you already have a Linux installation you can literally just point VirtualBox to that hard drive and it will boot.


...is there a question here? 🤔

sudo chmod -R 000 /*

What is scaling and how does it work? Asus PB287Q unboxing! Console alternatives :D Watch Netflix with Kodi on Arch Linux Sharing folders over the internet using SSH Beginner's Guide To LTT (by iamdarkyoshi)

Sauron'stm Product Scores:

Spoiler

Just a list of my personal scores for some products, in no particular order, with brief comments. I just got the idea to do them so they aren't many for now :)

Don't take these as complete reviews or final truths - they are just my personal impressions on products I may or may not have used, summed up in a couple of sentences and a rough score. All scores take into account the unit's price and time of release, heavily so, therefore don't expect absolute performance to be reflected here.

 

-Lenovo Thinkpad X220 - [8/10]

Spoiler

A durable and reliable machine that is relatively lightweight, has all the hardware it needs to never feel sluggish and has a great IPS matte screen. Downsides are mostly due to its age, most notably the screen resolution of 1366x768 and usb 2.0 ports.

 

-Apple Macbook (2015) - [Garbage -/10]

Spoiler

From my perspective, this product has no redeeming factors given its price and the competition. It is underpowered, overpriced, impractical due to its single port and is made redundant even by Apple's own iPad pro line.

 

-OnePlus X - [7/10]

Spoiler

A good phone for the price. It does everything I (and most people) need without being sluggish and has no particularly bad flaws. The lack of recent software updates and relatively barebones feature kit (most notably the lack of 5GHz wifi, biometric sensors and backlight for the capacitive buttons) prevent it from being exceptional.

 

-Microsoft Surface Book 2 - [Garbage - -/10]

Spoiler

Overpriced and rushed, offers nothing notable compared to the competition, doesn't come with an adequate charger despite the premium price. Worse than the Macbook for not even offering the small plus sides of having macOS. Buy a Razer Blade if you want high performance in a (relatively) light package.

 

-Intel Core i7 2600/k - [9/10]

Spoiler

Quite possibly Intel's best product launch ever. It had all the bleeding edge features of the time, it came with a very significant performance improvement over its predecessor and it had a soldered heatspreader, allowing for efficient cooling and great overclocking. Even the "locked" version could be overclocked through the multiplier within (quite reasonable) limits.

 

-Apple iPad Pro - [5/10]

Spoiler

A pretty good product, sunk by its price (plus the extra cost of the physical keyboard and the pencil). Buy it if you don't mind the Apple tax and are looking for a very light office machine with an excellent digitizer. Particularly good for rich students. Bad for cheap tinkerers like myself.

 

 

Link to post
Share on other sites

But who in their right mind would want to do that? Running Win-OS as a VM on a Linux machine is industry-wide accepted as a much more stable solution.

 

Having said that, each use-case is different, really. So, YMMV!


"You don't need eyes to see, you need vision"

 

(Faithless, 'Reverence' from the 1996 Reverence album)

Link to post
Share on other sites
Posted · Original PosterOP
10 hours ago, Sauron said:

https://www.serverwatch.com/server-tutorials/using-a-physical-hard-drive-with-a-virtualbox-vm.html

 

If you already have a Linux installation you can literally just point VirtualBox to that hard drive and it will boot.

my home is in extHDD and root in my SSD(and also windows).. "Warning: Do not attempt to mount or boot the partition that runs the host OS with a VM, as that can lead to severe data corruption. And no matter which drive or partition you want to mount, it's always a good idea to back up any existing data on it before continuing." is it saying i shouldnt mount windows while running windows or u cant mount partition that has another OS on the same drive but on a different partition.

 

Link to post
Share on other sites
22 minutes ago, Joe Jackman said:

my home is in extHDD and root in my SSD(and also windows).. "Warning: Do not attempt to mount or boot the partition that runs the host OS with a VM, as that can lead to severe data corruption. And no matter which drive or partition you want to mount, it's always a good idea to back up any existing data on it before continuing." is it saying i shouldnt mount windows while running windows or u cant mount partition that has another OS on the same drive but on a different partition.

That's a problem... obviously you can't pass the entire drive to the VM if Windows is also running off of it... either install Linux on a second drive or run a normal virtual machine.


...is there a question here? 🤔

sudo chmod -R 000 /*

What is scaling and how does it work? Asus PB287Q unboxing! Console alternatives :D Watch Netflix with Kodi on Arch Linux Sharing folders over the internet using SSH Beginner's Guide To LTT (by iamdarkyoshi)

Sauron'stm Product Scores:

Spoiler

Just a list of my personal scores for some products, in no particular order, with brief comments. I just got the idea to do them so they aren't many for now :)

Don't take these as complete reviews or final truths - they are just my personal impressions on products I may or may not have used, summed up in a couple of sentences and a rough score. All scores take into account the unit's price and time of release, heavily so, therefore don't expect absolute performance to be reflected here.

 

-Lenovo Thinkpad X220 - [8/10]

Spoiler

A durable and reliable machine that is relatively lightweight, has all the hardware it needs to never feel sluggish and has a great IPS matte screen. Downsides are mostly due to its age, most notably the screen resolution of 1366x768 and usb 2.0 ports.

 

-Apple Macbook (2015) - [Garbage -/10]

Spoiler

From my perspective, this product has no redeeming factors given its price and the competition. It is underpowered, overpriced, impractical due to its single port and is made redundant even by Apple's own iPad pro line.

 

-OnePlus X - [7/10]

Spoiler

A good phone for the price. It does everything I (and most people) need without being sluggish and has no particularly bad flaws. The lack of recent software updates and relatively barebones feature kit (most notably the lack of 5GHz wifi, biometric sensors and backlight for the capacitive buttons) prevent it from being exceptional.

 

-Microsoft Surface Book 2 - [Garbage - -/10]

Spoiler

Overpriced and rushed, offers nothing notable compared to the competition, doesn't come with an adequate charger despite the premium price. Worse than the Macbook for not even offering the small plus sides of having macOS. Buy a Razer Blade if you want high performance in a (relatively) light package.

 

-Intel Core i7 2600/k - [9/10]

Spoiler

Quite possibly Intel's best product launch ever. It had all the bleeding edge features of the time, it came with a very significant performance improvement over its predecessor and it had a soldered heatspreader, allowing for efficient cooling and great overclocking. Even the "locked" version could be overclocked through the multiplier within (quite reasonable) limits.

 

-Apple iPad Pro - [5/10]

Spoiler

A pretty good product, sunk by its price (plus the extra cost of the physical keyboard and the pencil). Buy it if you don't mind the Apple tax and are looking for a very light office machine with an excellent digitizer. Particularly good for rich students. Bad for cheap tinkerers like myself.

 

 

Link to post
Share on other sites
Posted · Best Answer
On 6/16/2020 at 6:36 PM, Joe Jackman said:

 

Basically i don't wanna do all my Configure from the beginning and i really don't wanna delete (dual booting) it to make way.

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.

 

 

slack.png


Tech, motorcycles, photography.

www.sport-touring.eu | gallery.sport-touring.eu

Link to post
Share on other sites

I can actually now confirm above procedure works, as I found it interesting enough to try and test my hypophysis. :)

 

What I did:

1) installed Deepin Linux distribution from ISO in a virtual machine. I used Hyper-V, but it can be any or it can be installed on the physical machine.

2) after installation and initial configuration, dumped the entire system into a tar file like above. Due to the specifics of Deeping I had to include /run and /media in the excluded directories. Make sure you have enoug space to store the file on the location you are saving too. It can get quite big, depending on the size of your system.

3) ran the WSL --import with the resulting tar file from the previous step

4) fired up wsl with a fully configured and working version of Deepin Linux 

 

Including the base install of the system, the whole process took less than 30 minutes to complete. So whether you want a Linux distribution that's not available in the MS Store, you have a VM you want to run in WSL instead or even a complete running system, this is a very quick and easy way to being able to run those inside WSL and not having to dual boot to access or use certain tools/files or have the overhead of a full-blown VM.

 

Obviously the architecture needs to match. This before anyone tries to dump his Raspberry Pi install into a tar file and attempts to run it in WSL on an x86 PC. :P 


Tech, motorcycles, photography.

www.sport-touring.eu | gallery.sport-touring.eu

Link to post
Share on other sites
Posted · Original PosterOP
On 9/3/2020 at 3:12 PM, throttlemeister said:

I can actually now confirm above procedure works, as I found it interesting enough to try and test my hypophysis. :)

 

What I did:

1) installed Deepin Linux distribution from ISO in a virtual machine. I used Hyper-V, but it can be any or it can be installed on the physical machine.

2) after installation and initial configuration, dumped the entire system into a tar file like above. Due to the specifics of Deeping I had to include /run and /media in the excluded directories. Make sure you have enoug space to store the file on the location you are saving too. It can get quite big, depending on the size of your system.

3) ran the WSL --import with the resulting tar file from the previous step

4) fired up wsl with a fully configured and working version of Deepin Linux 

 

Including the base install of the system, the whole process took less than 30 minutes to complete. So whether you want a Linux distribution that's not available in the MS Store, you have a VM you want to run in WSL instead or even a complete running system, this is a very quick and easy way to being able to run those inside WSL and not having to dual boot to access or use certain tools/files or have the overhead of a full-blown VM.

 

Obviously the architecture needs to match. This before anyone tries to dump his Raspberry Pi install into a tar file and attempts to run it in WSL on an x86 PC. :P 

Bro i am really sorry that i didnt check in LTTf , DUDE this is soo awesome. I really love Linux and main it actually and would prefer over windows anyday. I logged in today just to ask for a laptop under 350$ (linux friendly i mean) and i found another Gem in the Linux community. Love you man, will try this.

Link to post
Share on other sites
Posted · Original PosterOP
On 8/19/2020 at 4:28 PM, throttlemeister said:

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.

 

 

slack.png

also this should back up the home dir right?

 tar -cpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys /

so my home partition in the exHDD is not a problem here.

Link to post
Share on other sites

Yes, anything that is mounted and not explicitly excluded with the --exclude= statement will be included in the tar archive, wether is on an internal disk, external disk, or network. If it is mounted, accessible on the filesystem, it will include it. This can be good, or bad so pay attention to what you need and what you do not need. :)


Tech, motorcycles, photography.

www.sport-touring.eu | gallery.sport-touring.eu

Link to post
Share on other sites
Posted · Original PosterOP
15 minutes ago, throttlemeister said:

Yes, anything that is mounted and not explicitly excluded with the --exclude= statement will be included in the tar archive, wether is on an internal disk, external disk, or network. If it is mounted, accessible on the filesystem, it will include it. This can be good, or bad so pay attention to what you need and what you do not need. :)

i guess so, Honestly the only thing that holding me from nuking windows is valorant and LoL, and a renaming tool called Bulk rename Utility. so idk if this will even be needed but nothing wrng with gaining abit of knowledge.

Link to post
Share on other sites
On 9/10/2020 at 4:23 PM, Joe Jackman said:

i guess so, Honestly the only thing that holding me from nuking windows is valorant and LoL, and a renaming tool called Bulk rename Utility. so idk if this will even be needed but nothing wrng with gaining abit of knowledge.

That's very much true. Never stop learning. That said, I am an old UNIX guy and I run Windows. In the end it is just a GUI and a means to run the software you want to use. They're all good, they're all stable these days. Objectively, there is no good or bad just personal preference. And Windows lets me run all the software I want to use, while Linux doesn't. But! Having Linux inside my Windows through WSL let's me fall back to the commandline and do certain things faster and easier because I am so used to them there that it really gives me best of both worlds. And by using X410 I can even use the GUI software froim Linux if I want to.


Tech, motorcycles, photography.

www.sport-touring.eu | gallery.sport-touring.eu

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×