Page 1 of 1

clonehd vdi to vhd

Posted: 21. Mar 2012, 00:47
by mm123
Hi

I need to move one of our Ubuntu (10.04 64bit) guests running on VirtualBox on to a Windows to a Hyper-V host.

I've executed (while in the directory where the working .vdi lives):

Code: Select all

"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd Current.vdi New.vhd --format VHD
All appears ok, goes to 100% etc:

Code: Select all

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VHD'. UUID: bfbebc1f-d66a-48fc-82a2-5cadd6ea123a
Hyper-V fails to boot with it though. If I boot off an Ubuntu Live CD and use gparted to look at the disk it sees an empty disk. If it do "sudo fdisk -l" I get "Unable to seek on /dev/sda".

So I've re-created the image to be sure. Still the same. I read someone saying they had used the command to convert a VDI to a VDMK, then used vmdk2vhd to convert it to a VHD. I did this but the tool complained the VDMK wasn't valid that VirtualBox had created.

Just tried booting with the VHD in VirtualBox its self now.. it's just sat a black screen with a _ !

What am I doing wrong please?

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 01:13
by Perryg
I just tested this for you and it cloned from VDI to VHD for me just fine.

I used a DOS copy to clone to make it faster but that shouldn't matter at all. Notice the file format in the session information.
Clone-VDI-2-VHD.png
Clone-VDI-2-VHD.png (70.54 KiB) Viewed 11167 times

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 01:16
by Perryg
Question, did you try it in VirtualBox or just in Windows with Hyper-v.
VirtualBox can create the VHD format but that doesn't necessarily mean it will work in Hyper-v
Different blocks and drivers just to mention a few things.

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 01:23
by mm123
I realised I had it in a saved state, so I got rid of that. I also upgraded to the latest version of VirtualBox (though I wasn't that far behind). This time I got an error about an existing machine so removed the VDI from the media manager and reran the conversion with out an error again.

Still the same though problem though!

Help please.

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 01:24
by mm123
Perryg wrote:Question, did you try it in VirtualBox or just in Windows with Hyper-v.
VirtualBox can create the VHD format but that doesn't necessarily mean it will work in Hyper-v
Different blocks and drivers just to mention a few things.
Both. Virtual box just sits with a _ in the top left and goes no where.

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 01:27
by mm123
Perryg wrote:I just tested this for you and it cloned from VDI to VHD for me just fine.

I used a DOS copy to clone to make it faster but that shouldn't matter at all. Notice the file format in the session information.
Clone-VDI-2-VHD.png
That looks like your host (where you ran the clonehd command) is Linux? My host is Windows and the guest is Linux.

Thanks

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 01:35
by Perryg
While the format may be the same you will still need to fix some things first because they do not have the same drivers.
1) you need to remove the VirtualBox guest additions.
2) make sure the settings are close to what they were in VirtualBox.
3) plus you're going to need to change the drivers. Probably turning off the audio, network, shared drives, Etc and deleting the old drivers first.

Does Hyper-v even support Linux now?

"That looks like your host (where you ran the clonehd command) is Linux? My host is Windows and the guest is Linux."
Doesn't matter.

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 11:42
by mpack
I don't know if this is part of the problem, but a bunch of things missing off a cloned disk can often mean that you made the mistake of cloning the base VDI of a snapshot chain. You need to clone the most recent snapshot instead.

Bear in mind also that cloning changes the UUID of the drive, which can sometimes affect the boot - if the boot is locating the disk by its UUID instead of drive number.

I think you were on the right lines proving that the VHD works in another VM in VirtualBox. Make sure you get all VM settings as close as possible before testing. If the VHD works in VirtualBox then getting it working in Hyper-V would be a separate (and someone else's) problem.

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 16:52
by mm123
Ok so I have a VHD that boots in VirtualBox now.

In Hyper-V though Grub can't read the disk properly and if I boot from a live CD to inspect the disk I can see how the disk size info and partition table is a mess.

Thanks VirtualBox for hell on earth!! Nice that you make something only to work with your product (you obviously coded it just so VirtualBox can read it but anything just sees a bunch of rubbish). A product I will NEVER be using again if you can't give a toss about stuff like this. VERY unprofessional product. I wasn't planning on dumping VirtualBox, just moving 1 VM, I am now though! Feels like you're sticking 2 fingers up at me, so the same back!!

Re: clonehd vdi to vhd

Posted: 21. Mar 2012, 17:01
by Perryg
Where does it say that VirtualBox is compatible with Hyper-v? For that matter where does it say Hyper-v is compatible with VirtualBox?
Anyway I will properly remove you from the forum so you don't need to worry about doing that yourself.