Post

Replies

Boosts

Views

Activity

Reply to Programmatic IP Discovery for VZVirtualMachine in an App Store Sandbox
i found a way to find the ip address from arp table and it is working fine with mac os 26 Tahoe. This is the code i used static func buildARPTable() -> [String: String] { var mib: [Int32] = [CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, Int32(RTF_LLINFO)] var needed = 0 guard sysctl(&mib, 6, nil, &needed, nil, 0) == 0, needed > 0 else { return [:] } var buf = [UInt8](repeating: 0, count: needed) guard sysctl(&mib, 6, &buf, &needed, nil, 0) == 0 else { return [:] } var table: [String: String] = [:] var offset = 0 while offset + MemoryLayout<rt_msghdr>.size <= needed { let rtm = buf.withUnsafeBytes { $0.load(fromByteOffset: offset, as: rt_msghdr.self) } let msgLen = Int(rtm.rtm_msglen) guard msgLen > 0, offset + msgLen <= needed else { break } // sockaddr_in immediately follows rt_msghdr let sinOffset = offset + MemoryLayout<rt_msghdr>.size guard sinOffset + MemoryLayout<sockaddr_in>.size <= needed else { offset += msgLen; continue } let sin = buf.withUnsafeBytes { $0.load(fromByteOffset: sinOffset, as: sockaddr_in.self) } guard sin.sin_family == UInt8(AF_INET) else { offset += msgLen; continue } var ipStr = [CChar](repeating: 0, count: Int(INET_ADDRSTRLEN)) var addr = sin.sin_addr inet_ntop(AF_INET, &addr, &ipStr, socklen_t(INET_ADDRSTRLEN)) let ip = String(cString: ipStr) guard !ip.isEmpty, ip != "0.0.0.0" else { offset += msgLen; continue } // sockaddr_dl follows sockaddr_in, rounded up to 4-byte alignment let sinLen = Int(sin.sin_len) let sdlOffset = sinOffset + ((sinLen + 3) & ~3) guard sdlOffset + MemoryLayout<sockaddr_dl>.size <= needed else { offset += msgLen; continue } let sdl = buf.withUnsafeBytes { $0.load(fromByteOffset: sdlOffset, as: sockaddr_dl.self) } guard sdl.sdl_family == UInt8(AF_LINK), sdl.sdl_alen == 6 else { offset += msgLen; continue } // sdl_data starts at byte offset 8 within sockaddr_dl (fields: len1+fam1+idx2+type1+nlen1+alen1+slen1 = 8 bytes). // MAC bytes begin after the interface-name prefix of sdl_nlen bytes. let macStart = sdlOffset + 8 + Int(sdl.sdl_nlen) guard macStart + 6 <= needed else { offset += msgLen; continue } let mac = (0..<6).map { String(format: "%02x", buf[macStart + $0]) }.joined(separator: ":") table[mac] = ip offset += msgLen } return table } I made it work for mac os 26 Tahoe and it is working with stability. but the same code does not work on mac os 27. Is there any limitation introduced in mac os 27 for sysctl?
Topic: App & System Services SubTopic: Core OS Tags:
6d
Reply to VZVirtualMachineView window and system function keys
my goal is to prvoide a browser based remote control solution for VZVirtualMahineView. So that user can connect to vms from anywhere. i am almost done with this. I think i have to live with this limitation Every web-based remote desktop solution (VNC web clients, NoMachine web, etc.) has this exact same limitation. the mac os host assigned shortcuts takes precedence over web browser key press event. we cant do anything about this. pressing the fn key with f1, f2, f3 sends key codes correctly. there is no probem with this. if it is reserved by mac os(ex. cmd + space, F11 etc) it takes precedance over browser. we have to live with this limitation. thanks for your help so far.
3w
Reply to Programmatic IP Discovery for VZVirtualMachine in an App Store Sandbox
Any DTS can make it work with macOS 27 or share some info on what´s changed on macOS 27 for sysctl Thanks
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
12h
Reply to AAUSBAccessoryManager does not fire didconnect
here is the bug number FB23222154
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
14h
Reply to Provisioning with Virtualization framework fails with Threading warning
If the guest user name is different from host user name then the provisioning works. if they are same provisioning fails and setup assistant is shown.
Replies
Boosts
Views
Activity
15h
Reply to USB Passthrough in mac os virtualization framework
Looks like this is coming in macOS 27 finally - https://developer.apple.com/documentation/virtualization/vzusbpassthroughdevice ? I tried it and it works as it should be. however unable to connect iphone, hd cameras and microphones. it is working fine for most of the devices but some of the devices are failing to connect
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
4d
Reply to Port forwarding with VZVmnetNetworkDeviceAttachment
The loopback access problem is fixed in macOS 27. I tested it and confirm that it works now.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
5d
Reply to Provisioning with Virtualization framework fails with Threading warning
Damn.. apple did not say in the documentation that you cant use the same user name as host login user name. I forgot to check the logs. when i checked the logs i saw the guest provisioning was failed due to user name 'user' is not valid. where user is the same as host login user. It works perfectly.
Replies
Boosts
Views
Activity
5d
Reply to Provisioning with Virtualization framework fails with Threading warning
i changed the qos from userInteractive to default and i dont get the threading warning but provisioning does not happen. it goes to the setup screen asking for details.
Replies
Boosts
Views
Activity
5d
Reply to Flatten DiskImageKit StackedImagee
here is the feeedback number FB23093459
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
5d
Reply to Programmatic IP Discovery for VZVirtualMachine in an App Store Sandbox
i found a way to find the ip address from arp table and it is working fine with mac os 26 Tahoe. This is the code i used static func buildARPTable() -> [String: String] { var mib: [Int32] = [CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, Int32(RTF_LLINFO)] var needed = 0 guard sysctl(&mib, 6, nil, &needed, nil, 0) == 0, needed > 0 else { return [:] } var buf = [UInt8](repeating: 0, count: needed) guard sysctl(&mib, 6, &buf, &needed, nil, 0) == 0 else { return [:] } var table: [String: String] = [:] var offset = 0 while offset + MemoryLayout<rt_msghdr>.size <= needed { let rtm = buf.withUnsafeBytes { $0.load(fromByteOffset: offset, as: rt_msghdr.self) } let msgLen = Int(rtm.rtm_msglen) guard msgLen > 0, offset + msgLen <= needed else { break } // sockaddr_in immediately follows rt_msghdr let sinOffset = offset + MemoryLayout<rt_msghdr>.size guard sinOffset + MemoryLayout<sockaddr_in>.size <= needed else { offset += msgLen; continue } let sin = buf.withUnsafeBytes { $0.load(fromByteOffset: sinOffset, as: sockaddr_in.self) } guard sin.sin_family == UInt8(AF_INET) else { offset += msgLen; continue } var ipStr = [CChar](repeating: 0, count: Int(INET_ADDRSTRLEN)) var addr = sin.sin_addr inet_ntop(AF_INET, &addr, &ipStr, socklen_t(INET_ADDRSTRLEN)) let ip = String(cString: ipStr) guard !ip.isEmpty, ip != "0.0.0.0" else { offset += msgLen; continue } // sockaddr_dl follows sockaddr_in, rounded up to 4-byte alignment let sinLen = Int(sin.sin_len) let sdlOffset = sinOffset + ((sinLen + 3) & ~3) guard sdlOffset + MemoryLayout<sockaddr_dl>.size <= needed else { offset += msgLen; continue } let sdl = buf.withUnsafeBytes { $0.load(fromByteOffset: sdlOffset, as: sockaddr_dl.self) } guard sdl.sdl_family == UInt8(AF_LINK), sdl.sdl_alen == 6 else { offset += msgLen; continue } // sdl_data starts at byte offset 8 within sockaddr_dl (fields: len1+fam1+idx2+type1+nlen1+alen1+slen1 = 8 bytes). // MAC bytes begin after the interface-name prefix of sdl_nlen bytes. let macStart = sdlOffset + 8 + Int(sdl.sdl_nlen) guard macStart + 6 <= needed else { offset += msgLen; continue } let mac = (0..<6).map { String(format: "%02x", buf[macStart + $0]) }.joined(separator: ":") table[mac] = ip offset += msgLen } return table } I made it work for mac os 26 Tahoe and it is working with stability. but the same code does not work on mac os 27. Is there any limitation introduced in mac os 27 for sysctl?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
6d
Reply to AAUSBAccessoryManager does not fire didconnect
I tried connecting an iPhone, HD Web Cam , Mic to guest vm and it failed. connecting usb drives worked fine without any problem. Is there a list of devices that is supported?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
1w
Reply to AAUSBAccessoryManager does not fire didconnect
Got it we need to enable com.apple.security.device.usb in the capabilities also. It is working fine as expected.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
1w
Reply to VZVirtualMachineView window and system function keys
Is that right? Your guess is completely right. this is the scenario i got it working already
Replies
Boosts
Views
Activity
3w
Reply to VZVirtualMachineView window and system function keys
my goal is to prvoide a browser based remote control solution for VZVirtualMahineView. So that user can connect to vms from anywhere. i am almost done with this. I think i have to live with this limitation Every web-based remote desktop solution (VNC web clients, NoMachine web, etc.) has this exact same limitation. the mac os host assigned shortcuts takes precedence over web browser key press event. we cant do anything about this. pressing the fn key with f1, f2, f3 sends key codes correctly. there is no probem with this. if it is reserved by mac os(ex. cmd + space, F11 etc) it takes precedance over browser. we have to live with this limitation. thanks for your help so far.
Replies
Boosts
Views
Activity
3w
Reply to VZVirtualMachineView window and system function keys
[quote='888659022, DTS Engineer, /thread/826990?answerId=888659022#888659022'] Oh, before you do that, can you try with the capturesSystemKeys FYI : I have already set this to true. [/quote]
Replies
Boosts
Views
Activity
3w
Reply to Host-Only Networking and Port Forwarding Support in macOS Virtualization Framework
Actually, come to think of it, rbmanian75’s All Posts page currently reads like a Virtualization FAQ (-: The reason for it is obvious to bring this app to https://apps.apple.com/us/app/virtualprog-virtual-machine/id6744131218?mt=12 to mac app store. sorry for shameless self promo.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
3w