Virtualization

RSS for tag

Create hardware-accelerated virtual machines to run macOS and Linux-based operating systems.

Posts under Virtualization tag

200 Posts

Post

Replies

Boosts

Views

Activity

Port forwarding with VZVmnetNetworkDeviceAttachment
I have the following code for port forwarding in mac os virtualization var ipAddr = in_addr() // 1. Convert String to in_addr inet_pton(AF_INET, guestIP, &ipAddr) let status = vmnet_network_configuration_add_port_forwarding_rule( config, UInt8(IPPROTO_TCP), // TCP protocol sa_family_t(AF_INET), // address family guestPort, // internal port (guest) externalPort, // external port (host) &ipAddr // internal address (guest IP) ) if status == .VMNET_SUCCESS { print("✅ Port Forwarding set: Mac:\(externalPort) -> VM(\(guestIP)):\(guestPort)") } else { print("❌ Port Forwarding failed for \(guestIP): \(status.rawValue)") } It is returning success but when i test it it does not work. Is there anything i am doing wrong? Please help me also in fixing this problem. Note: The app runs in sandbox i tried without sandboxing and it does not work either. Please refer to this link https://developer.apple.com/forums/thread/822025?login=true&page=1#884236022 how i am creating the VZVmnetNetworkDeviceAttachment
10
0
618
Jun ’26
Flatten DiskImageKit StackedImagee
Hi, I see that with mac os 27 we have diskimagekit https://developer.apple.com/documentation/DiskImageKit the stacked disk image gives us the possibility of creating incremental snapshots which is wonderful addition to the virtualization framework. But is there a way to merge back stacked image to base image? Thanks & Regards
2
0
281
Jun ’26
Can macOS 27 VMs be run on older versions of macOS?
As the title says, I'd like to run a macOS 27 VM on my Mac (the host is on macOS 26.5.1) in order to test my apps without having to update my host to a beta. My virtualization app of choice (VirtualBuddy) fails on installation when I use the restore image for macOS 27.0 (26A5353q) from the developer website. The developer of VirtualBuddy believes this is a macOS limitation (https://github.com/insidegui/VirtualBuddy/discussions/683). (I filed FB22977958, but I'm not sure if they filed their own bug.) Is there a workaround? It'd be very nice to have access to this during WWDC week. Usually I'd look for device support files on the developer website for download and/or install the Xcode beta first, but I've already installed the Xcode beta and there don't seem to be any device support files available.
1
1
251
Jun ’26
`mobileassetd` network activity
Is it possible to wait for mobileassetd to finish downloading from both macOS and within an iOS Simulator. We create a VM but as we boot them up regularly for CI jobs, if the VM on creation hadn't finished downloading a bunch of things we see network activity. Just wondering if a way exists to inspect the state of mobileassetd so we can wait for it to finish downloading stuff before completing the VM image build.
3
0
252
Jun ’26
Using Metal, IOSurface and Virtualization.framework
For a 3D workload going through Virtualization.framework's graphics device, what's the supported/expected path for the guest to drive host-side Metal rendering, and what are the known performance sharp edges? Is zero-copy IOSurface sharing between host and guest a sanctioned pattern? What are the best practices and limits for high-throughput texture handoff across the VM boundary? We translate a foreign 3D command stream into Metal on the host. Any guidance on command-buffer batching, synchronization, or present/vsync alignment to keep latency low?
1
0
142
Jun ’26
Using Metal, IOSurface and Virtualization.framework
For a 3D workload going through Virtualization.framework's graphics device, what's the supported/expected path for the guest to drive host-side Metal rendering, and what are the known performance sharp edges? Is zero-copy IOSurface sharing between host and guest a sanctioned pattern? What are the best practices and limits for high-throughput texture handoff across the VM boundary? We translate a foreign 3D command stream into Metal on the host. Any guidance on command-buffer batching, synchronization, or present/vsync alignment to keep latency low?
1
2
202
Jun ’26
Any way to speed up saveMachineStateTo and restoreMachineStateFrom
I'm trying to implement a VM snapshot & resume feature in a VM manager app. For some reason, both saveMachineStateTo and restoreMachineStateFrom to save machine memory to a file and restore saved vzstate/memory back for a VM is taking a lot of time on my system (XCode 26.3, macOS 15.7.7). The test VM has only sizes in the range of 4-8GB RAM. Any tips or tricky to speed it up, for example, do like a CoW on the RAM so VM can be briefly paused and quickly resumed after while streaming the RAM in background? Or, any other ways for example for RAM compression, dirty-page tracking, or live/background RAM streaming to a file? Or, to instrument and dig deeper, what's taking time? Thank you.
2
0
152
Jun ’26
Limitations for virtiofs and com.apple.virtio-fs.automount and Virtualization.framework
We're seeing limitations in host -> macOS VM changes syncing. Were using Anka, but we've also tried others. We're actually doing the exact implementation that others (the ones we found that are open source) do. Here is a breakdown of what's supported: Operation Direction Supported Notes Create new file/folder Host → Guest ✅ Yes New paths appear in the guest Create new file/folder Guest → Host ✅ Yes New paths appear on the host Read existing contents Host → Guest ✅ Yes Contents present at mount time are visible Modify file in place Guest → Host ✅ Yes Guest edits are written through to the host Modify file in place Host → Guest ❌ No Guest keeps stale contents for already-accessed files (macOS virtiofs caching) Delete file/folder Guest → Host ✅ Yes Removal is reflected on the host Delete file/folder Host → Guest ❌ No Guest still sees the path after the host deletes it (cached) Replace via temp + rename() (atomic) Host → Guest ✅ Yes New inode/dentry; recommended way to update files from the host We're requesting a way to disable caching and/or allow the unsupported actions in the table to be supported. https://feedbackassistant.apple.com/feedback/22905515
1
0
184
Jun ’26
IPSW for 15.7.7 missing
Hi, we're only seeing 15.6.1 IPSW available for VMs. Where can we find latest and secure versions of macOS IPSW on https://updates.cdn-apple.com/*/fullrestores/ ? Is there an official list somewhere that Apple provides? We need to be sure we can create the latest 15.7.7 VMs with automation and not rely on inner VM upgrades of MacOS.
3
0
195
May ’26
Nested virtualization support for macOS guests using VZMacPlatformConfiguration?
Hello, I filed Feedback FB22859649 about nested virtualization for macOS guests and would like to confirm the supported API surface / limitation through Developer Forums as well. We are using Virtualization.framework to run macOS guests on Apple silicon hosts. The use case is isolated macOS VM workspaces for development and AI-agent automation. In those workspaces, developers often need to run container or VM-backed tooling inside the guest, for example Apple Container workflows, Docker/Colima/Lima-style Linux VM workflows, local Kubernetes, CI sandboxes, testcontainers, or local MCP server stacks that expect hardware-assisted virtualization from inside macOS. Environment I used for the Feedback: Apple silicon host: MacBook Air with Apple M4 Host OS: macOS 26.5 build 25F71 Xcode: 26.5, macOS SDK 26.5 Guest type: macOS VM configured through Virtualization.framework with VZMacOSBootLoader and VZMacPlatformConfiguration From the current SDK headers, I see nested virtualization support exposed on VZGenericPlatformConfiguration via nestedVirtualizationSupported and nestedVirtualizationEnabled. VZMacOSBootLoader says a macOS guest must use VZMacPlatformConfiguration, and VZMacPlatformConfiguration does not appear to expose an equivalent nested virtualization property. Could Apple/DTS please confirm the intended support boundary? Is nested virtualization currently supported for macOS guests created with Virtualization.framework on Apple silicon using VZMacPlatformConfiguration? If not, should this be treated as an intentional current limitation of macOS guests / VZMacPlatformConfiguration rather than a missing configuration option? Is there a supported host-side API or validation behavior to detect this limitation before creating or starting the VM? Is there any supported workaround for container workflows inside a macOS guest that require a nested Linux VM or hypervisor, or is the recommended architecture to run those container/VM workloads on the host or in a Linux guest instead? I am not asking for roadmap or ETA. I am trying to document the correct supported behavior and avoid misleading users of macOS VM workspace tools when container or AI-agent workflows fail because the macOS guest cannot run its own virtualization backend. The broader impact is that disposable macOS VM workspaces are a strong isolation boundary for GUI automation, browser/app state, credentials, local files, and agent runtime state. Without a supported nested virtualization path, the GUI side of the workspace can run in a macOS guest, but common container-backed developer workflows have to move outside that workspace. Thank you.
1
0
250
May ’26
Port forwarding with VZVmnetNetworkDeviceAttachment
I have the following code for port forwarding in mac os virtualization var ipAddr = in_addr() // 1. Convert String to in_addr inet_pton(AF_INET, guestIP, &ipAddr) let status = vmnet_network_configuration_add_port_forwarding_rule( config, UInt8(IPPROTO_TCP), // TCP protocol sa_family_t(AF_INET), // address family guestPort, // internal port (guest) externalPort, // external port (host) &ipAddr // internal address (guest IP) ) if status == .VMNET_SUCCESS { print("✅ Port Forwarding set: Mac:\(externalPort) -> VM(\(guestIP)):\(guestPort)") } else { print("❌ Port Forwarding failed for \(guestIP): \(status.rawValue)") } It is returning success but when i test it it does not work. Is there anything i am doing wrong? Please help me also in fixing this problem. Note: The app runs in sandbox i tried without sandboxing and it does not work either. Please refer to this link https://developer.apple.com/forums/thread/822025?login=true&page=1#884236022 how i am creating the VZVmnetNetworkDeviceAttachment
Replies
10
Boosts
0
Views
618
Activity
Jun ’26
Flatten DiskImageKit StackedImagee
Hi, I see that with mac os 27 we have diskimagekit https://developer.apple.com/documentation/DiskImageKit the stacked disk image gives us the possibility of creating incremental snapshots which is wonderful addition to the virtualization framework. But is there a way to merge back stacked image to base image? Thanks & Regards
Replies
2
Boosts
0
Views
281
Activity
Jun ’26
Virtualization and Swift 6
There are some async/await methods in Virtualization; however there's also the ability to specific DispatchQueue. What's the guidance on using these all safely? What are use cases for specifying specific DispatchQueues?
Replies
3
Boosts
0
Views
363
Activity
Jun ’26
PCIe/Thunderbolt device delegation to Linux guest VM on Apple Silicon
Does Virtualization.framework support delegating a Thunderbolt/PCIe device to a Linux guest VM running on Apple Silicon? We're developing a custom PCIe device and would like to iterate on the driver in a Linux VM environment on the same host.
Replies
2
Boosts
0
Views
648
Activity
Jun ’26
Can macOS 27 VMs be run on older versions of macOS?
As the title says, I'd like to run a macOS 27 VM on my Mac (the host is on macOS 26.5.1) in order to test my apps without having to update my host to a beta. My virtualization app of choice (VirtualBuddy) fails on installation when I use the restore image for macOS 27.0 (26A5353q) from the developer website. The developer of VirtualBuddy believes this is a macOS limitation (https://github.com/insidegui/VirtualBuddy/discussions/683). (I filed FB22977958, but I'm not sure if they filed their own bug.) Is there a workaround? It'd be very nice to have access to this during WWDC week. Usually I'd look for device support files on the developer website for download and/or install the Xcode beta first, but I've already installed the Xcode beta and there don't seem to be any device support files available.
Replies
1
Boosts
1
Views
251
Activity
Jun ’26
`mobileassetd` network activity
Is it possible to wait for mobileassetd to finish downloading from both macOS and within an iOS Simulator. We create a VM but as we boot them up regularly for CI jobs, if the VM on creation hadn't finished downloading a bunch of things we see network activity. Just wondering if a way exists to inspect the state of mobileassetd so we can wait for it to finish downloading stuff before completing the VM image build.
Replies
3
Boosts
0
Views
252
Activity
Jun ’26
Restore Images History and Signing
Is there a way to retrieve restore images of previous versions of macOS and additionally checking whether a restore image is valid (i.e. signed) without attempting to install it?
Replies
1
Boosts
0
Views
222
Activity
Jun ’26
Virtual Machine observability
How do I run observability with virtual machines - internally, externally or both?
Replies
2
Boosts
0
Views
179
Activity
Jun ’26
Virtual Machine Boot Time
Do you have any tips for increasing the speed of a Virtual Machines boot time?
Replies
4
Boosts
0
Views
247
Activity
Jun ’26
MacOS 27 Beta on MacOS 26 system
Can a MacOS 27 beta VM run on MacOS 26 system?
Replies
3
Boosts
0
Views
227
Activity
Jun ’26
Why does entering recovery mode options in a 26/27 VM take ~1m?
For some strange reason entering recovery mode options in a 26/27 VM takes 1m, compared to ~10s on < 26 VMs. Any idea where this delay is coming from? I do not observe the same delay on real HW for 26/27. Thanks! FB22085236
Replies
1
Boosts
0
Views
147
Activity
Jun ’26
USB device access
Will we be able to access USB devices without private APIs?
Replies
2
Boosts
0
Views
206
Activity
Jun ’26
Using Metal, IOSurface and Virtualization.framework
For a 3D workload going through Virtualization.framework's graphics device, what's the supported/expected path for the guest to drive host-side Metal rendering, and what are the known performance sharp edges? Is zero-copy IOSurface sharing between host and guest a sanctioned pattern? What are the best practices and limits for high-throughput texture handoff across the VM boundary? We translate a foreign 3D command stream into Metal on the host. Any guidance on command-buffer batching, synchronization, or present/vsync alignment to keep latency low?
Replies
1
Boosts
0
Views
142
Activity
Jun ’26
Track Virtual Machines
Besides keeping a reference to all virtual machine objects, is there a way to track the state of virtual machines.
Replies
3
Boosts
1
Views
200
Activity
Jun ’26
Rosetta on Linux VMs
This is an important part of Mac's utility to developers who are integrating applications for the cloud, with software that only runs on linux AMD64. Is Rosetta for linux going away too, leaving us only slow emulation?
Replies
2
Boosts
1
Views
207
Activity
Jun ’26
Using Metal, IOSurface and Virtualization.framework
For a 3D workload going through Virtualization.framework's graphics device, what's the supported/expected path for the guest to drive host-side Metal rendering, and what are the known performance sharp edges? Is zero-copy IOSurface sharing between host and guest a sanctioned pattern? What are the best practices and limits for high-throughput texture handoff across the VM boundary? We translate a foreign 3D command stream into Metal on the host. Any guidance on command-buffer batching, synchronization, or present/vsync alignment to keep latency low?
Replies
1
Boosts
2
Views
202
Activity
Jun ’26
Any way to speed up saveMachineStateTo and restoreMachineStateFrom
I'm trying to implement a VM snapshot & resume feature in a VM manager app. For some reason, both saveMachineStateTo and restoreMachineStateFrom to save machine memory to a file and restore saved vzstate/memory back for a VM is taking a lot of time on my system (XCode 26.3, macOS 15.7.7). The test VM has only sizes in the range of 4-8GB RAM. Any tips or tricky to speed it up, for example, do like a CoW on the RAM so VM can be briefly paused and quickly resumed after while streaming the RAM in background? Or, any other ways for example for RAM compression, dirty-page tracking, or live/background RAM streaming to a file? Or, to instrument and dig deeper, what's taking time? Thank you.
Replies
2
Boosts
0
Views
152
Activity
Jun ’26
Limitations for virtiofs and com.apple.virtio-fs.automount and Virtualization.framework
We're seeing limitations in host -> macOS VM changes syncing. Were using Anka, but we've also tried others. We're actually doing the exact implementation that others (the ones we found that are open source) do. Here is a breakdown of what's supported: Operation Direction Supported Notes Create new file/folder Host → Guest ✅ Yes New paths appear in the guest Create new file/folder Guest → Host ✅ Yes New paths appear on the host Read existing contents Host → Guest ✅ Yes Contents present at mount time are visible Modify file in place Guest → Host ✅ Yes Guest edits are written through to the host Modify file in place Host → Guest ❌ No Guest keeps stale contents for already-accessed files (macOS virtiofs caching) Delete file/folder Guest → Host ✅ Yes Removal is reflected on the host Delete file/folder Host → Guest ❌ No Guest still sees the path after the host deletes it (cached) Replace via temp + rename() (atomic) Host → Guest ✅ Yes New inode/dentry; recommended way to update files from the host We're requesting a way to disable caching and/or allow the unsupported actions in the table to be supported. https://feedbackassistant.apple.com/feedback/22905515
Replies
1
Boosts
0
Views
184
Activity
Jun ’26
IPSW for 15.7.7 missing
Hi, we're only seeing 15.6.1 IPSW available for VMs. Where can we find latest and secure versions of macOS IPSW on https://updates.cdn-apple.com/*/fullrestores/ ? Is there an official list somewhere that Apple provides? We need to be sure we can create the latest 15.7.7 VMs with automation and not rely on inner VM upgrades of MacOS.
Replies
3
Boosts
0
Views
195
Activity
May ’26
Nested virtualization support for macOS guests using VZMacPlatformConfiguration?
Hello, I filed Feedback FB22859649 about nested virtualization for macOS guests and would like to confirm the supported API surface / limitation through Developer Forums as well. We are using Virtualization.framework to run macOS guests on Apple silicon hosts. The use case is isolated macOS VM workspaces for development and AI-agent automation. In those workspaces, developers often need to run container or VM-backed tooling inside the guest, for example Apple Container workflows, Docker/Colima/Lima-style Linux VM workflows, local Kubernetes, CI sandboxes, testcontainers, or local MCP server stacks that expect hardware-assisted virtualization from inside macOS. Environment I used for the Feedback: Apple silicon host: MacBook Air with Apple M4 Host OS: macOS 26.5 build 25F71 Xcode: 26.5, macOS SDK 26.5 Guest type: macOS VM configured through Virtualization.framework with VZMacOSBootLoader and VZMacPlatformConfiguration From the current SDK headers, I see nested virtualization support exposed on VZGenericPlatformConfiguration via nestedVirtualizationSupported and nestedVirtualizationEnabled. VZMacOSBootLoader says a macOS guest must use VZMacPlatformConfiguration, and VZMacPlatformConfiguration does not appear to expose an equivalent nested virtualization property. Could Apple/DTS please confirm the intended support boundary? Is nested virtualization currently supported for macOS guests created with Virtualization.framework on Apple silicon using VZMacPlatformConfiguration? If not, should this be treated as an intentional current limitation of macOS guests / VZMacPlatformConfiguration rather than a missing configuration option? Is there a supported host-side API or validation behavior to detect this limitation before creating or starting the VM? Is there any supported workaround for container workflows inside a macOS guest that require a nested Linux VM or hypervisor, or is the recommended architecture to run those container/VM workloads on the host or in a Linux guest instead? I am not asking for roadmap or ETA. I am trying to document the correct supported behavior and avoid misleading users of macOS VM workspace tools when container or AI-agent workflows fail because the macOS guest cannot run its own virtualization backend. The broader impact is that disposable macOS VM workspaces are a strong isolation boundary for GUI automation, browser/app state, credentials, local files, and agent runtime state. Without a supported nested virtualization path, the GUI side of the workspace can run in a macOS guest, but common container-backed developer workflows have to move outside that workspace. Thank you.
Replies
1
Boosts
0
Views
250
Activity
May ’26