You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
QCOW2 virtual hard disk incorrectly identified as RAW format by EmuGUI #74
I'm am using qcow2 image format for my virtual hard disks.
When I start the emulation through EmuGUI, way that the image is passed to qemu varies in different ways:
-hda "F:/test/test2_demo_foobar.qcow2"
-drive file="F:/test/test2_demo_foobar.qcow2",if=ide,media=disk (with an empty qcow2, if I force an IDE controller)
-drive format=raw,file="F:/test/test2_demo_foobar.qcow2" (once ubuntu is installed on the disk)
Note that the 3rd option is bad because it identifies the qcow2 image as raw bytes. This prevents qemu from booting using the image after an installation of ubuntu. If I make an installation over this, I will corrupt the qcow2 image with raw bytes. In other words, I will essentially use my qcow2 file as if I would have named it test2_demo_foobar.img.
I am still struggling to find the minimum reproducible steps to reproduce the issue. But I think it starts to go bad once I installed something on the VHD.
According to QEMU's documentation (here and here), raw and qcow2 are the preferred formats for virtual hard disk.
In the gui, when I edit the selected virtual machine, the virtual hard disk format is correctly identified as qcow2:
If I create a new VM and use the existing VHD test2_demo_foobar.qcow2, then I get the same issue. My image contains a minimum installation of ubuntu-22.04.2-desktop-amd64.iso.
At the VHD step, Create a new VHD in qcow2 format:
Click Browse button
Browse to the desired directory.
Change Save as type from default Hard disk file (*.img) to QCOW2 disk image (*.qcow2).
Enter a name issue74.qcow2.
EmuGUI correctly identifies qcow2 format (VHD file format drop down is has qcow2 selected).
Set a 16GB size.
Starts the virtual machine issue74 without any cdrom attached.
"C:/Program Files/qemu/qemu-system-x86_64w.exe" -m 8000 -smp 1 -k pci-ohci -hda "F:/test/issue74/issue74.qcow2" -net nic,model=e1000 -net user -boot c -device sb16
No issue so far
Starts the virtual machine issue74 with a small linux based os image cdrom attached (I personnaly tested with ubuntu-22.04.2-desktop-amd64.iso and openmediavault_7.0-20-amd64.iso)
Install the OS normally.
Shutdown the system
Starts the virtual machine issue74 without any cdrom attached.
"C:/Program Files/qemu/qemu-system-x86_64w.exe" -m 8000 -smp 8 -k pci-ohci -drive format=raw,file="F:/test/issue74/issue74.qcow2" -net nic,model=e1000 -net user -boot c -device sb16
EmuGUI identfies the image as RAW instead of QCOW2.
I also tried the following:
Starts the virtual machine issue74 with gparted-live-1.2.0-1-amd64.iso cdrom attached.
"C:/Program Files/qemu/qemu-system-x86_64w.exe" -m 8000 -smp 8 -k pci-ohci -hda "F:/test/issue74/issue74.qcow2" -net nic,model=e1000 -net user -cdrom "E:/iso_images/gparted-live-1.2.0-1-amd64.iso" -boot c -device sb16
Format the VHD as msdos partition table with an ext4 file system.
Shutdown the system
Starts the virtual machine issue74 without any cdrom attached.
EmuGUI still uses -hda "F:/test/issue74/issue74.qcow2" and qcow2 format is recognized by qemu.
In other worlds, just formatting the VHD does not trigger EmuGUI to incorrectly use the disk image as RAW. There is something else that I do not understand.
Activity
end2endzone commentedon Feb 16, 2024
If I create a new VM and use the existing VHD
test2_demo_foobar.qcow2, then I get the same issue. My image contains a minimum installation ofubuntu-22.04.2-desktop-amd64.iso.end2endzone commentedon Feb 16, 2024
Reproducible steps:
issue74.Save as typefrom defaultHard disk file (*.img)toQCOW2 disk image (*.qcow2).issue74.qcow2.qcow2selected).issue74without any cdrom attached."C:/Program Files/qemu/qemu-system-x86_64w.exe" -m 8000 -smp 1 -k pci-ohci -hda "F:/test/issue74/issue74.qcow2" -net nic,model=e1000 -net user -boot c -device sb16issue74with a small linux based os image cdrom attached (I personnaly tested withubuntu-22.04.2-desktop-amd64.isoandopenmediavault_7.0-20-amd64.iso)issue74without any cdrom attached."C:/Program Files/qemu/qemu-system-x86_64w.exe" -m 8000 -smp 8 -k pci-ohci -drive format=raw,file="F:/test/issue74/issue74.qcow2" -net nic,model=e1000 -net user -boot c -device sb16I also tried the following:
issue74withgparted-live-1.2.0-1-amd64.isocdrom attached."C:/Program Files/qemu/qemu-system-x86_64w.exe" -m 8000 -smp 8 -k pci-ohci -hda "F:/test/issue74/issue74.qcow2" -net nic,model=e1000 -net user -cdrom "E:/iso_images/gparted-live-1.2.0-1-amd64.iso" -boot c -device sb16issue74without any cdrom attached.-hda "F:/test/issue74/issue74.qcow2"and qcow2 format is recognized by qemu.In other worlds, just formatting the VHD does not trigger EmuGUI to incorrectly use the disk image as RAW. There is something else that I do not understand.
Tech-FZ commentedon Feb 17, 2024
I covered this in another issue. Just create a RAW format disk instead of a QCOW2 one. This will make the VM survive.