How to add an existing virtual disk to Proxmox

It’s trivial to create virtual disks in Proxmox, but what if you want to add an existing disk to a new virtual machine?

The first step is to place the disk image into the directory belonging to the virtual machine, on my system that would be /var/lib/vz/images/<id>/

Obviously the disk image should be in one of the formats supported by Proxmox, such as qcow2 or raw. Use qemu-img convert to convert between formats.

Next, go to Proxmox and check if the disk shows up under “Hardware” as an unused disk:
In my experience, Proxmox doesn’t always detect the new disks automatically.

If that’s the case, you have to update your virtual machine configuration file manually. On my system it would be located at/etc/pve/qemu-server/<id>.conf

At the end of the file, add a new line in the following format:
unused0: local:<id>/<filename>

If the ID of your virtual machine was 102 and the filename of the new disk image was “virtual-machine.raw”, it would look like so:
unused0: local:102/virtual-machine.raw

Save the file and simply reopen the Hardware tab in Proxmox.

Once the new disk image shows up as an unused disk, you can double click on it and configure it for use with the virtual machine.

This entry was posted in How to’s and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *