How to use qcow2 Image on Virtualbox

Posted on

This is an article written to display or to present about how to use qcow2 image file on Virtualbox. Basically, qcow2 image as far as I know it cannot be used directly to be started or to be booted when the qcow2 image itself is basically an operating system image. To be able to use it, first of all, the qcow2 image needs to be converted. Virtualbox can start or can boot image in the vdi file format. In order for a qcow2 file image can be utilized in the Virtualbox, these steps below must be executed properly :

1. Convert the qcow2 file image. Below is how to convert the file before it can be used in Virtualbox :

qemu-img convert -f qcow2 qcow2_file_name -O vdi vdi_file_name

The command pattern above which is used to convert file image from qcow2 format into vdi format can be executed in a real situation as follows :

user@hostname:~$ qemu-img convert -f qcow2 my-centos7.qcow2 -O vdi my-centos7.vdi
user@hostname:~$ du -sh my-centos7.vdi 
1,8G    my-centos7.vdi

2. Try to move the already converted qcow2 file image which has already been a vdi file image to the usual folder or directory where the vdi file image Virtualbox will usually stored. In Linux operating system, it is usually in /home/user/VirtualBox\ Vms :

user@hostname:~$ mv my-centos7.vdi /home/user/VirtualBox\ VMs/
user@hostname:~/$ cd /home/user/VirtualBox\ VMs/
user@hostname:~/$ ls -al

3. Try to add the file through Virtualbox. In the step of creating a new running virtual server, there is a step where the image must be added and be selected in order to proceed. It is depicted in the image below :

4. Select the image and click the Open button. It will then the following image will be presented :

4. The last step, just click the button OK to approve the image selected.

After finishing the above steps, just power up the virtual server which is being configured by selecting its image to be booted up.

Leave a Reply