Migrating VirtualBox .vdi to ProxMox VE

ttist25

Member
May 17, 2012
32
1
8
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!
 
  • Like
Reactions: Jeffaz

timo18146

New Member
Jul 8, 2012
2
0
1
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
 

kjurkic

New Member
Aug 10, 2012
2
0
1
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
 

Maroua Jaouachi

New Member
Jul 1, 2015
3
0
1
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
 

kjurkic

New Member
Aug 10, 2012
2
0
1
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 :

View attachment 2974

if anyone can help me please i'll be thankful
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
 

Jeffaz

New Member
Jul 21, 2016
1
0
1
37
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.
 

3F4

New Member
Jan 26, 2017
1
0
1
68
This post is not longer completely correct as pfom V4.2 the "raw" images for the VMs are not by default visible in /var/lib/vz/image. In order for procedure to work, they need to be!

So you need to revert your proxmox installation to using by default the "local" storage. This is well described in here:

https://pve.proxmox.com/wiki/Instal....2Fvar.2Flib.2Fvz_.28Proxmox_4.2_and_later.29
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!