Skip to content

scripting: expose display config#6978

Merged
osy merged 1 commit intoutmapp:mainfrom
naveenrajm7:script-display
Apr 7, 2025
Merged

scripting: expose display config#6978
osy merged 1 commit intoutmapp:mainfrom
naveenrajm7:script-display

Conversation

@naveenrajm7
Copy link
Contributor

Fixes #6660

  • qemu display
    • All fields , except vga ram is exposed
  • apple display
    • only dynamic resolution property is exposed.
    • From GUI , the height, width and pixel of resolution is in pre-defined ratio and hence not exposed.

Both displays will have ids, which can be used to track and detach the displays.

Usage:

add_qemu_display.applescript

on run argv
  set vmName to item 1 of argv
  tell application "UTM"
      set vm to virtual machine named vmName
      set config to configuration of vm
      set currentDisplay to displays of config

      set newDisplay to ¬
          { ¬
              hardware: "virtio-gpu-pci", ¬
              dynamic resolution: false, ¬
              native resolution: true, ¬
              upscaling filter: "QsLi", ¬
              downscaling filter: "QsNe" ¬
          }
      
      set end of currentDisplay to newDisplay
      set displays of config to currentDisplay
      update configuration of vm with config
  end tell
end run

clear_qemu_display.applescript

on run argv
  set vmName to item 1 of argv
  tell application "UTM"
      set vm to virtual machine named vmName
      set config to configuration of vm
      -- clear all displays      
      set displays of config to {}
      update configuration of vm with config
  end tell
end run

add_apple_display.applescript

on run argv
  set vmName to item 1 of argv
  tell application "UTM"
      set vm to virtual machine named vmName
      set config to configuration of vm
      set newDisplay to {dynamic resolution: true}
      -- Apple Configuration supports only one display
      set displays of config to newDisplay
      update configuration of vm with config
  end tell
end run

qemu display
- All fields , except vga ram is exposed
apple display
- only dynamic resolution property is exposed.
- From GUI , the height, width and pixel of resolution is in pre-defined ratio as hence not exposed.

Both display will have id, which can be used to track and ditach the displays.
@naveenrajm7
Copy link
Contributor Author

This is a missing piece for the automated VM build naveenrajm7/packer-plugin-utm#5

@davidvasandani
Copy link

@osy, can this be merged, and if not, how can we help?

@naveenrajm7, do you have a signed build that we can help test?

@osy
Copy link
Contributor

osy commented Mar 26, 2025

@davidvasandani it will be merged in the next release, which is currently blocked on us getting a Windows driver signing certificate

@davidvasandani
Copy link

Hi @osy, is there an ETA for UTM to receive a Windows driver signing certificate, and is there anything we can do to help?

I'll build UTM using a self-signed cert if the ETA is unknown. Thanks for all your hard work!

@osy
Copy link
Contributor

osy commented Apr 3, 2025

@davidvasandani I'm hoping to submit an update sometime end of next week and it'll take some more time for Apple to approve it

@osy osy merged commit 2b86f67 into utmapp:main Apr 7, 2025
27 checks passed
@naveenrajm7 naveenrajm7 deleted the script-display branch April 13, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scripting: Add/Update/Remove displays

3 participants