This How-To will show you how to convert a .qcow2 virtual machine file to a VMware based .vmdk, using your Mac running MacOS.
Install “Homebrew” onto MacOS
For the easiest process, I’m going to use Homebrew on the Mac which installs lots of cool and useful “linux-y” stuff on your Mac. By installing Homebrew, we’ll be able to install the tools we need to perform the conversion of the file.
To install Homebrew, follow the instructions on their website here: https://brew.sh/ (which is a single command and is super easy).
Once that’s done, test your Homebrew installation by opening up a Terminal session on your Mac, and type “brew info“, which should return something like the below (the numbers might be different for your installation). This verifies that Homebrew is installed and working.
Using Homebrew to Install qemu-img
To convert the file from .qcow2 to .vmdk, we’ll need to use the command called “qemu-img“. The qemu-img application is part of the qemu package, so we can use Homebrew to install qemu by typing the following command:
brew install qemu
You’ll see lots of messages and notices go by stating that various software packages are being downloaded and installed in order to support qemu (which also has several dependencies). Homebrew takes care of all of this, and once completed, you’ll be able to use the qemu-img command.
Testing the “qemu-img” Command
After the installation finishes, you should be able to test the command by typing in:
You should get a screen just like the one below. This verifies that the qemu-img command is working.
Locate the VM File to Convert
Next, change directory to the location where the .qcow2 file is that you want to convert. For my example, the file I want to convert is located in my /Downloads/VM-to-convert/ directory, so I would use the following command to change to that directory:
Next, you can use the ls -alh command to list the files in that directory, showing sizes and additional information. In my example below, we can see that I have one .qcow2 file called “vm-that-i-need.qcow2” that is 2.9GB in size.
Using qemu-img to Convert the File
Now we’re ready to convert the file. Use the following command syntax to use qemu-img to convert the file from the qcow2 format to the vmdk format.
qemu-img convert -f qcow2 -O vmdk source-file-name.qcow2 target-file-name.vmdk
The “-f” variable tells qemu-img what format the source file is in.
The “-O” variable tells qemu-img what output format it should use.
You should replace “source-filename.qcow2” and “target-file-name.vmdk” with your filenames. You can name the vmdk file whatever you want.
Once it’s done, it should just return back to the command line, as shown in the below screenshot.
You can use the ls -alh command to view the file that it created. Or it is also viewable now in Finder.
Creating a New Virtual Machine with the Converted File
Now you are ready to use the vmdk file that you created.
Create a new virtual machine in VMware Fusion (if you are using this file on the Mac), and when prompted, choose the “Use an Existing Virtual Disk” option and select the button “Choose virtual disk“.
Browse to the directory where the converted vmdk file is located and select it.
There are a few options here about how you want to use the vmdk: do you want to make a copy of it? Or do you want to use that file directly?
I generally make a separate copy of the file so that I know my source file will remain untouched, just in case anything happens.
Starting the Virtual Machine
That’s it! After the Virtual Machine is created, you should be able to start it up!