UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Allow for complete override of GUI-set QEMU arguments

Open CONIGUERO opened this issue 2 years ago • 14 comments

There are times in which it's necessary to add parameters to the "core" qemu arguments apart from the "machine" one, for example with -device vga,edid=on and many others.

Many of these optional params are not available in the settings GUI, and since the core arguments are locked down to the options specified in the VM settings it's impossible to ever run a vm with them.

I propose the following solution:

  • Let the user customize all the QEMU arguments through the QEMU tab
  • Add up/down arrows on all the arguments so that the user can easily customize the order as if they were writing it on the command line
  • When an argument that doesn't have a GUI equivalent is detected, add a "Custom" label to the corresponding UI dropdown menu/box in the settings panel to indicate that the argument/setting is currently mapped to a custom value that doesn't have a GUI equivalent yet.
  • Allow the user to override their custom arguments by simply selecting a known configuration parameter from the GUI again.

CONIGUERO avatar Jun 07 '22 23:06 CONIGUERO

So this is exactly what “Do not generate any arguments based on current configuration” does.

osy avatar Jun 08 '22 00:06 osy

Can you describe your use case for “-device vga,edid=on”? If it’s a valid use case, it should be added to the GUI.

osy avatar Jun 08 '22 00:06 osy

So this is exactly what “Do not generate any arguments based on current configuration” does.

AFAIK that option doesn't allow you to modify any of the core arguments, does it?

CONIGUERO avatar Jun 08 '22 00:06 CONIGUERO

Can you describe your use case for “-device vga,edid=on”? If it’s a valid use case, it should be added to the GUI.

That was just an example. One valid use case for such options is to disable auto-boot on PowerPC guests using the -prom-env 'auto-boot?=false' argument. In order to successfully install Mac OS X developer preview 3, you need to select a specific partition inside the ISO to boot from, because the default one boots into an incompatible environment.

CONIGUERO avatar Jun 08 '22 01:06 CONIGUERO

So this is exactly what “Do not generate any arguments based on current configuration” does.

AFAIK that option doesn't allow you to modify any of the core arguments, does it?

It doesn't let you modify anything that is required for UTM to work. Every argument on that list, if you modify it at all, it won't work.

Can you describe your use case for “-device vga,edid=on”? If it’s a valid use case, it should be added to the GUI.

That was just an example. One valid use case for such options is to disable auto-boot on PowerPC guests using the -prom-env 'auto-boot?=false' argument. In order to successfully install Mac OS X developer preview 3, you need to select a specific partition inside the ISO to boot from, because the default one boots into an incompatible environment.

For that one, I think adding a new argument is fine. The idea is anything that is "core" (like VGA settings) should be a GUI option and if there's a valid use case there, it should be added to the GUI rather than as a text argument.

osy avatar Jun 08 '22 01:06 osy

For that one, I think adding a new argument is fine. The idea is anything that is "core" (like VGA settings) should be a GUI option and if there's a valid use case there, it should be added to the GUI rather than as a text argument.

I also agree that it should be made into a GUI option. My point is that for more advanced use cases that don't yet (or ever) have GUI options it should be allowed for the user to modify them as if it was a command-line invocation. And for the ones that do already have a GUI, manual modification should also still be allowed as an "advanced" mode, since the current configuration override doesn't cover for the options in the beginning of the command and as I said there are many valid use-cases for modifying them.

It could also help with development since it would be easier to test different QEMU options faster.

CONIGUERO avatar Jun 08 '22 01:06 CONIGUERO

So we have -machine property as its own field. We could add something similar to the -device vga. However, like I said, most of the other options you can't change.

qemu-system-x86_64 -L /Applications/UTM.app/Contents/Resources/qemu -S -spice "unix=on,addr=....spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=off" -chardev spiceport,id=org.qemu.monitor.qmp,name=org.qemu.monitor.qmp.0 -mon chardev=org.qemu.monitor.qmp,mode=control -nodefaults -vga none -device virtio-vga

If you look at these options, none of them except -device virtio-vga has anything you can add to or change.

osy avatar Jun 08 '22 02:06 osy

I guess that's right. I was also thinking of the -g option which allows you to set a static resolution for the machine display. I appended it through the additional options menu but it didn't have any effect still.

CONIGUERO avatar Jun 08 '22 02:06 CONIGUERO

I would like UTM to let us edit that qemu command line. I had multiple OSes that simply were not possible to run on UTM because it wouldn't let us change the qemu line. Some of these include the latest GNU Hurd (it's hardcoded to hd0 disks, but UTM would only produce sd0 disks no matter which type of disk chosen, and so booting would fail), and Raspbian with hypervisor (it complains about EL3 being On, and that it can't find PCI to use the network card).

eugenialoli avatar Jul 02 '23 04:07 eugenialoli

My use case is different from Conigueros, but I think it presents a valid case for their proposed fix. In my case, I need the argument "-vga qxl" to allow Wayland to work under Debian 12, I've tried editing my current VM and creating new ones to set this option and haven't figured out any way to do it.

Myersj281 avatar Jul 17 '23 13:07 Myersj281

@Myersj281 In Display under hardware select QXL.

osy avatar Jul 17 '23 14:07 osy

i really would like to be able to tell UTM what network device to use, i currently cannot figure out how to do this. i have 3 different network connections, 1 wifi for general. 1 ethernet for my home network and device, and another that is for my lab stuff. I would like to assign this VM to my Lab network and its currently impossible with UTM from what i can tell.

anishp55 avatar Sep 20 '23 21:09 anishp55

Select bridged and select your network adapter.

osy avatar Sep 20 '23 22:09 osy