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)...
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".
Next assign the Memory size to the Virtual Machine.
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.
That's it. Now, start exploring the Virtual Machine.
Thanks for stopping by!
Help us to help you:
- Subscribe to our Email Newsletter : Sign Up Now
- Support OSTechNix : Donate Via PayPal
- Download free E-Books and Videos : OSTechNix on TradePub
- Connect with us: Reddit | Facebook | Twitter | LinkedIn | RSS feeds
Have a Good day!!
3 comments
This is only for .IMG formats? or can i converter .iso to .vdi?
Thanks for the post, you save me!
Thank you so much for this tip! It reaaaaally helped me a lot.
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