Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripting: expose display config #6978

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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
1 participant