Cloning a physical installation of Endeavouros to a virtual machine

Hey Folks,

I am trying to clone my physical installation of Endeavouros into a virtual machine. I thought the task would be relatively simple, but so far I have been unsuccessful.

The reason I want to copy my install to a virtual machine is so that I can try some different configs without risking my physical installation.

Anyway I have tried a couple different ways without success:

1- Over on my windows install, I used terabyte image for windows to image my linux partition. Terabyte has built-in support for virtual disk files. So, when I went to restore the image I’d created, I selected my virtual disk file as the destination to restore my image to. I let the process complete, then started up virtual box, but Endeavouros didn’t boot. I tried booting a live instance of Endeavouros into the virtual machine, and used chroot to reinstall grub, but still, no boot.

2- On windows, I created a virtual disk file with virtualbox. I then mounted the virtual disk file using windows disk management, and assigned a drive letter. I then selected that drive as destination to restore the image file of Endeavouros that I’d created. The restore completed, but again, the system didn’t boot in virtualbox.

I would have though that either of these methods would have resulted in a working virtual machine of Endeavouros.

Can anyone advise me as to how to go about this, so that I can get a working copy of my existing installation of Endeavouros into a virtual machine?

Advice appreciated

What is the size of the partition of EOS and what is the size of the virtual disk you created ?

Hi elio -
I made sure to create the virtual hard drive a little larger than the space required for the image restore, so that shouldn’t be an issue
thanks

Perhaps you need to adjust the fstab in your cloned disk?

https://wiki.archlinux.org/title/Moving_an_existing_install_into_(or_out_of)_a_virtual_machine#Adjust_the_fstab_2

At any rate, you might want to study the method described in the Wiki article and see if using that would get you to where you want to be.

2 Likes

Overall you need to

  • check UEFI vs. BIOS legacy boot method of the existing system and create the VM accordingly (but it should be possible to change the booting method in VM to your liking)
  • copy the existing system to the VM
  • make it boot with arch-chroot
    • edit /etc/fstab according to what e.g. lsblk -f shows
    • run grub-install with proper parameters
    • run grub-mkconfig with proper parameters
  • change some drivers, especially the GPU drivers
1 Like

Well I got it working, apparently I had done the partition backup, and the restore to the virtual disk correctly.
It’s that I had to chroot into the virtual machine from a live session and correct a couple parameters.

Now that I see how it’s done, I can say that it’s a straightforward and fairly easy process.

Thanks for the help folks :wink:

1 Like

Would you mind sharing what you needed to change in rder to getting it to work for future reference in case other users will stumble upon the same issue?

2 Likes

pebcak - no problem -

I attached the endeavouros iso to the virtual machine and booted it up. Once in a live session I chrooted into the system and reinstalled grub.

Then I re-generated the initramfs image:
from the arch wiki: Re-generate the initramfs image:
Because the hardware has changed, while you are still in the chroot, re-generate the initramfs image and do a proper shutdown:

mkinitcpio -p linux
exit
umount -R /mnt
poweroff

The mkinitcpio -p linux command did a few things which I think included a system file check.
Anyway after that, the system booted normally and is working fine.

I had to go into system settings and manually adjust the screen resolution, to get a fullscreen display in the vm, no big deal.

So far as I can tell, that’s about it, I accomplished my goal

Thanks for the help :wink:

3 Likes

That sound’s great! Glad you got it working and thanks for sharing how to!
:enos_flag: :handshake:t5:

1 Like

So if I understood correctly, the process starts with creating a Kinuxos blank virtual machine and then plugging the EndeavorOS live cd into it. Then you take the actions you described. Could it all be that simple? This thread is very remarkable, I will follow it. Once upon a time, Windows could be converted into a virtual machine.