-
Notifications
You must be signed in to change notification settings - Fork 789
feat: add VZVmnetNetworkDeviceAttachment support on macOS 26+
#4394
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: master
Are you sure you want to change the base?
feat: add VZVmnetNetworkDeviceAttachment support on macOS 26+
#4394
Conversation
|
Currently, both |
Any advantage using them? |
As far as the API is concerned, customization that is not supported by vzNAT should be possible. |
07eebec to
270556e
Compare
Obsoleted by changesAdded It shares
When the |
81d4cc6 to
57553f8
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 <norio.nomura@gmail.com>
1fe9e8a to
433432d
Compare
It shares `VmnetNetwork` serialization between VMs.
- `limactl vz-vmnet --enable-mach-service`: register Mach service and launch
- `limactl vz-vmnet --enable-mach-service=false`: unregister Mach service
`limactl vz-vmnet` does:
- Receives a registration payload from VZ driver with fields:
- `Network`: name of the network ("shared", "host", etc)
- `CDHash`: `cdhash` bytes of the executable.
- `Configuration`: `[]bytes@ representing `VzNetworkConfig` in JSON.
- `Serialization`: serialization created by `VmnetNetwork.CopySerialization()`
- Validates the provided cdhash matches to client's cdhash by using xpc_peer_requirement API.
- Check the existence of the host interface using `VzNetworkConfig.Subnet`.
- If the cdhash is valid and the interface is not exists, accepts registration to serialization entries.
- If `Serialization` is not in payload and the network registration exists,
reply the payload to client if the registered network still exists.
- reply error on otherwise.
VZ driver does:
- Check the existence of the host interface using `VzNetworkConfig.Subnet`.
- If exists:
- Retrieves the existing registration payload from `lima vz-vmnet`.
- Validate cdhash in payload matches with the self cdhash
- If the `VzNetworkConfig` changed, produce a warning to log
- Create a VmnetNetwork from the serialization
- If not exists, Create a VmnetNetwork from `VzNetworkConfig`, and register them to `lima vz-vmnet`
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
433432d to
adf5456
Compare
|
In the latest commit, the serialization of |
Based on
VMNET_SHARED_MODE, andVMNET_HOST_MODEBut, to sharing network between multiple VMs,
VZVmnetNetworkDeviceAttachmentrequires VMs are launched by same process.It depends on Code-Hex/vz#205