Single ZFS based storage - How to move in VM image?

Brian Read

Renowned Member
Jan 4, 2017
130
11
83
76
I am trying to install a Virtual Box image on to Proxmox. I have converted it to .raw format, created a VM in proxmox of the same size etc, and now need to overwrite the hard drive image on the Proxmox system with the one from Virtual Box (converted to .raw).

In the GUI the local-zfs (pve) / content screen does not allow me to upload or overwrite the image. I've also tried ssh in the proxmox box, but of course the images do not show up in a console.

I've done this in past by having two disc image areas, one that is LVM based, and one that is for raw files (zfs, and then copied it in to the LVM based area and used the GUI to move it.

However my current installation does not have the LVM disc image are only the raw file ZFS area. How can I access the raw file to overwrite it?
 
If I understand what you're trying to do correctly, I believe the dd command will work here. Proxmox uses zvols for virtual disks on ZFS file systems. In order to access those, you'll want to look in /dev/zvol/rpool/. In there you will find a reference to each virtual disk. For example, we'll use vm-100-disk-1.

Code:
dd bs=1M if=/path/to/VirtualBoxFile.raw of=/dev/zvol/rpool/vm-100-disk-1

That should set you up nicely.
 
I think the last bit ought to be:

of=/dev/zvol/rpool/data/vm-100-disk-1

.. and it worked - many thanks.