1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Migrating VirtualBox .vdi to ProxMox VE

Discussion in 'Proxmox VE: Installation and configuration' started by ttist25, May 17, 2012.

  1. ttist25

    ttist25 Member

    Joined:
    May 17, 2012
    Messages:
    32
    Likes Received:
    1
    Hey there.

    I hope this post will help someone. It took me a while to make it happen but when I finally put the steps together it was a piece of cake! Hope you have the same results.

    I transferred a Windows 2008 R2 VirtualBox VM on a Windows 7 Ultimate 64bit host to a Proxmox VE 1.9 installation. The VirtualBox VM was an IDE hard drive with no guest extensions installed. I don't know if that's pertinent or not but I saw reference to some fixes for dealing with SCSI drives and also reference to removing any guest additions. I would remove any guest additions first just to be safe.

    Step by Step


    1. Find your VM's .vdi file - First we need to locate the VirtualBox hard drive (.vdi) file.
      • Open the VirtualBox GUI
      • Click on the VM we want to migrate and click the Settings button
      • Click on Storage and click the .vdi file listed under IDE Controller
      • Mouse over the Hard Disk: dropdown list box and note the path to the .vdi file
    2. Convert the .vdi to .img - Next we need to convert the hard drive to a RAW format for ProxMox
      • On the VirtualBox host open a command prompt
      • Run
        Code:
        [I]VBoxManage clonehd --format RAW [virtual_harddisk].vdi [virtual_harddisk].img[/I]
      • This may take a while so be patient. Go get some coffee.
    3. Create a new ProxMox VM - Next we need to create a Proxmox VM to hold our drive image.
      • Open up the Proxmox web interface
      • Click on Virtual Machines then click the Create tab
      • Leave all of the defaults. My Disk space (GB): was set to 32GB and my original .vdi was 20GB. This seems to have worked OK. I'll edit if there are problems down the road.
      • Note the VMID: number of your new VM (i.e. "106")
    4. Upload the .img file - now we need to upload the new /img file to the Proxmox server.
      • Start your file transfer softare (wither WinSCP or Filezilla are two good ones).
      • Transfer the .img file to the /var/lib/vz/images/106 folder (replace 106 with the number you noted from the VMID: field
    5. Rename the .img file - now all we need to do is rename the .img file
      • rename the existing .raw file (for instance vm-106-disk-1.raw) to .old
      • rename the .img file to the name of the existing .raw file (for instance vm-106-disk-1.raw)
    6. Boot it up!
    ‚Äč

    That's really all I had to do. I don't know if I got lucky or what the deal is but it booted right up. It didn't even ask my to re-activate Windows!

    If I find any issues I'll post back but it seems to be working great!
     
    Jeffaz likes this.
  2. timo18146

    timo18146 New Member

    Joined:
    Jul 8, 2012
    Messages:
    2
    Likes Received:
    0
    Re: Migrating VirtualBox .vdi to ProxMox VE - Winxp has NO network at all

    Hi all,

    I converted a virtualbox Winxp SP3 to proxmox. worked out of the box and after disabling processor and intelppm service in registry, it does not crash any more.

    but I dont have network access. tried everything. arp -na does not show the xp kvm on the host but my other kvms. I have a second kvm at the same routed bridge, which works. in windows you can see, that no packets are sent and receiced at all.

    any ideas?

    thanks in advance,

    Timo
     
  3. kjurkic

    kjurkic New Member

    Joined:
    Aug 10, 2012
    Messages:
    2
    Likes Received:
    0
    Just joined up to say thanks for the instructions...worked like a charm! migrated a critical server (CentOS based) from VirtualBox to ProxMox.

    FWIW my disk image was *.vmdk, rather than *.vdi

    regards
    Ken
     
  4. Maroua Jaouachi

    Maroua Jaouachi New Member

    Joined:
    Jul 1, 2015
    Messages:
    3
    Likes Received:
    0
    Hello,
    I'm looking for a solution to migrate a VM windows XP from virtualbox installed under ubuntu system to Proxmox VE.
    I tried so many times this solution and others indicated all linux VMs work without problems but the issue is as always with the windows VMs as u can see here :

    windxp.png

    if anyone can help me please i'll be thankful
     
  5. kjurkic

    kjurkic New Member

    Joined:
    Aug 10, 2012
    Messages:
    2
    Likes Received:
    0
    Hello

    This is an old post, but I will try to help. The STOP error is due to the fact that it cannot properly read the HDD after loading the MBR. Try playing with the HDD settings. In my experience, Windows doesn't like SATA or SCSI when its a VM. Try changing the storage type to IDE type PIIX3 and disable any host cache.

    If that gets you a bit farther in the windows boot process, next try to start in safe mode to allow windows a change to detect hardware changes.

    The best approach would be to perform a SYSPREP right before creating the new image, as this will force windows to re-detect all hardware without causing a BSOD or other panic. I use SYSPREP when cloning windows installs into new hardware.

    hope that helps

    Ken
     
  6. Jeffaz

    Jeffaz New Member

    Joined:
    Jul 21, 2016
    Messages:
    1
    Likes Received:
    0
    Hello, after 2 days or research, if the ttist25's excellent explanation doesn't work for you, and your MS windows VM stop during boot you'll need to execute reg file from : https://pve.proxmox.com/wiki/File:Mergeide.zip, on your Vm before export this one.
    Another thing, in the proxmox web UI, I've changed the network adapter to Realtek and all is fine.
    Hope this will help you and save your time. Geoff.
     
  7. Brian Read

    Brian Read New Member

    Joined:
    Jan 4, 2017
    Messages:
    19
    Likes Received:
    0
  8. 3F4

    3F4 New Member

    Joined:
    Jan 26, 2017
    Messages:
    1
    Likes Received:
    0
    Another approach without reverting the proxmox installation is to create a lvm-thin pool and to mount it at startup :

    https://pve.proxmox.com/wiki/LVM2#LVM-Thin

    For example to create a 200G accessible folder on standard install:

    lvcreate -n folder_name -V 200G pve/data

    mkdir /mnt/folder_name

    mkfs.ext4 /dev/pve/folder_name

    echo '/dev/pve/folder_name /mnt/folder_name ext4 defaults 0 2' >> /etc/fstab

    apt-get install kpartx

    mount /dev/pve/folder_name

    kpartx -a /dev/pve/folder_name


    Then you can use folder_name as hard drive for new VM and be able to see the raw and img file of the VMs.
     

Share This Page