Skip to content

QCOW2 virtual hard disk incorrectly identified as RAW format by EmuGUI #74

Open

Description

@end2endzone

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:
image

Activity

  1. end2endzone commented on Feb 16, 2024

    @end2endzone
    Author

    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.

  2. end2endzone commented on Feb 16, 2024

    @end2endzone
    Author

    Reproducible steps:

    1. Create a new VM called issue74.
    2. 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.
    3. 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
    4. 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
    5. 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.

  3. Tech-FZ commented on Feb 17, 2024

    @Tech-FZ
    Owner

    I covered this in another issue. Just create a RAW format disk instead of a QCOW2 one. This will make the VM survive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions