Archive for July, 2024

Jul 13 2024

proxmox import vm from kvm

Create a new VM in the web interface (leave other settings as default)
copy VM disk to proxmox (ex. using terminal) and import it to newly created VM machine
qm importdisk machine_id_number /var/lib/vz/images/file.qcow local-zfs
qm rescan

Go to your new created VM in the proxmox web interface.
Go to the Hardware section of the newly created VM in the Proxmox web interface
Look for the Unused Disk and select it.
Then you have to add the disk by clicking on Edit on the top.

Jul 13 2024

Reducing the size of a QEMU virtual disk (thin disk)

On all mounting points
dd if=/dev/zero of=/nul;sync;sync;sync;rm -f /nul;sync

    Stop VM
    Convert disk

qemu-img convert -O qcow2 -c disk1.qcow disk1.new.qcow