utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
26.51k stars 1.33k forks source link

Allow for complete override of GUI-set QEMU arguments #4102

Open CONIGUERO opened 2 years ago

CONIGUERO commented 2 years ago

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:

osy commented 2 years ago

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

osy commented 2 years ago

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.

CONIGUERO commented 2 years ago

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 commented 2 years ago

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.

osy commented 2 years ago

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.

CONIGUERO commented 2 years ago

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.

osy commented 2 years ago

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.

CONIGUERO commented 2 years ago

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.

eugenialoli commented 1 year ago

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).

Myersj281 commented 1 year ago

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.

osy commented 1 year ago

@Myersj281 In Display under hardware select QXL.

anishp55 commented 1 year ago

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.

osy commented 1 year ago

Select bridged and select your network adapter.

jlforester commented 3 months ago

@osy That works if the GUI shows you the interface you want to add. If not, you're out of luck. In my case, when configuring bridged mode, I get two choices: Automatic and en0. The interface I need to use doesn't show up in the list.

I don't understand the resistance to adding an Edit button and letting users edit the options to their heart's content with a stern warning that doing so is unsupported and they could render their VM unusable. You could also provide a "Rescue" button to regenerate the command line options from the config. Not every user needs or wants to be protected from themselves.

sentient06 commented 1 month ago

I agree. I was trying to add -device VGA,edid=on to the list. I know it works and I use it outside of UTM. But I can't override the display settings on UTM. I tried to remove the display settings entirely using the GUI and re-add manually, and that crashed the application. What gives? Why is this so complicated?