Request For Comment: VDI Binary Image Specification
-
- Posts: 6
- Joined: 8. Apr 2009, 22:06
- Primary OS: MS Windows XP
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 2k, XP, 2003, Vista, 2008
- Location: South Dakota, USA
- Contact:
Request For Comment: VDI Binary Image Specification
I've been through the available open source repository, lots of Google search results, FAQs and manuals and I've found not one bit of data related to the actual binary image format of the VDI.
As an example: I can download the binary-image spec for Microsoft's VHD file format, which enables me to create a small program to open and edit VHD Header and Footer data so I can (for example) straight copy a 25GB VHD file into a new folder, slap a fresh UUID on the copy VHD file in about a nanosecond, and then have the original and the copy loaded into VirtualBox simultaneously. Using a similar method, I can expand fixed-sized VHD files at will by simply dropping a new empty file of the desired size onto my hard drive and then passing through the existing file bit-by-bit to make a mirror-image, then rewrite the header and footer to the appropriate value data so Virtual PC and VirtualBox can use them as if they were native, at which point I just have to start up the virtual machine and expand the primary partition (or create a new partition in the extra space).
What I'd really very much appreciate is a VDI specification document I can use to do the same thing with this format.
Thanks,
Andrew
As an example: I can download the binary-image spec for Microsoft's VHD file format, which enables me to create a small program to open and edit VHD Header and Footer data so I can (for example) straight copy a 25GB VHD file into a new folder, slap a fresh UUID on the copy VHD file in about a nanosecond, and then have the original and the copy loaded into VirtualBox simultaneously. Using a similar method, I can expand fixed-sized VHD files at will by simply dropping a new empty file of the desired size onto my hard drive and then passing through the existing file bit-by-bit to make a mirror-image, then rewrite the header and footer to the appropriate value data so Virtual PC and VirtualBox can use them as if they were native, at which point I just have to start up the virtual machine and expand the primary partition (or create a new partition in the extra space).
What I'd really very much appreciate is a VDI specification document I can use to do the same thing with this format.
Thanks,
Andrew
-
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
Re: Request For Comment: VDI Binary Image Specification
The VirtualBox dev team doesn't publish a spec, but then again it does publish the source code and an API to the disk handling utilities that's documented in the SDK. Swings and roundabouts. Also see my tutorial All about VDIs, if you want to understand the internals.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.
-
- Posts: 6
- Joined: 8. Apr 2009, 22:06
- Primary OS: MS Windows XP
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 2k, XP, 2003, Vista, 2008
- Location: South Dakota, USA
- Contact:
Re: Request For Comment: VDI Binary Image Specification
That is exactly what I'm looking for!
Thanks very much, Terry. For the pointer and the documentation in the first place
Edit:
I guess it bears mentioning that the search feature on the board index as well as on the 'Using VirtualBox' board, using terms like "VDI" and "VDI SPEC" and "VDI SPECIFICATION" did not turn up that tutorial at all.
If I'd been more inclined to actually read the board instead of just search for what I wanted, I see how that I would have found it right there in the stickies at the top, but it looks a little like the regex in the search feature is borked.
Thanks very much, Terry. For the pointer and the documentation in the first place

Edit:
I guess it bears mentioning that the search feature on the board index as well as on the 'Using VirtualBox' board, using terms like "VDI" and "VDI SPEC" and "VDI SPECIFICATION" did not turn up that tutorial at all.
If I'd been more inclined to actually read the board instead of just search for what I wanted, I see how that I would have found it right there in the stickies at the top, but it looks a little like the regex in the search feature is borked.
Re: Request For Comment: VDI Binary Image Specification
For searching google is your friend "search keywords site:forums.virtualbox.org"
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
-
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
Re: Request For Comment: VDI Binary Image Specification
We are gently encouraging the VBox team to host a community Wiki where we can keep this sort of stuff, but this sort of thing comes down to the time available and priorities amongst the dev team and community supporters that are involved. I would say that there's a 50:50 change that we will have a starting wiki up in the next month or so.PainterEnterprises wrote:I guess it bears mentioning that the search feature on the board index as well as on the 'Using VirtualBox' board, using terms like "VDI" and "VDI SPEC" and "VDI SPECIFICATION" did not turn up that tutorial at all.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.
-
- Posts: 6
- Joined: 8. Apr 2009, 22:06
- Primary OS: MS Windows XP
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 2k, XP, 2003, Vista, 2008
- Location: South Dakota, USA
- Contact:
Re: Request For Comment: VDI Binary Image Specification
Hello again.
I had pulled TerryE's tutorial some time back, but I'm only just getting the chance to start looking over it. The tutorial is great, but I need a lot more information.
For example:
It'd be really nice to know what actual name has been assigned to each data field in the Header structure just so I don't have to refer to 'the field located at offset X in the VDI Header.'
I also absolutely need explicit definitions for each field usage. What exactly is an Image Signature field used for and is it totally unique to a VDI image like a short UUID, or is it some kind of checksum? If it is a checksum, how is the value calculated? What are the various possible values for the Image Type field and what does each value represent? What are the various possible values for the Image Flags field, and is this a byte or bit field, and what would each value represent? How are Cylinders, Sectors, and Heads calculated and are they required or optional (can they all be zeroed out unless the drive is some specific type)?
I've done some more searching (both in this Forum and as per prior suggestions from this forum, via Google) in hopes of finding the answers to these questions, but it seems like even the OSE version doesn't have this kind of technical application detail available. I'm smart enough to know that the guys working on the OSE aren't working in the dark, but I'm not smart enough to figure out how to turn on the flashlight. Can anybody point me in the right direction?
Thanks,
Andrew
I had pulled TerryE's tutorial some time back, but I'm only just getting the chance to start looking over it. The tutorial is great, but I need a lot more information.
For example:
It'd be really nice to know what actual name has been assigned to each data field in the Header structure just so I don't have to refer to 'the field located at offset X in the VDI Header.'
I also absolutely need explicit definitions for each field usage. What exactly is an Image Signature field used for and is it totally unique to a VDI image like a short UUID, or is it some kind of checksum? If it is a checksum, how is the value calculated? What are the various possible values for the Image Type field and what does each value represent? What are the various possible values for the Image Flags field, and is this a byte or bit field, and what would each value represent? How are Cylinders, Sectors, and Heads calculated and are they required or optional (can they all be zeroed out unless the drive is some specific type)?
I've done some more searching (both in this Forum and as per prior suggestions from this forum, via Google) in hopes of finding the answers to these questions, but it seems like even the OSE version doesn't have this kind of technical application detail available. I'm smart enough to know that the guys working on the OSE aren't working in the dark, but I'm not smart enough to figure out how to turn on the flashlight. Can anybody point me in the right direction?
Thanks,
Andrew
-
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
Re: Request For Comment: VDI Binary Image Specification
Like many FLOSS products, the source code is really the only true specification. Google VirtualBox svn. The Storage components are in src/VBox/Devices/Storage, and the modules which implement the VDI functionality are VDICore.h and VDIHDDCore.cpp. Even if you can't program comfortably in C++, it is still quite readable and understandable if you have any knowledge of programming.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.
-
- Posts: 6
- Joined: 8. Apr 2009, 22:06
- Primary OS: MS Windows XP
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 2k, XP, 2003, Vista, 2008
- Location: South Dakota, USA
- Contact:
Re: Request For Comment: VDI Binary Image Specification
Thanks for the illumination (again), Terry. Looks like everything I need is in there, including full coder comments! (Who would have guessed, right? Never occurred to me to go dig up the source when I knew I couldn't read it anyway)
-
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
Re: Request For Comment: VDI Binary Image Specification
Reading C++ if you've done any programming is pretty straight forward, though the for (i=0;i<n;i++) loop syntax throws people at first. But it's still quite easy to get the gist of what is going on. Writing it is entirely a different matter and the main problem is learning all the bloody libraries. Still, it gets quite easy after you've learnt your first dozen languages 

Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.
-
- Posts: 1
- Joined: 25. May 2016, 20:32
- Primary OS: MS Windows 7
- VBox Version: OSE other
- Guest OSses: 2K,XP,W7,W8,W10
- Contact:
Re: Request For Comment: VDI Binary Image Specification
Great, based on this tutorial I was able to implement *.vdi support in my software in less than a day !TerryE wrote:Also see my tutorial [...]All about VDIs, if you want to understand the internals.
Easy straightforward format, thanks !
Peter, IsoBuster Guy,
Regards
Regards