How to edit files in vdi image. Convert virtual OS images - VDI to VMDK and vice versa

Any researcher or administrator comes to this question. And it's good to have a choice. As I wrote earlier, we urgently needed to deploy the CentOS test site on Oracle VirtualBox. We also have a dozen other test OSes in both VirtualBox and VMware. Some of them are crammed with software, so there is no way to clone it from one virtual environment to another, but you just want to copy it, i.e. convert. Thankfully there is such a possibility.

To start, a little background.

VDI (Virtual Disk Image) is a file format developed by Oracle for use as a disk image in their VirtualBox virtual machines.

VMDK (Virtual Machine Disk) is a file format developed by VMware for use as a disk image in their virtual machines.

VHD (Virtual Hard Disk) is a file format from Microsoft, which has a complete structure and contents similar to a hard disk. It is used to store virtual operating systems, programs, and other files in a single image file that can be opened by different virtualization programs or virtual machines.

So how do I convert a VMDK image to VDI?

In order to convert a virtual machine image from one format to another, you can use one of the following methods:

1. Using the qemu-img utility from the QEMU emulator package. This command converts a virtual machine image created in VirtualBox to a VMware image:

qemu-img convert -f vdi -O vmdk VirtualBoxImage.vdi VmWareImage.wmdk
-f - defines the format of the virtual machine image to be converted
-O - ​​Specifies the format of the virtual machine image to which the current image will be converted.

The list of supported formats can be viewed as follows:

General command format:

qemu-img convert [-c] [-f fmt] [-O output_fmt] [-o options] filename ] output_filename

2. To convert a virtual machine from one format to another, you can also use the built-in Virtual Box VBoxManage clonehd tools:

Convert vmdk to vdi:
VBoxManage clonehd VmWare_Image.vmdk VirtualBox_Image.vdi --format VDI

And vice versa, a vdi format virtual machine in vdmk:
VBoxManage clonehd VirtualBox_Image.vdi VmWare_Image.vmdk --format VMDK

General command format:

VBoxManage clonehd | |[–format VDI|VMDK|VHD|RAW| ] [–variant Standard,Fixed,Split2G,Stream,ESX] [–existing]

3. You can convert *.vdi images through the VirtualBox GUI:

File->Virtual Image Management->Copy
Choose which *.vdi machine to convert and the desired format (vdmk/vdi/vhd, etc.) of the new image.

Today we will tell you what the VDI format is, how to open it and how to work with it. Most often, such materials are related to virtual CDs Virtuo CD.

VDI format: how to open - Windows applications

If you come across a similar file on a personal computer, most likely it contains disk images. This is one use case for the VDI extension. The following programs will help you figure out how to open such data: WinMount (multifunctional software that allows you to create virtual disks from an archive, a separate directory or image, virtualization capabilities are also implemented here, which can significantly save space), MagicISO, UltraISO. You can use other imaging applications as well.

virtual box

Now let's discuss rarer options for using the VDI extension than opening such a file if it is not related to virtual disks, we will also consider below. For example, such data can be associated with VirtualBox for x86-64 platforms. The developer of such a solution was Oracle, and it is able to work on various operating systems. VDI files are stored in VirtualBox and have their own format. Such materials are used to store virtualized operating systems and other data on a single physical disk. VirtualBox has a command line tool called VBoxManage. This makes it possible to change various options and convert VDI files. The described software is used by embedded and desktop PCs, as well as servers for virtualization at a professional level. VirtualBox allows you to run an operating system using the windowed mode of another OS. In this case, VDI files are treated as separate hard drives. The VM VirtualBox application will help you open such materials.

Other options

Sometimes files that have the VDI extension can be used by VirtualDub, which provides everything for processing and capturing digital video. In conclusion, consider the last use of the specified format. The VDI extension uses StepMania. In this case, we are talking about a rhythmic dance program. This is a special decision. It provides support for all kinds of dance floors. The file contains debugging information that is used to trace program crashes in Windows OS. All data is stored in a special binary format and is also usually called StepMania.vdi. So we figured out what the VDI extension is, how to open it and what applications will help you interact with it.

Have a problem opening .VDI files? We collect information about file formats and can explain what VDI files are. Additionally, we recommend programs that are most suitable for opening or converting such files.

What is the .VDI file format for?

Main expansion association .vdi belongs to the Oracle VirtualBox Virtual Disk Image (VDI) file type/format. VirtualBox is the generic name for a robust, all-in-one open source virtualization solution from Oracle, Inc. VirtualBox is available for a range of platforms and allows you to create virtual machines (VMs) to run guest operating systems (OS) in the primary OS sandbox.

VDI is a binary container format used by VirtualBox to store guest OS disk device images. File .vdi is a large binary file containing a disk image as well as some VM-specific metadata. All hard drives used by the VirtualBox VM are their respective files .vdi.



The VDI image can contain any file system and can be dynamically expanded (depending on VirtualBox settings). For use with other virtualization solutions (e.g. VMware) files .vdi can be converted to other disk image formats (.iso , .vmd k) - and vice versa.

In another context, the extension .vdi also used to refer to the VirtualDub Information (VDI) file type/format used by VirtualDub, a general-purpose freeware program (typically named "VirtualDub .vdi") is a binary disassembler module used for debugging purposes to collect information in the event of a program crash ("crash").

In a similar sense, the extension .vdi also used to refer to debug resource files ( .vdi) as part of StepMania, a free multi-platform interactive dance game. These VDI files are binary modules used to gather information when reporting crashes in the game's software.

Programs to open or convert VDI files

You can open VDI files with the following programs: 

VDI is a disk image format used by the VirtualBox virtualization system. I have already talked about how to use a real disk in a virtual machine, now let's see how you can implement the reverse process - using a virtual disk in a real system. In this way, you can access data that is on the virtual machine disk without having to start it. Using VDI disk images on Linux comes down to installing a package and a two-step mount, after which the contents can be used in the same way as the contents of any other file system.

To connect a virtual disk in VDI format, use the vdfuse program, which is part of the virtualbox-fuse package.

Package installation

On Debian/Ubuntu, the package is installed with the command

apt-get install virtualbox-fuse

If you have Oracle's version of VirtualBox installed, you may need to dependency install VirtualBox OpenSource Edition (virtualbox-ose).

Drive connection

The first step is to mount the VDI image. This can be done with the following command:

sudo vdfuse -w -f ./webserver.vdi /mnt/vdi

Thus, we will get access to the partitions that are present on the virtual disk. At the second stage, the necessary partition is mounted:

sudo mount -t auto /mnt/vdi/Partition1 /mnt/vdi-part1 -o loop

After that, you can work with the file system on the virtual partition.

vdfuse command line options

In general, the format looks like this:

Vdfuse [options] -f diskimage.vdi mountpoint

Here are the options vdfuse has.

Since I often have to install OSes on different computers, I decided to make my own assembly for quick installation (the so-called "fill") using Acronis True Image with the Universal Restore module. The assembly was done by installing a clean OS on the Virtual Box virtual machine, followed by installing the necessary software.


A few notes on installing a WinXP system in a virtual machine for the subsequent creation of a generic image:

  1. Install drivers (HAL) - "Computer with ACPI". Control Panel > System > Hardware > Device Manager > Computer > right click on the installed HAL driver > Update driver > No, not this time > Install from a list or specific location > Do not search. I'll choose the correct driver myself > ACPI Computer > Next > Done!
  2. Install the driver - "Standard Dual Channel PCI IDE Controller". Control Panel > System > Hardware > Device Manager > IDE ATA/ATAPI controllers > right click on the installed IDE controller > Update driver > No, not this time > Install from a specific location > Do not search. I will select the required driver myself > Standard Dual Channel PCI IDE Controller > Next > Done!
  3. Remove references to old drives in the registry by clearing the HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices registry key.
  4. Delete references to the Intel processor driver in the registry. Start > Run > Regedit > HKLM > SYSTEM > ControlSet001 > Services > delete the Intelppm section. Repeat the same for ControlSet002.
  5. Disable all unnecessary devices.
  6. Never install Guest addons in Virtual Box.
  7. Do not install drivers. Do not install Alcohol and DaemonTools. Do not mount virtual CD-ROMs.
  8. Clean up the following directories:
    C:\WINDOWS\SYSTEM32\dllcache\
    C:\WINDOWS\Prefetch\
    C:\WINDOWS\Temp\
    C:\Documents and Settings\ \Local Settings\Temp\
    C:\Documents and Settings\ \Local Settings\Temporary Internet Files\
    C:\Documents and Settings\ \Local Settings\History\
    C:\Documents and Settings\ \Cookies\
    C:\Documents and Settings\\NetHood\
    C:\Documents and Settings\ \Recent\
    C:\RECYCLER\
    C:\System Volume Information\
  9. Defragment the partition with the installed OS.
In the virtual machine, I created a new hard drive on which Acronis made a backup copy of the installed system.
Then I created a bootable flash drive with Acronis True Image Echo Enterprise Server 9.7.8398 with Acronis Universal Restore Rus. There is a DRP folder on the flash drive that contains a selection of hard drive controller drivers. This collection is called Driver Pack "Mass Storage". You can download the latest version from http://driverpacks.net/.
However, it was not possible to transfer the prepared image directly to the USB flash drive from the virtual machine. Virtual Box OSE was installed, but it does not support working with USB =((. Of course, it would be possible to burn the image to DVD from the virtual machine, but this way is not for me =)).
There is an image of a virtual hard disk in * .vdi format - it means that you can extract the file I need from it!
After searching for a program that would allow such an operation, or a way to mount * .vdi file, the solution was nevertheless found.
First, if a dynamically expanding image was selected when creating a hard disk in Virtual Box, it must be converted to a static one. A dynamic image means that the file system blocks are arranged in chronological order, not in the order expected by the file system driver. You need to convert to static with the command:

vboxmanage clonehd --variant static WinXP.vdi temp.vdi

The converted static image (if you do not specify a path before temp.vdi) will be located in /home/ /.VirtualBox/.
Then this image can be mounted as a normal media with the commands:

modprobe nbd max_part=8 nbds_max=1
qemu-nbd --connect=/dev/nbd0 temp.vdi
fdisk -l /dev/nbd0
mount -t ntfs-3g /dev/nbd0p1 /media/CD

That's all =))) - now I have access to the "hard disk" of the virtual machine.
For Win users - you can work with * .vdi files using a wonderful program - UltraISO.