-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we create socket device ? #19
Comments
Same here. Are you using an M1 or Intel Mac? |
@amit-bst @JonasGessner It took me a long time to figure this out. I had the same problem, but I was able to get passed this: what you need to pay attention to is that the However, after I passed this point, I still have no clue on how to actually access connections. I have a delegate object for the listener (VZVirtioSocketListenerDelegate), but the protocol only has one method which says if you want to allow or reject connections. But I don't see any way to actually access the connection once I return true from there. (And trying to access the file descriptor from the object as passed into the function give me a bad file descriptor error.) |
@mheese yes that was the issue, we were able to move forward, sorry forgot to post it here. Thank you so much !! |
@amit-bst were you able to use the listener though? I still can't figure this out... |
If you initialized VZVirtualMachine with the |
Sorry for hijacking the thread, has anyone has any success implementing a |
@dmarkey @mheese Could you guys figure out how to open the connection to the VM? Anything I do, when I call I start to suspect, that the I wouldn't even need this whole |
I don't know if there's an official API/documentation for this, but you can go from VM mac address to IP rather easily by parsing |
Documentation: https://developer.apple.com/documentation/virtualization/sockets Yup, I choose the MAC address way as well |
Hi,
I was trying to create a socket device
In getVMConfig function :-
VZVirtioSocketDeviceConfiguration *socketVirtioConf = [[VZVirtioSocketDeviceConfiguration alloc] init];
NSArray *socketVirtioArray = [NSArray arrayWithObject:socketVirtioConf];
[conf setSocketDevices:socketVirtioArray];
In main after VZVirtualMachine init
VZVirtioSocketDevice *socketDevice = (VZVirtioSocketDevice *)[vm.socketDevices objectAtIndex:0]
I am able to get the socketDevice. But when i try to call [socketDevice setSocketListener:listener forPort:19923]; I get illegal hardware exception. Can you help me out ?
The text was updated successfully, but these errors were encountered: