Proxmox is a fabulous hypervisor (or more properly, a fabulous management suite for the KVM hypervisor) but its storage model is a little strange. It works great unless you need to do something a little odd, and then it gets difficult to deal with. I wanted to install Volumio audio player as a centralized audio server in Proxmox, so I could use Snapcast to create a whole-house audio system. Volumio has a prebuilt x86 disk image (a
.img file) but Proxmox makes it very difficult to use that as a hard disk.
After attempting many other possible solutions, I discovered it would be next to impossible to do the classic trick of converting the
.img to a
.qcow2 hard disk thanks to the weirdness associated with KVM disks on a ZFS filesystem. Here is what I came up with:
- Create a new VM with two hard disks.
- Load an Ubuntu ISO in the disk drive (or something else, any live CD will work)
- Create a single EXT4 partition spanning the entire first hard disk, and mount it on your live system.
sudo apt install openssh-serverso you have SSH access to your system. You may have to use
passwdto set a password for the live user.
- From the PC you've downloaded the
.imgon, open an SFTP client (FileZilla will work) and visit
sftp://xubuntu@your-vm-ip:22to get access to the VM filesystem.
- Copy the
.imgfile to your EXT4 virtual hard drive mount.
- Now you have easy access to the
.img, and you have an unused, blank hard drive connected to the VM (the second virtual drive). So use
dd if=/path/to/my/image.img of=/dev/sdx status=progressto write the image file to your hard disk.
- Delete the first hard disk, remove the live CD, and reboot the VM. Enjoy your newly imaged hard disk!