New macOS native VM - Curious resolution selection

Neat, looks like macOS Sonoma has native virtualisation now. You have to build a Swift app, which is a bit weird, but it works, and on an M1 chip.

One thing though... here's a screenshot of the Displays screen in Settings:

Curious why these two resolutions were decided. My host screen is 1920 x 1080, so one resolution is far too high, and the other is just a bit too small.

Something in between would be nice!

Here’s the guide if anyone wants to have a go: https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon

You’ll need macOS 14 Sonoma and Xcode 15 beta

Edit: Native M1 virtualization.

The display resolution comes from the virtual Mac configuration in the code sample.

If you look at the createGraphicsDeviceConfiguration() function, you will find:

graphicsConfiguration.displays = [
    // The system arbitrarily chooses the resolution of the display to be 1920 x 1200.
    VZMacGraphicsDisplayConfiguration(widthInPixels: 1920, heightInPixels: 1200, pixelsPerInch: 80)
]

which is how you get that resolution by default. You can set it to whatever you like.

In Sonoma, there is also a new way to resize the display automatically to match the view size. The WWDC session about Virtualization has more information: https://developer.apple.com/videos/play/wwdc2023/10007/?time=98

Thanks @BenjaminApple, after fiddling with the source, it all makes sense now. Also noiticed how to change the drive size.

For anyone else reading, if you don't need to use the libraries, I found a GUI that makes this easier: https://github.com/insidegui/VirtualBuddy/releases

New macOS native VM - Curious resolution selection
 
 
Q