Tech-FZ / EmuGUI

A QEMU GUI that I made.
https://tech-fz.github.io/EmuGUI-doc/
GNU General Public License v3.0
103 stars 10 forks source link

Failed creating qcow2 image on first creation of VM #73

Open end2endzone opened 4 months ago

end2endzone commented 4 months ago

I just found out about EmuGUI. Seems like a good product. Also a great alternative to handing multiple qemu configuration compared to batch files.

I am using qemu 8.2.0 installed on Windows in default directory: C:\Program Files\qemu.

On first application launch, I went and configured qemu-img path to C:/Program Files/qemu/qemu-img.exe and x86_64 path to C:/Program Files/qemu/qemu-system-x86_64w.exe. I then created a sample VM. For the VHD, I selected "Create New..." and specified a sample path for the qcow2 image: F:/test/qemy_test.qcow2 with a maximum size of 16GB. Clicked OK.

The qcow2 image is not created. The following warnings are shown in the console window:

2024-03-31
EmuGUI 1.2.3.5513
Current date: 2024-02-15
OS: Windows 10, Version 10.0.19045
CPU: 16x AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD @3.71 GHz (AMD64)
RAM: 68505296896 bytes (63.8 GB)
Python: 3.11.7 tags/v3.11.7, compiled with MSC v.1937 64 bit (AMD64)

[...]

Connection established.
17179869184
The query was executed successfully, but the virtual disk couldn't be created. Trying to use subprocess.run
The virtual disk could not be created. Please check if the path and the QEMU settings are correct.
The query was executed successfully.
The VM list was updated successfully.

I don't really know why EmuGUI cannot call qemu-img.exe.

end2endzone commented 4 months ago

Is it because of the space in qemu's installation directory?

I am able to create the disk image manually with the following command:

Microsoft Windows [Version 10.0.19045.4046]
(c) Microsoft Corporation. All rights reserved.

C:\Users\JohnDoe>"C:\Program Files\qemu\qemu-img.exe" create -f qcow2 F:/test/qemy_test.qcow2 16G
Formatting 'F:/test/qemy_test.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=17179869184 lazy_refcounts=off refcount_bits=16
end2endzone commented 4 months ago

Note that you application uses GB for gigabytes unit in the gui. However, qemu-img is expecting G for gigabytes:

C:\Users\JohnDoe>"C:\Program Files\qemu\qemu-img.exe" create -f qcow2 F:/test/foobar.qcow2 16GB
C:\Program Files\qemu\qemu-img.exe: Invalid image size specified. You may use k, M, G, T, P or E suffixes for
C:\Program Files\qemu\qemu-img.exe: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.

I'm not saying this is the actual issue. I am just brainstorming about plausible possibilities.

end2endzone commented 4 months ago

I'm sorry. I just realized there is an Apply button at the bottom of the Settings / QEMU tab. I did not noticed the button since it was aligned with the other browse buttons. Now that I know that, the warning message Please check if the path and the QEMU settings are correct. makes more sense. I actually validated my paths and did not understood why I was still getting this message. If I do click the Apply button, the paths are properly saved and creating an image file works as expected. My fault.

Would you consider disaligning the Apply button to make it stand out from the Browse buttons ? For example, you could show the button horizontally centered or leave it vertically aligned but add a blank space between the Apply and Browse buttons. I will leave the issue open in case you find these suggestions worth fixing. Otherwise, feel free to close the issue.

Tech-FZ commented 4 months ago

Idk if I can actually disalign the Apply button, but I can try to add icons.