export VM using VDI instead of VMDK

This is for discussing general topics about how to use VirtualBox.

export VM using VDI instead of VMDK

Postby Emile » 11. Nov 2013, 17:39

I would like to export my VMs. The disk images inside the .ova file should be .vdi, not .vmdk (which unfortunately is the default).

Is this somehow possible?

(This is because I can easily mount .vdi files using libguestfs on the host [Debian testing/jessie].)
Emile
 
Posts: 12
Joined: 8. Nov 2013, 23:33

Re: export VM using VDI instead of VMDK

Postby mpack » 11. Nov 2013, 18:02

As far as I know: no, not possible.

The OVA/OVF appliance format is a standard promoted by VMWare, hence it uses the VMWare disk container format.

However - there's no requirement for you to use "export" if you are moving VMs between VirtualBox instances. You can simply copy the VM folder. See Howto: Moving a VM.
mpack
Site Moderator
 
Posts: 30058
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: export VM using VDI instead of VMDK

Postby michaln » 11. Nov 2013, 18:24

Exactly right. The OVA/OVF specifies a compressed VMDK format (it's not the same as normal VMDK files). So no, not possible.
michaln
Oracle Corporation
 
Posts: 2962
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all

Re: export VM using VDI instead of VMDK

Postby Emile » 12. Nov 2013, 17:59

I prefer the export feature, because then it's simpler to distribute the VMs to others. Needs less explanation.

I've read the OVF (Open Virtualization Format Specification) specification 1.1 (DSP0243_1.1.1.pdf). It doesn't enforce VMDK. Other disk image formats are allowed. It says "The previous example uses VMDK disk files, but multiple disk formats are supported." and "OVF does not require any specific disk format to be used, but to comply with this specification the disk format shall be given by a URI which identifies an unencumbered specification on how to interpret the disk format. The specification need not be machine readable, but it shall be static and unique so that the URI may be used as a key by software reading an OVF package to uniquely determine the format of the disk. The specification shall provide sufficient information so that a skilled person can properly interpret the disk format for both reading and writing of disk data. It is recommended that these URIs are resolvable."

Looks like a missing feature in Virtual Box.
Emile
 
Posts: 12
Joined: 8. Nov 2013, 23:33

Re: export VM using VDI instead of VMDK

Postby mpack » 12. Nov 2013, 18:22

That may well be the theory, but in practice if you deviate from the expected format then it won't work. Nobody outside of the VirtualBox arena is expecting to see exported appliances using VDI format, and inside the VirtualBox domain it isn't required. Still, if you are only moving between VirtualBox hosts, and you prefer VDI, and you are prepared to give Oracle a barrowload of cash, then I'm sure they'd accomodate you!
mpack
Site Moderator
 
Posts: 30058
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: export VM using VDI instead of VMDK

Postby andsens » 18. Dec 2013, 01:36

OK, so Emile you are correct in assuming that no single virtual disk format is enforced in the OVF spec (I read it too).
I am generating my own OVFs (vagrant plugin for my debian bootstrapper https://github.com/andsens/build-debian-cloud/tree/python) and need virtualbox to accept VDIs (or rather: I was too lazy to implement VMDK,and then I got stubborn when I couldn't get it to work).
So I dug into the VirtualBox source code.
These are the URLs for the different virtual disk formats: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-server/ApplianceImpl.cpp#L88
  • ISOURI = "http://www.ecma-international.org/publications/standards/Ecma-119.htm"
  • VMDKStreamURI = "http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized"
  • VMDKSparseURI = "http://www.vmware.com/specifications/vmdk.html#sparse"
  • VMDKCompressedURI = "http://www.vmware.com/specifications/vmdk.html#compressed"
  • VMDKCompressedURI2 = "http://www.vmware.com/interfaces/specifications/vmdk.html#compressed"
  • VHDURI = "http://go.microsoft.com/fwlink/?LinkId=137171"

As you can see, no VDI URI. Which is something the developers note in the comments here: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp#L636
And you might also notice, when scrolling down a few lines, they only support importing VMDK and RAW disk images. However, they do add the URIs to their supportedStandardsURI map in https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-server/ApplianceImpl.cpp#L609, no clue why they don't support importing them.

TL;DR I can say with 100% certainty you cannot import VDI disks into virtualbox via OVF, there is simply no URI specified for that particular disk format.
andsens
 
Posts: 3
Joined: 26. May 2011, 21:07
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: deb x86

Re: export VM using VDI instead of VMDK

Postby adrelanos » 17. Aug 2019, 14:04

Has anything changed about this?

VirtualBox GUI nowadays supports to import as vdi which is much better than vmdk.

https://www.virtualbox.org/manual/ch01.html#ovf says

Appliances in OVF format can appear in the following variants:

They can come in several files, as one or several disk images, typically in the widely-used VMDK format. See Section 5.2, “Disk Image Files (VDI, VMDK, VHD, HDD)”. They also include a textual description file in an XML dialect with an .ovf extension. These files must then reside in the same directory for Oracle VM VirtualBox to be able to import them.

Alternatively, the above files can be packed together into a single archive file, typically with an .ova extension. Such archive files use a variant of the TAR archive format and can therefore be unpacked outside of Oracle VM VirtualBox with any utility that can unpack standard TAR files.

Does this mean we could manually create an ova file that contains vdi rather than vmkd images?
adrelanos
 
Posts: 7
Joined: 9. Sep 2018, 09:48

Re: export VM using VDI instead of VMDK

Postby mpack » 17. Aug 2019, 14:43

As mentioned above, the OVA appliance format assumes compressed VMDK. This is not directly usable anywhere, you have to import it, so deviating from this format would be of no benefit - and in any case VDI has no corresponding compressed variant.

VirtualBox v6 and later does however offer an "import as VDI" checkbox when importing an appliance. That means they get unpacked from compressed VMDK to uncompressed VDI on import.
mpack
Site Moderator
 
Posts: 30058
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 11 guests