Jump to content

sbeaudoin

Members
  • Posts

    6
  • Joined

  • Last visited

Community Answers

  1. sbeaudoin's post in qemu-img convert to QCOW2 not running on Unraid VMs was marked as the answer   
    It works now.  ChatGPT gave me the answer.  The question was :
     
     
    The answer was :
     
     
    So, the process is the following, for those interested :
     
    Stop the VM.   In a ssh session, go to the vDisk directory who should be : '/mnt/user/domains/[machine name]/" and you should see your vdisk file probably named 'vidks1.img'. Convert it to a qcow 2 format with the following command : qemu-img convert -f raw -O qcow2 vdisk1.img vdisk1.qcow2 The qcow2 extension is not necessary, it could still use the img extension, only the content of the file matters.  But as we need a different file name, I found it convenient to use this extension. Edit the vm xml file who should be at : '/etc/libvirt/qemu/[machine name].xml' after making a backup copy. In the "devices" element, find the child "disk" element where his child "source" element point to the original vdisk and change the path and type.  For example, for a vdisk at '/mnt/user/domains/srvr-windows/vdisk1.img'.  I had the following : <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback'/> <source file='/mnt/user/domains/srvr-windows/vdisk1.img'/> <target dev='hdc' bus='virtio'/> <serial>vdisk1</serial> <boot order='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </disk>  
            I changed the file attribute of the source element to point to the qcow2 file and I changed the type attribute of the driver element to qcow2.
     
    <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='writeback'/> <source file='/mnt/user/domains/srvr-windows/vdisk1.qcow2'/> <target dev='hdc' bus='virtio'/> <serial>vdisk1</serial> <boot order='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </disk> And the missing element given to me by chatGPT is to execute the following command to make the virtualization platform aware of the change : virsh define /etc/libvirt/qemu/[machine name].xml  
            The file path is the same you edited and it should answer you with :
     
    Domain '[machine name]' defined from /etc/libvirt/qemu/[machine name].xml You can then start your VM and after the confirmation of success, confirm the vm configuration in the GUI that the path is really the qcow2 file before removing the img file at '/mnt/user/domains/[machine name]/vidks1.img'.  Press F5 to refresh the page and confirm it again.  Just in case... Disclaimer : I leave these instructions to help, not to maintain it or to support anyone else.  It is POSSIBLE I intervene though...
     
    Enjoy.
×
×
  • Create New...