0

I have a disk which used to run on another computer: it hosts an Arch Linux and a Debian which the computer could boot natively. The disk is connected to my computer via USB (it's /dev/sda).

I'd like to boot such disks in a Virtual Machine. I'd like to see the bootloader installed on that disk (GRUB 2, on UEFI), and use it to choose to start either Arch or Debian.

How can I do this?

I'd prefer to do via qemu, preferably using virt-manager. But I'm open to other options too.

1

1 Answer 1

1

I have literally done this operation with clonezilla (https://clonezilla.org).

Steps:

  • Create a bootable clonezilla (whatever USB, CD, DVD).
  • Boot it, and use it to clone the disk you have.
  • Create a VM in your VM software and boot clonezilla again (e.g. in qemu, when you create a new VM, tell it to boot clonezilla).
  • Boot into Clonezilla
  • Instruct Clonezilla to restore the clone to the VM "disk"
  • Boot again, but remove the "boot the VM into clonezilla", just boot the cloned image.

Note that "disks" does not matter, if you want the "disk" to be the USB attached drive you mention, you will just need to ensure that stays at the same mount point (that is another discussion). If you want the "disk" to be some image on your PC, choose that. When I say "disk" here, I mean the VM image.

Again, if you take your time, this is kind of straightforward (clone your disk, create a VM, restore the disk to your VM).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.