-
-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add VZVmnetNetworkDeviceAttachment support (macOS 26.0)
#205
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
base: main
Are you sure you want to change the base?
feat: add VZVmnetNetworkDeviceAttachment support (macOS 26.0)
#205
Conversation
VmnetNetworkDeviceAttachment support (macOS 26.0)VZVmnetNetworkDeviceAttachment support (macOS 26.0)
6617c8f to
6a1f741
Compare
Based on `VMNET_SHARED_MODE`, and `VMNET_HOST_MODE` ```yaml networks: - vzShared: true - vzHost: true ``` But, to sharing network between multiple VMs, `VZVmnetNetworkDeviceAttachment` requires VMs are launched by same process. It depends on Code-Hex/vz#205 Signed-off-by: Norio Nomura <[email protected]>
| const ( | ||
| HostMode VmnetMode = C.VMNET_HOST_MODE | ||
| SharedMode VmnetMode = C.VMNET_SHARED_MODE | ||
| // Deprecated: BridgedMode is not supported by NewVmnetNetworkConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why not supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. It's documented on:
https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_create(_:_:)?language=objc
Parameters
mode
Shared mode or host-only mode.
|
This can be used by multiple processes like this:
|
`VZVmnetNetworkDeviceAttachment` does not require the `com.apple.vm.networking` entitlement nor root privileges. `HostMode` and `SharedMode` are supported. In order for multiple VMs to communicate with each other in SharedMode, they must be started in the same process and the same `VmnetNetwork` must be passed to `NewVmnetNetworkDeviceAttachment()` to create an attachment. Add: - `VmnetReturn`: - `ErrVmnetSuccess` - ... - `VmnetMode`: - `HostMode` - `SharedMode` - `BridgedMode`(definition only since not supported. marked as deprecated) - `VmnetNetworkConfiguration`: `NewVmnetNetworkConfiguration()`, The use of the instance method group is still unknown. Setting subnet seems to trigger disabling DHCP, etc. - `VmnetNetwork`: `NewVmnetNetwork()`, some APIs which using `xpc_object_t` are not implemented. - `VmnetNetworkDeviceAttachment`: `NewVmnetNetworkDeviceAttachment()` see: https://developer.apple.com/documentation/virtualization/vzvmnetnetworkdeviceattachment?language=objc change `MACAddress.EthernetAddress()` to `MACAddress.ethernetAddress()` to avoid export C type from Go Signed-off-by: Norio Nomura <[email protected]>
Add: - `TestVmnetSharedModeAllowsCommunicationBetweenMultipleVMs()` - `Container.DetectIPv4()` Move `Container.exec()` from `shared_directory_arm64_test.go` to `virtualization_test.go` Signed-off-by: Norio Nomura <[email protected]>
Signed-off-by: Norio Nomura <[email protected]>
Signed-off-by: Norio Nomura <[email protected]>
change `VmnetNetworkConfiguration.SetIPv4Subnet()` Signed-off-by: Norio Nomura <[email protected]>
5a7a116 to
72cc1d4
Compare
feat: add
VZVmnetNetworkDeviceAttachmentsupport (macOS 26.0)VmnetNetworkDeviceAttachmentdoes not require thecom.apple.vm.networkingentitlement nor root privileges.HostModeandSharedModeare supported.In order for multiple VMs to communicate with each other in SharedMode, they must be started in the same process and the same
VmnetNetworkmust be passed toNewVmnetNetworkDeviceAttachment()to create an attachment.Add:
VmnetReturn:ErrVmnetSuccessVmnetMode:HostModeSharedModeBridgedMode(definition only since not supported. marked as deprecated)VmnetNetworkConfiguration:NewVmnetNetworkConfiguration(),The use of the instance method group is still unknown. Setting subnet seems to trigger disabling DHCP, etc.
VmnetNetwork:NewVmnetNetwork(), some APIs which usingxpc_object_tare not implemented.VmnetNetworkDeviceAttachment:NewVmnetNetworkDeviceAttachment()see: https://developer.apple.com/documentation/virtualization/vzvmnetnetworkdeviceattachment?language=objc
Which issue(s) this PR fixes:
Mentioned in #198 (comment)