FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Jul 2005
    Posts
    205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Migrate VMware to KVM

    Is there any means of converting a VMware VM into a KVM VM? If there is no direct way is there a KVM tool that will convert a running system into a KVM VM like VMware has? If that exists it would be possible to run it on a VMware VM to produce a KVM VM?

  2. #2
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    4,991
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for vmware 3 & 4 you can use qemu-img, eg

    yum install qemu-img
    qemu-img convert vmware.vmdk -O qcow2 qemu.img

  3. #3
    Join Date
    Jul 2005
    Posts
    205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    How do I load the image into KVM? I tried doing a restore machine but it gives me an image magic error.

  4. #4
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    4,991
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Create a new VM, , then add the image as "managed other existing storage" instead of creating a new image (in fact I notice you can add an existing vmdk image so no need to run qemu-img manually)

  5. #5
    Join Date
    Jul 2005
    Posts
    205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I've tried it with a Win2K VM and an XP VM. The WIn2K VM tries goes into a boot loop and eventually crashes. I tried removing VMware tools but that made it worse. The XP VM gets no where. It says booting from hard drive and then just sits there.

    Are there KVM drivers that I could install while running the VMs under VMware?

  6. #6
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    4,991
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you need to rerun the Windows setup CD and select Repair option.

    There's a howto on the kvm site, but it's a bit muddled:

    http://www.linux-kvm.org/page/How_To..._Vmware_To_KVM

    I'm not sure what you meant by "kvm drivers", kvm provides the virtualisation layer via /dev/kvm, the hardware devices emulation is done via qemu, windows should support the devices natively.

  7. #7
    Join Date
    Jul 2005
    Posts
    205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I mean the equivalent of VMware tools.

  8. #8
    Join Date
    Jan 2009
    Location
    Brisbane, Australia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Has anyone managed to get this to work yet?

    I have F11, and have fresh installed vm's working just fine, but can't get the qemu-img version 0.10.5 to work.

    I've tried these syntax's;

    qemu-img convert -O qcow2 Win2K.vmdk Win2K.qcow2
    qemu-img convert Win2K.vmdk Win2K.qcow2
    qemu-img convert Win2K.vmdk -O qcow2 Win2K.qcow2

    I get the error qemu-img: Could not open 'Win2K.qcow2' all the time.

    I created an image just in case;
    # qemu-img create -f qcow2 Win2K.qcow2 4G
    Formatting 'Win2K.qcow2', fmt=qcow2, size=4194304 kB

    Still no success, am I doing something wrong?

    Thanks

    Keith

  9. #9
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    2,729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should have worked. But it gave me a hard time to so I just booted vmplayer and virtual machine manager with a live cd. From there I used dd to duplicated the drive on a network share and then wrote it back into virtual machine manager. Seamed like I was going to the moon and back but I'm not beating on it today so it's something to consider.

  10. #10
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    4,991
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have enough free space in the directory?

  11. #11
    Join Date
    Jan 2009
    Location
    Brisbane, Australia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Beaker, wow! That is a journey all right! If I can't get it to work by the weekend, then that's what I'll do.

    Good question Sideways! This system does have more than ample disk, but I've also been running the command as root, changing file permissions and ownership. Moved the file from one disk to another, really running out of options.

    Looks like I may need to file a bug at this rate.

  12. #12
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    4,991
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ensure the vmdk file is recognised correctly (not as 'raw' format for example)

    Code:
    qemu-img info Win2K.vmdk
    if so, try specifying formats and full path explicitly

    Code:
    qemu-img convert -f vmdk Win2K.vmdk -O qcow2 /home/user/Win2K.qcow2
    (You're not using fat32 I hope, check free space and filesystems with 'df -hT')

  13. #13
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    2,729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might be fighting selinux so check the file context. Default img location is /var/lib/virtlib/images.

    I tried again on a clean install and it went without a hitch so I might revisit that box soon. I'm hoping it was one of those thing which refuse to work till the next day.

    Late edit: If you have multiple files (-1.vmdk, -2.vmdk) then try converting into a single file firt. i.e., MyMachine.vmdk. I just converted dimdim's without a hitch.
    Last edited by beaker_; 9th July 2009 at 12:26 AM.

  14. #14
    Join Date
    Jan 2009
    Location
    Brisbane, Australia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Sideways,

    Yes, the file is being seen as raw, is that my problem? Google fails me on this

    Code:
    # qemu-img info /home/<user>/vmware/Win2K/Win2K-000001.vmdk
    image: /home/<user>/vmware/Win2K/Win2K-000001.vmdk
    file format: raw
    virtual size: 0 (0 bytes)
    disk size: 4.0K
    I've tried;
    Code:
    qemu-img convert -f vmdk /home/<user>/vmware/Win2K/Win2K-000001.vmdk -O qcow2 /home/<user>/Win2K.qcow2
    qemu-img: Could not open '/home/<user>/vmware/Win2K/Win2K-000001.vmdk'
    The host system is F11 with ext4 and the image "should" be NTFS.

    Hi beaker, I have so many scars and wounds from SElinux its always disabled on my systems

    You said
    If you have multiple files (-1.vmdk, -2.vmdk) then try converting into a single file firt. i.e., MyMachine.vmdk.
    How did you do that? The file list from the directory is;
    Code:
    vmware-0.log
    vmware-1.log
    vmware-2.log
    vmware.log
    Win2K-000001-s001.vmdk
    Win2K-000001-s002.vmdk
    Win2K-000001-s003.vmdk
    Win2K-000001-s004.vmdk
    Win2K-000001-s005.vmdk
    Win2K-000001.vmdk
    Win2K.nvram
    Win2K-s001.vmdk
    Win2K-s002.vmdk
    Win2K-s003.vmdk
    Win2K-s004.vmdk
    Win2K-s005.vmdk
    Win2K-Snapshot1.vmem
    Win2K-Snapshot1.vmsn
    Win2K.vmdk
    Win2K.vmsd
    Win2K.vmx
    Win2K.vmxf
    Am I missing a step here?

    I looked at the vmware.log, and it says the vmware was version=6.5.0. These vmware images have been migrated from every release of Fedora since FC6! and I would really like to avoid vmware and move to kvm, but my window of opportunity is running out.

    Thank you beaker and sideways for all your help, I really appreciate it guys!

  15. #15
    Join Date
    Jul 2009
    Location
    London,England
    Posts
    1,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the man page for qemu-img it says:

    "vmdk"
    VMware 3 and 4 compatible image format.
    so looks like Vmware version 6.5 images can't be converted.

    Looks like you'll have to do something like beaker suggested, boot up the vmware image (in VMware), connect to some other external shared drive, and use dd to write the whole disk image in raw format. Then rerun' qemu-img convert' on the raw image.

Page 1 of 2 12 LastLast

Similar Threads

  1. Slow LVM Migrate?
    By Tekno_Cowboy in forum Using Fedora
    Replies: 5
    Last Post: 24th February 2009, 07:21 AM
  2. How did you migrate?
    By niko123456 in forum Wibble
    Replies: 41
    Last Post: 17th May 2007, 06:36 AM
  3. migrate from rh8->fc4?
    By hsaptus in forum Installation, Upgrades and Live Media
    Replies: 3
    Last Post: 23rd March 2006, 10:04 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •