How to convert *.vmdk to *.vdi disc?

Discussions related to using VirtualBox on Windows hosts.

How to convert *.vmdk to *.vdi disc?

Postby pstein » 25. Jan 2010, 15:49

Ok, in general the VB user can use *.vmdk discs from Vmware as hard discs as well.
But is there a way to convert an existing *.vmdk into VB *.vdi format?

Peter
pstein
 
Posts: 35
Joined: 20. Nov 2008, 20:48
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: How to convert *.vmdk to *.vdi disc?

Postby paul.svirin » 25. Jan 2010, 16:12

Paul Svirin
StarWind Software developer ( http://www.starwindsoftware.com )
paul.svirin
 
Posts: 79
Joined: 8. Dec 2009, 00:33
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Windows

Re: How to convert *.vmdk to *.vdi disc?

Postby mpack » 25. Jan 2010, 16:13

viewtopic.php?f=6&t=22422

@pstein: I recommend that you update your profile to mention what host and guest OS's you typically use, if you want more accurate answers to questions like yours.
mpack
Site Moderator
 
Posts: 13210
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to convert *.vmdk to *.vdi disc?

Postby pstein » 26. Jan 2010, 11:19



These two methods show how to use (NOT convert) an *.vmdk hard disc.
I know how to use *.vmdks discs. I need a way to convert them to *.vdi

viewtopic.php?f=6&t=22422


Similar here: As mentioned in the thread CloneVDI is only applicable to *.VDIs. I have a *.vmdk and want to convert it to *.vdi

This is not possible with CloneVDI

So the convert question is still open

Peter
pstein
 
Posts: 35
Joined: 20. Nov 2008, 20:48
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: How to convert *.vmdk to *.vdi disc?

Postby jorgensen » 26. Jan 2010, 12:01

VBoxManage clonehd <filename> <outputfile> --format VDI
jorgensen
 
Posts: 477
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Windows, LinuxMint, Mac

Re: How to convert *.vmdk to *.vdi disc?

Postby pstein » 26. Jan 2010, 12:33

jorgensen wrote:VBoxManage clonehd <filename> <outputfile> --format VDI


Ok. Thank you but it does not work. It gives here:

C:\vm\harddisks\Ubuntu>C:\vm\VirtualBox\v3.1.2\VBoxManage clonehd Ubuntu.vmdk Ubuntu.vdi --format VDI
VirtualBox Command Line Management Interface Version 3.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
ERROR: Cannot register the hard disk 'C:\vm\harddisks\Ubuntu\Ubuntu.vmdk' with UUID {78e88a3e-4495-41d1-807e-6a1e890ad7ee} because a hard disk 'C:\vm\harddisks\Ubuntu\Ubuntu.vmdk' with UUID {78e88a3e-4495-41d1-807e-6a1e890ad7ee} already exists in the media registry ('C:\Documents and Settings\haer01\.VirtualBox\VirtualBox.xml')
Details: code E_INVALIDARG (0x80070057), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, false, Bstr(""), false, Bstr(""), srcDisk.asOutParam())" at line 628 of file VBoxManageDisk.cpp


By the way: Which of the *.vmdk's do I have to convert ? All of the following:

Ubuntu-s001.vmdk
Ubuntu-s002.vmdk
Ubuntu-s003.vmdk
Ubuntu-s004.vmdk
Ubuntu-s005.vmdk
Ubuntu-s006.vmdk
Ubuntu.vmdk

?

I guess it is sufficient to convert the main one and all depending will be converted as well.
Am I right?
Peter
pstein
 
Posts: 35
Joined: 20. Nov 2008, 20:48
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: How to convert *.vmdk to *.vdi disc?

Postby jorgensen » 26. Jan 2010, 13:29

Remove all snapshots.
Remove the vmdk from the Media Manager
Use full pathname for the source.
jorgensen
 
Posts: 477
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Windows, LinuxMint, Mac

Re: How to convert *.vmdk to *.vdi disc?

Postby mpack » 26. Jan 2010, 15:05

pstein wrote:Similar here: As mentioned in the thread CloneVDI is only applicable to *.VDIs. I have a *.vmdk and want to convert it to *.vdi

Look more closely, and bear in mind that the tool has been updated several times since the early messages of that thread. In fact, forget the thread, just download the tool and read the current release notes.

pstein wrote:This is not possible with CloneVDI

It is very much possible, or I would not have referred you to it. In fact it is by far the easiest and fastest way to do what you need, at least on a Windows host.
mpack
Site Moderator
 
Posts: 13210
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to convert *.vmdk to *.vdi disc?

Postby mpack » 26. Jan 2010, 15:09

pstein wrote:I guess it is sufficient to convert the main one and all depending will be converted as well.

Yes, provided you understand which one the "the main one" is. It is usually the smallest file. In the case of your list I would expect that "ubuntu.vmdk" is the main file - and all the other files will be additional extents, not snapshots or differenced images.
mpack
Site Moderator
 
Posts: 13210
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to convert *.vmdk to *.vdi disc?

Postby pstein » 26. Jan 2010, 16:07

mpack wrote:
pstein wrote:This is not possible with CloneVDI

It is very much possible, or I would not have referred you to it. In fact it is by far the easiest and fastest way to do what you need, at least on a Windows host.



Ok, thank you. It works now :-)

However one small issue remains:

Although I checked "Compact drive while copying" I found NO shrinked result.
The hard disc takes almost the same amount of space (~ 3.4 GB !) as the original .vmdk.

Why?

Ubuntu + a small additional tools take normally at most 500 MB. So why do I need a hard disc with 3.4 GB ?

Peter
pstein
 
Posts: 35
Joined: 20. Nov 2008, 20:48
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu, CentOS

Re: How to convert *.vmdk to *.vdi disc?

Postby mpack » 26. Jan 2010, 17:11

pstein wrote:Although I checked "Compact drive while copying" I found NO shrinked result.
Ubuntu + a small additional tools take normally at most 500 MB. So why do I need a hard disc with 3.4 GB ?
Peter

Don't you have a swap partition? That by itself usually accounts for something like 2GB.

Compacting is only possible if there is deleted space (ie. space dynamically allocated for files which have since been deleted), and the guest is using a supported filesystem (FATx, NTFS or EXTx), and the guest HD is using a supported partitioning scheme (MBR).
mpack
Site Moderator
 
Posts: 13210
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 42 guests