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

Multi display support #590

Open
tmandry opened this issue Aug 20, 2023 · 6 comments
Open

Multi display support #590

tmandry opened this issue Aug 20, 2023 · 6 comments
Labels
enhancement New feature or request not possible atm Not possible at the moment

Comments

@tmandry
Copy link

tmandry commented Aug 20, 2023

I'd like to use tart for integration testing of software that enumerates and keeps track of system displays. Multi display is a key use case for testing.

I think Virtualization.Framework supports this, so it's a matter of exposing it from the CLI. Anka has support for configuring up to 2 displays, both with the same resolution, which is probably good enough.

@fkorotkov fkorotkov added the enhancement New feature or request label Aug 21, 2023
@edigaryev
Copy link
Collaborator

edigaryev commented Aug 21, 2023

Would adding a repeatable --display argument to the tart run command suffice for your use-case?

The way it'd work is when specifying --display once, tart run would use that settings for the primary display, instead of the ones from config.json, provided by tart set earlier.

Providing the --display argument more than once would configure more than one display for a VM.

@tmandry
Copy link
Author

tmandry commented Aug 22, 2023

That sounds reasonable.. it would need to be possible to configure multiple displays for CI jobs, though (Github Actions or Cirrus CI).

@fkorotkov
Copy link
Contributor

Alternatively we can support a comma-separated list of resolutions for tart set --display 1200x800,1600x1600 ventura-base. Cirrus CI supports CIRRUS_DISPLAY environment variable for setting the display resolution. What do you all think?

@barkingfoodog
Copy link
Contributor

barkingfoodog commented Aug 22, 2023

I like the format of the single --display argument with a comma-separated list of resolutions. Would the first display always be considered primary by macOS?

Edit: (Not my PR, but I'm watching the project and multiple displays would be useful for us as well).

@fkorotkov fkorotkov assigned fkorotkov and edigaryev and unassigned edigaryev and fkorotkov Aug 22, 2023
@tmandry
Copy link
Author

tmandry commented Aug 22, 2023

What do you all think?

Sounds good!

Would the first display always be considered primary by macOS?

I think that should be fine. The displays can be rearranged using these APIs so the main display is not always the one on the left.

@edigaryev
Copy link
Collaborator

edigaryev commented Aug 23, 2023

Alternatively we can support a comma-separated list of resolutions for tart set --display 1200x800,1600x1600 ventura-base.

I was a bit reluctant to preserve the multiple display configuration in the VM's configuration file (which gets pushed to the OCI registry), so I've decided to see how Tart and Virtualization.Framework handles these cases, and it turns out that Virtualization.Framework does not support multiple displays for macOS guests 🤦

You get the following error when configuring a VM with VZMacGraphicsDeviceConfiguration() that has more than one VZMacGraphicsDisplayConfiguration() in it's .displays = []:

Error: Invalid virtual machine configuration. More than one display is configured.

And the following error when configuring a VM with two VZMacGraphicsDeviceConfiguration() that have each a single VZMacGraphicsDisplayConfiguration() attached:

Error Domain=VZErrorDomain Code=1 "The virtual machine failed to start." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=The virtual machine failed to start.}

UTM documentation says that:

Apple backend (macOS guests) does not support multiple graphical displays.

Regarding Anka:

Anka has support for configuring up to 2 displays, both with the same resolution, which is probably good enough.

Anka fails to start the VM after running anka modify <vmid> display -n 2 and reports no error.

Running anka modify <vmid> display -n 1 makes the VM startable again.

@edigaryev edigaryev removed their assignment Aug 23, 2023
@edigaryev edigaryev added the not possible atm Not possible at the moment label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request not possible atm Not possible at the moment
Projects
None yet
Development

No branches or pull requests

4 participants