Post

Replies

Boosts

Views

Activity

Programmatic IP Discovery for VZVirtualMachine in an App Store Sandbox
Hi everyone, I am developing a macOS virtualization manager (VirtualProg) using the Virtualization.framework. The application is distributed via the Mac App Store, so it operates strictly within the App Store Sandbox. I am looking for a reliable, programmatic way to discover the IP address assigned to a guest (both macOS and Linux). Is there a recommended "Sandbox-safe" API or pattern within the Virtualization framework—or a lower-level networking entitlement—that allows a host application to retrieve the guest's assigned IP address? Ideally, I am looking for a solution that does not require the user to manually install a non-sandboxed helper tool. Thanks in advance for any insights or guidance!
21
0
1.2k
5h
AAUSBAccessoryManager does not fire didconnect
Hi, I am trying to use AAUSBAccessoryManager with mac os 27 to connect host usb device to guest vm. here is my code // // USBPassthroughManager.swift // VirtualProg import AccessoryAccess import Foundation import IOKit @available(macOS 27.0, *) class USBPassthroughManager: NSObject, ObservableObject, AAUSBAccessoryListener { static let shared = USBPassthroughManager() @Published var availableDevices: [AAUSBAccessory] = [] func startListening() async { do { let existing = try await AAUSBAccessoryManager.shared .registerListener(self, matchingCriteria: []) await MainActor.run { self.availableDevices = existing } } catch { LogManager.shared.log(vmName: AppConstants.logGeneral, type: .error, message: "USB passthrough listener failed: \(error.localizedDescription)") } } func usbAccessoryDidConnect(_ usbAccessory: AAUSBAccessory) { DispatchQueue.main.async { guard !self.availableDevices.contains(where: { $0.registryID == usbAccessory.registryID }) else { return } self.availableDevices.append(usbAccessory) print(self.displayName(for: usbAccessory)) } } The usb icon in status bar menu is displayed and i can select the the usb device to connect to my app. the usb device is connected to my app. it is shown in the status bar. but usbAccessoryDidConnect is not firing. i have the entitlement com.apple.developer.accessory-access.usb in the capabilities. i get this in the xcode console start failed ((iokit/common) not permitted) for plugin for .......... and also disconnect is also not firing. Not sure what i am doing wrong. How can i determine the name of the USB Device from AAUSBAccessory. Any help would be appreciated. Thanks
4
0
103
7h
Provisioning with Virtualization framework fails with Threading warning
Hi, I saw the mac os 27 new features video https://developer.apple.com/videos/play/wwdc2026/224/?time=64 and was trying Provisioning and i get this warning [Internal] Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions at the line try startupOptions.setGuestProvisioning(opts) i have my vm q declared like this let vmQueue = DispatchQueue(label: "VZVirtualMachineQueue", qos: .userInteractive) and i am executing like this self.vmQueue.async { [weak self] in ......... ......... let startupOptions = VZMacOSVirtualMachineStartOptions() try? startupOptions.setGuestProvisioning(opts) vm.start(startupOptions) } and it fails with treading warning and provisioning does not happen. Thanks in advance for the help
4
0
89
7h
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
368
4d
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
95
5d
Host-Only Networking and Port Forwarding Support in macOS Virtualization Framework
I’ve developed a virtual machine manager application using the macOS Virtualization framework. The application currently supports both NAT and bridged networking configurations. I’m now looking to implement host-only networking, where the guest VM can communicate with the host but not with external networks. Is this networking mode supported by the Virtualization framework, and if so, what is the recommended approach to set it up? Additionally, I would like to implement port forwarding from the host to the guest (e.g., redirecting traffic from a specific port on the host to a port on the guest). Is there a way to configure port forwarding using the built-in APIs of the Virtualization framework, or would this require a custom networking solution? Any guidance or best practices for implementing these features within the constraints of the framework would be greatly appreciated.
7
0
438
3w
VZVirtualMachineView and rightMouseDown
Hi, I am displaying the running linux ubuntu VM in VzVirtualMachineView. I wouldl like to simulate right click by calling vZVirtualMachineView.rightMouseDown to trigger right click on the guest. I tried it and it does not work. For mac os guests it is working. For linux guests it is not working Any help would be appreciated to fix the issue.
5
0
286
4w
VZVirtualMachine with multiple displays
I see that in the link https://developer.apple.com/documentation/virtualization/vzvirtualmachineconfiguration/graphicsdevices?changes=late_7_8 graphicsDevices accepts and array. So it is possible to have multiple displays for a virtual machine. But when i tried it with multiple displays it does not work. Why do we have it as an array if it does not support multiple displays.? or how to get it work with multiple displays.
1
0
128
May ’26
Windows 11 Support in macOS Virtualization Framework
Hello, According to the official documentation, the macOS Virtualization Framework currently supports only macOS and Linux guest operating systems. I would like to know if there is any way—officially or through a supported workaround—to run Windows 11 as a guest using this framework. Additionally, is there any indication or roadmap suggesting that support for Windows guests might be introduced in a future release, such as in macOS 16? Any insights or official clarification would be greatly appreciated. Thank you.
5
0
349
May ’26
deduplicated_symbol error
HI, I have a Swift UI app in the mac appstore in the upcoming release we have made lots of changes and it is working fine in debug mode but in production with testflight or direct distribution we are getting the following crash while working in the app. this is happening in the rendering phase. Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libswiftCore.dylib 0x19546f270 swift_unknownObjectRetain + 44 1 libswiftCore.dylib 0x1954bb09c swift_cvw_initWithCopyImpl(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*) + 280 2 libswiftCore.dylib 0x1958f685c initializeWithCopy for ClosedRange<>.Index + 212 3 VirtualProg 0x104d73958 <deduplicated_symbol> + 56 How can i debug to find out what is causing the issue and fix it?. thanks in advance
2
0
290
Apr ’26
Programmatic IP Discovery for VZVirtualMachine in an App Store Sandbox
Hi everyone, I am developing a macOS virtualization manager (VirtualProg) using the Virtualization.framework. The application is distributed via the Mac App Store, so it operates strictly within the App Store Sandbox. I am looking for a reliable, programmatic way to discover the IP address assigned to a guest (both macOS and Linux). Is there a recommended "Sandbox-safe" API or pattern within the Virtualization framework—or a lower-level networking entitlement—that allows a host application to retrieve the guest's assigned IP address? Ideally, I am looking for a solution that does not require the user to manually install a non-sandboxed helper tool. Thanks in advance for any insights or guidance!
Replies
21
Boosts
0
Views
1.2k
Activity
5h
AAUSBAccessoryManager does not fire didconnect
Hi, I am trying to use AAUSBAccessoryManager with mac os 27 to connect host usb device to guest vm. here is my code // // USBPassthroughManager.swift // VirtualProg import AccessoryAccess import Foundation import IOKit @available(macOS 27.0, *) class USBPassthroughManager: NSObject, ObservableObject, AAUSBAccessoryListener { static let shared = USBPassthroughManager() @Published var availableDevices: [AAUSBAccessory] = [] func startListening() async { do { let existing = try await AAUSBAccessoryManager.shared .registerListener(self, matchingCriteria: []) await MainActor.run { self.availableDevices = existing } } catch { LogManager.shared.log(vmName: AppConstants.logGeneral, type: .error, message: "USB passthrough listener failed: \(error.localizedDescription)") } } func usbAccessoryDidConnect(_ usbAccessory: AAUSBAccessory) { DispatchQueue.main.async { guard !self.availableDevices.contains(where: { $0.registryID == usbAccessory.registryID }) else { return } self.availableDevices.append(usbAccessory) print(self.displayName(for: usbAccessory)) } } The usb icon in status bar menu is displayed and i can select the the usb device to connect to my app. the usb device is connected to my app. it is shown in the status bar. but usbAccessoryDidConnect is not firing. i have the entitlement com.apple.developer.accessory-access.usb in the capabilities. i get this in the xcode console start failed ((iokit/common) not permitted) for plugin for .......... and also disconnect is also not firing. Not sure what i am doing wrong. How can i determine the name of the USB Device from AAUSBAccessory. Any help would be appreciated. Thanks
Replies
4
Boosts
0
Views
103
Activity
7h
Provisioning with Virtualization framework fails with Threading warning
Hi, I saw the mac os 27 new features video https://developer.apple.com/videos/play/wwdc2026/224/?time=64 and was trying Provisioning and i get this warning [Internal] Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions at the line try startupOptions.setGuestProvisioning(opts) i have my vm q declared like this let vmQueue = DispatchQueue(label: "VZVirtualMachineQueue", qos: .userInteractive) and i am executing like this self.vmQueue.async { [weak self] in ......... ......... let startupOptions = VZMacOSVirtualMachineStartOptions() try? startupOptions.setGuestProvisioning(opts) vm.start(startupOptions) } and it fails with treading warning and provisioning does not happen. Thanks in advance for the help
Replies
4
Boosts
0
Views
89
Activity
7h
USB Passthrough in mac os virtualization framework
Hi, Is there way to connect the host usb devices directly to guest vms using mac os Virtualization framework? Thanks
Replies
3
Boosts
0
Views
191
Activity
4d
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
368
Activity
4d
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
95
Activity
5d
VZVirtualMachineView window and system function keys
HI, I am trying to send system function keys like F10, F11 to VzVirtualMachineView window and it is not registering system assigned function keys. The function keys that are not assinged by mac are being send correctly. Is there a way i can send system assigned function keys to VZVirtualMachineView Window? Thanks and Regards
Replies
7
Boosts
0
Views
349
Activity
3w
Host-Only Networking and Port Forwarding Support in macOS Virtualization Framework
I’ve developed a virtual machine manager application using the macOS Virtualization framework. The application currently supports both NAT and bridged networking configurations. I’m now looking to implement host-only networking, where the guest VM can communicate with the host but not with external networks. Is this networking mode supported by the Virtualization framework, and if so, what is the recommended approach to set it up? Additionally, I would like to implement port forwarding from the host to the guest (e.g., redirecting traffic from a specific port on the host to a port on the guest). Is there a way to configure port forwarding using the built-in APIs of the Virtualization framework, or would this require a custom networking solution? Any guidance or best practices for implementing these features within the constraints of the framework would be greatly appreciated.
Replies
7
Boosts
0
Views
438
Activity
3w
SCScreenshotManager.captureImage and display sleep
I am using SCScreenshotManager.captureImage to capture image of an app window. i have the sleep settings that sleeps the display but not the system. when the display sleeps taking screenshot using SCScreenshotManager.captureImage does not work. Is there a way i can take screenshot of window when the display sleeps? Thanks
Replies
4
Boosts
0
Views
173
Activity
4w
VZVirtualMachineView and rightMouseDown
Hi, I am displaying the running linux ubuntu VM in VzVirtualMachineView. I wouldl like to simulate right click by calling vZVirtualMachineView.rightMouseDown to trigger right click on the guest. I tried it and it does not work. For mac os guests it is working. For linux guests it is not working Any help would be appreciated to fix the issue.
Replies
5
Boosts
0
Views
286
Activity
4w
VZVirtualMachine boot from iso after installation
Hi, I have installed ubuntu in a virtual machine using attached iso and everything works fine. After installing ubuntu it boots from the hard disk always. If i ever wanted to force the vm to boot from ISO how can i do it? Thanks & Regards
Replies
5
Boosts
0
Views
179
Activity
May ’26
VZVirtualMachine with multiple displays
I see that in the link https://developer.apple.com/documentation/virtualization/vzvirtualmachineconfiguration/graphicsdevices?changes=late_7_8 graphicsDevices accepts and array. So it is possible to have multiple displays for a virtual machine. But when i tried it with multiple displays it does not work. Why do we have it as an array if it does not support multiple displays.? or how to get it work with multiple displays.
Replies
1
Boosts
0
Views
128
Activity
May ’26
Windows 11 Support in macOS Virtualization Framework
Hello, According to the official documentation, the macOS Virtualization Framework currently supports only macOS and Linux guest operating systems. I would like to know if there is any way—officially or through a supported workaround—to run Windows 11 as a guest using this framework. Additionally, is there any indication or roadmap suggesting that support for Windows guests might be introduced in a future release, such as in macOS 16? Any insights or official clarification would be greatly appreciated. Thank you.
Replies
5
Boosts
0
Views
349
Activity
May ’26
Add shared folders to running VzVirtualMachine
HI, I am using mac os virtuzlation framework for running virtual machines. At prenset i add the shared folders when creating the VzVirtualMachine. Is it possible to add shared folders to running VZVirtualMachine Thannks
Replies
4
Boosts
0
Views
320
Activity
May ’26
deduplicated_symbol error
HI, I have a Swift UI app in the mac appstore in the upcoming release we have made lots of changes and it is working fine in debug mode but in production with testflight or direct distribution we are getting the following crash while working in the app. this is happening in the rendering phase. Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libswiftCore.dylib 0x19546f270 swift_unknownObjectRetain + 44 1 libswiftCore.dylib 0x1954bb09c swift_cvw_initWithCopyImpl(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*) + 280 2 libswiftCore.dylib 0x1958f685c initializeWithCopy for ClosedRange<>.Index + 212 3 VirtualProg 0x104d73958 <deduplicated_symbol> + 56 How can i debug to find out what is causing the issue and fix it?. thanks in advance
Replies
2
Boosts
0
Views
290
Activity
Apr ’26