1. Home
  2. Linux
  3. How to convert virtualbox drives to qcow on linux

How to convert VirtualBox drives to QCOW on Linux

If you have a VDI, VHD, or VMDK formatted drive in VirtualBox and want to use it with QEMU/KVM (Virt Manager, Gnome Boxes, etc.) on Linux, you will need to convert it to QCOW. This guide will show you how to convert various Vbox drive formats to QCOW.

To start, open up VirtualBox. You can open VirtualBox by pressing Win on the keyboard, opening the app menu, and searching for “VirtualBox.” Alternatively, you can launch it through your Linux desktop app menu by searching for the shortcut.

Once VirtualBox is open, follow the instructions below to convert your VDI, VHD, or VMDK drive to QCOW.

Convert VDI to QCOW

VDI is the most commonly used VirtualBox drive format type. If you need to convert a VDI drive to QCOW (.qcow2) for QEMU/KVM on Linux, follow the step-by-step instructions below.

Step 1: Click on the “File” button at the top-left corner of VirtualBox. Then, select the “Virtual Media Manager” option. Alternatively, press Ctrl + D.

Step 2: Inside the Virtual Media Manager, locate your VDI VM drive. In this example, the drive is “kali-linux-2022.3-virtualbox-amd64.vdi”. Yours will differ in name.

Step 3: After locating the VDI file, select it with the mouse. Then, click on the “Copy” button. A pop-up window will appear when you choose the “Copy” button. Find the “Expert Mode” button, and select it.

Step 4: Upon selecting “Expert Mode,” select the “QCOW (QEMU Copy-On-Write)” option. Then, select the folder icon.

Step 5: A file browser window will appear after selecting the folder icon. Erase the ‘.vdi’ file extension, add ‘.qcow2,’ and click the “Save” button.

Step 6: After selecting the “Save” button, click “Copy” to convert your VDI disk to a QEMU/KVM compatible QCOW2 drive.

Convert VHD to QCOW

If you have a VHD drive file and need to convert it to QCOW for use in QEMU/KVM, you’ll need to convert it. Follow the step-by-step instructions below to convert.

Step 1: Select the “File” button in VirtualBox. Then, choose the “Virtual Media Manager” option.

Step 2: When you load up Virtual Media Manager, you’ll see a list of Virtual Machine drives. Find the VHD drive you wish to convert and select it with the mouse.

Step 3: Once you’ve selected the VHD file with the mouse, choose the “Copy” button. After clicking on the “Copy” button. Click the “Expert Mode” button in the pop-up window.

Step 4: After you’ve chosen “Expert Mode,” find the “QCOW (QEMU Copy-On-Write)” option, and select it. Then, click on the folder icon next to the drive’s name.

Step 5: A pop-up window will appear when you click on the folder icon. Click it, and change “.vdi” or “.vhd” to “.qcow2.” Click save when you’ve changed the file extension.

Step 6: Click on the “Save” button in the pop-up window. Then, click the “Copy” button to convert your VHD disk to a QCOW formatted file compatible with QEMU/KVM.

Convert VMDK to QCOW

Do the following if you need to convert a VMDK drive to the QCOW format.

Step 1: Select the “File” button in VirtualBox. Then, choose the “Virtual Media Manager” entry in the menu.

Step 2: Inside the Virtual Media Manager, locate your VMDK hard drive file, and select it with the mouse.

Step 3: Now that you’ve selected the VMDK file with the mouse, find the “Copy” button, and click on it. A pop-up window will appear when you choose the “Copy” button. Select the “Expert Mode” button.

Step 4: In the “Expert Mode” area, check the box “QCOW (QEMU Copy-On-Write).” Then, click on the folder icon to open the save pop-up window.

Step 5: In the pop-up window, change the file extension from ‘.vdi’ or ‘.vmdk’ to 
‘.qcow2’. Then, click on the “Save” button to save the file.

Step 6: Upon selecting the “Save” button, select the “Copy” button to begin the conversion process. When the conversion is done, your VMDK will be a QCOW file ready to use on QEMU/KVM.

Convert QCOW back to VirtualBox format

To convert a QCOW to VDI, VHD, or VMDK, do the following. First, open up Virtual Media Manager. Then, click the “Add” button. Next, browse for the QCOW file on your computer to add it to the Virtual Media Manager.

Inside the Virtual Media Manager, select the QCOW drive, then click “Copy.” Keep it in “Guided Mode,” and choose VDI, VHD, or VMDK, then the “Next” button.

After selecting the “Next” button, click the “Copy” button to make the conversion.