Dear Lazyweb: Converting a dual boot partition to a virtual machine

I’m finding a lot of instructions for Windows and VMware, but none for KVM. My workstation has a Fedora 12 i686 install that I’ve been running for years. I decided that I should install an x86_64 OS so I put on RHEL6 and I’m planning on rebuilding my environment on that. What’s the best way to get my Fedora 12 logical volume booted as a virtual machine under RHEL6 with KVM? I was hoping to do this without having to do another install but I’m not so sure now.

Advertisements

3 Comments

  1. greg
    Posted December 23, 2010 at 11:33 am | Permalink

    I tried running a local windows install as either a KVM or VMware virtual in Fedora 14 and failed miserably (Windows just didn’t want to go forward.. I kept getting a BSOD). But in theory Linux should handle it a lot better. You should just need a file that looks something like this:

    systemname
    8405cc07-1119-e03c-e2f3-fe130cbb7832
    4194304
    4194304
    2

    hvm

    destroy
    restart
    restart

    /usr/libexec/qemu-kvm

    And then you would have to make sure that the devicemap and grub.conf know to point to the 2nd disk (in grub.conf i’d use the UUID i think). I haven’t tried it, but the theory should work.

    An an alternate would be to try and just pass in the single disk device and make sure that the virtual isn’t trying to access the live system’s drives, but that might be a bit more unsafe.

    I haven’t tried this with fedora as the guest, but like I said, got to the BSOD with Windows, so I’d hope Linux handles it better.

  2. greg
    Posted December 23, 2010 at 1:24 pm | Permalink

    hmm that didn’t paste in very well ;) basically it was just a standard libvirt xml file with the boot partition passed in as vda and the lvm pv(s) passed in as vdb (both using virtio).

    e-mail me if u want to discuss it.

  3. rich
    Posted December 23, 2010 at 3:11 pm | Permalink

    I would agree with Greg. What you want is something like this:
    https://rwmj.wordpress.com/2010/09/24/tip-configure-guest-with-filesystem-directly-on-a-host-device/

%d bloggers like this: