Clonezilla clone to VM magic
I am continuing to learn more about using QEMU and virt-manager rather than constantly trying to find a new tool. Late last year I learned about migrating virtual machines using virsh. This week I learned how to move an install on bare metal to a virtual machine, which is awesome and actually made me a little giddy.
For my birthday last year my wife got me an iKoolCore mini PC that I’ve used for various experiments. Recently I have been using it as a jump host (or bastion server) and a remote desktop for a 2013 Surface RT tablet running Raspberry Pi OS. But, I had to give that mini PC to my son as his primary workstation for school and I’ve been missing it.
I have a habit of using Clonezilla to routinely make copies of all my machines, especially before any major changes so I can revert back to a known working state. Before I gave the iKoolCore mini PC to my son I made a Clonezilla backup and put it in the archive in case I ever get that PC back.
Earlier today I realized I could probably use Clonezilla to clone that install to a VM on my homelab and then remote into that VM from any machine on my network. Sure enough, it works!
Here’s what I did:
- Created a new VM in
virt-managerwith the same CPU cores, RAM, and storage as the mini PC. - Set the image to boot as the Clonezilla ISO.
- In the advanced features, enabled EFI boot.
- Added USB passthrough so QEMU has access to my clones storage drive.
On first boot I used Clonezilla to restore an image to the vda storage files for the VM. After it was restored, I removed the USB passthrough and booted as normal.
It was as if the system had always been this way.
Works perfectly and is what I’ve used to write my last two blog posts.
Once again I am happy to be learning more about the existing tools available with long-standing development and support, rather than constantly hunting for something new. KVM, QEMU, virt-manager, and Clonezilla are frequently the best tools I have learned.
This process also has me thinking about creating a “museum” of past installs. I could make clones of machines I am going to retire and then create a VM of the install and put into my archive. Then it would be trivial to boot it into a VM at any time to walk through my past installs and machines to see how I used to do things.
- - - - -
Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.
🙏 😎
Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.