Hi team,
I was trying to launch Virtual machine on MacOS 14 using native framework with different Resolutions.
let graphicsConfiguration = VZMacGraphicsDeviceConfiguration()
graphicsConfiguration.displays = [
VZMacGraphicsDisplayConfiguration(widthInPixels: 2700, heightInPixels: 2200, pixelsPerInch: 100),
VZMacGraphicsDisplayConfiguration(widthInPixels: 1920, heightInPixels: 1200, pixelsPerInch: 80)
]
return graphicsConfiguration
}
But I'm getting below error:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=VZErrorDomain Code=2 "More than one display is configured." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=More than one display is configured.}
Please let me know it is possible to have multiple resolutions in single VM or not. My use case is to get support of multiple resolutions like 1920x1080, 2048x1536, 1024x728 etc.
Thanks.
But I'm getting below error: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=VZErrorDomain Code=2 "More than one display is configured." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=More than one display is configured.}
Yes. Currently, you can only have a single VZGraphicsDeviceConfiguration in VZMacGraphicsDeviceConfiguration.displays. In concrete terms, this means you can only have a single monitor attached to the VM.
Please let me know it is possible to have multiple resolutions in single VM or not. My use case is to get support of multiple resolutions like 1920x1080, 2048x1536, 1024x728 etc.
It is, but you're looking at the wrong API. VZMacGraphicsDeviceConfiguration is what establishes the initial starting configuration. You change the resolution on the live machine through by going through VZVirtualMachine.graphicsDevices -> VZGraphicsDevice.displays -> VZGraphicsDisplay.reconfigure(sizeInPixels:) or VZGraphicsDisplay.reconfigure(configuration:). Note that you can also use VZVirtualMachineView.automaticallyReconfiguresDisplay to have these display changes occur automatically as the user resizes the view.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware