Solved: How to convert .usb file to .vmdk to .vdi to .vhd and vice versa

In this post we will see how we can convert a .usb file to .vmdk or .vdi  or .vhd

We will be doing this conversion using a free tool Oracle Virtualbox.

Pre-requisites:-

Download latest Virtualbox version

Once you have downloaded and installed the latest version of Virtualbox. Go to the directory in which virtual box is installed. There you will find a program “VBoxManage.exe”.  We will be using “VBoxManage.exe” for the conversion.

Convert .usb to .vmdk 

First let’s see how to convert .usb file to .vmdk . Syntax is simple:

VBoxManage.exe convertfromraw filename.usb filename.vmdk --format VMDK

In the below example we will be converting a Solaris 11 USB file  sol-11_2-openstack-x86_Copy.usb  to vmdk.

E:\Software\Openstack>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw sol-11_2-openstack-x86.usb sol-11_2_cldvds-openstack-x86_Copy.vmdk --format VMDK
Converting from raw image file="sol-11_2-openstack-x86.usb" to file="sol-11_2_cldvds-openstack-x86_Copy.vmdk"...
Creating dynamic image with size 8655764992 bytes (8255MB)...

Convert  .usb to .vdi

Similarly you can convert a .usb file to .vdi . Refer below example.

E:\Software\Openstack>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw sol-11_2-openstack-x86.usb sol-11_2_cldvds_openstack-x86_Copy.vdi --format VDI
Converting from raw image file="sol-11_2-openstack-x86.usb" to file="sol-11_2_cldvds_openstack-x86_Copy.vdi"...
Creating dynamic image with size 8655764992 bytes (8255MB)...

Convert .vdi to .vmdk

Now let’s try converting a .vdi file to .vmdk

E:\Software\Openstack>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw sol-11_2-openstack-x86_Copy.vdi sol-11_2_cldvds-openstack-x86_Copy.vmdk --format VMDK
Converting from raw image file="sol-11_2-openstack-x86_Copy.vdi" to file="sol-11_2_cldvds-openstack-x86_Copy.vmdk"...
Creating dynamic image with size 6624903168 bytes (6318MB)...

If you want to convert from vmdk to vdi the syntax will be:

VBoxManage.exe convertfromraw filename.vmdk filename.vdi --format VDI

Convert .vdi to .vhd

Same steps you can use to convert from .vdi to .vhd

E:\Software\Openstack>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw sol-11_2-openstack-x86_Copy.vdi sol-11_2_cldvds-openstack-x86_Copy.vhd --format VHD
Converting from raw image file="sol-11_2-openstack-x86_Copy.vdi" to file="sol-11_2_cldvds-openstack-x86_Copy.vhd"...
Creating dynamic image with size 6624903168 bytes (6318MB)...

You can use similar steps to convert the other way round like convert .vmdk to .vdi  or .vhd to .vdi.

Hope this post is helpful to you. Do let me know if you have any query.