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:
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:
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.