Home Command line utilities How To Convert IMG File To VDI File Using Oracle VirtualBox
Convert IMG File To VDI File

How To Convert IMG File To VDI File Using Oracle VirtualBox

By sk
2255 Views

I have recently downloaded a Linux operating system for testing. The downloaded OS was in IMG format, and Oracle VirtualBox doesn't support the IMG format. So, I had to find a way to use IMG file in VirtualBox. After a bit of google search, I found a simple command to convert the IMG file to VDI file. VDI file, Virtual Disk Image, is the default disk image file for VirtualBox. In layman terms, VDI is the virtual hard disk of a guest machine. Unlike physical hard disk, we can expand the size of virtual hard disk without losing any data. The disk image files can be created either in fixed size or dynamically allocated size.

IMG file, also known as Image file, that can be used to distribute the whole image of a disc. It is similar to ISO file. It is mostly useful for dumping the video games. We can mount the IMG files in the computer and play the games without having to burn them in a physical disk. Not just games, we can write operating system and applications in IMG format. IMG is the default disk image format for QEMU, an open source virtualization software.

Hope you got the basic idea about VDI and IMG files. Now, let us see how to convert IMG file to VDI file using VirtualBox.

Convert IMG File To VDI File Using Oracle VirtualBox

You must install Oracle VirtualBox before starting to convert the IMG files. Oracle VirtualBox is a cross-platform virtualization software. It is available in the default repositories of modern GNU/Linux operating systems.

Once VirtualBox installed, go to the location where you have the IMG file.

The syntax to convert a IMG file to VDI file is:

VBoxManage convertdd input.img output.vdi

Example:

$ VBoxManage convertdd eos-eos3.0-amd64-amd64.161024-144409.base.img eos.vdi

Replace the img file with your own file.

Sample output:

Converting from raw image file="eos-eos3.0-amd64-amd64.161024-144409.base.img" to file="eos.vdi"...
Creating dynamic image with size 6012964864 bytes (5735MB)...

sksk-downloads-endless-os_001

It will take a few moments to convert IMG file to VDI.

Import VDI File in Oracle VirtualBox

Open Oracle VirtualBox. Click New on the Menu bar to create a new Virtual machine.

Enter the name of the virtual machine. I named it as "Test".

create-virtual-machine_003

Next assign the Memory size to the Virtual Machine.

create-virtual-machine_004

Here comes the important part. As we already have created the virtual hard file (VDI), you must select the option "Use an existing virtual hard disk file". Choose the VDI file location an click Create.

create-virtual-machine_005

That's it. Now, start exploring the Virtual Machine.

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

3 comments

Brandon March 1, 2018 - 7:54 am

This is only for .IMG formats? or can i converter .iso to .vdi?
Thanks for the post, you save me!

Reply
01101001b October 4, 2018 - 10:41 am

Thank you so much for this tip! It reaaaaally helped me a lot.

Reply
Rares Vlad POP February 21, 2019 - 10:52 am

i get this error:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (4.20.8-110.current) or it failed to
load. Please recompile the kernel module and install it by

sudo /sbin/vboxconfig

You will not be able to start VMs until this problem is fixed.
Converting from raw image file=”batocera.img” to file=”batocera.vdi”…
Creating dynamic image with size 1992938496 bytes (1901MB)…

I use Solus

Thanks

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More