Open Agus-Wei opened 1 year ago
There's been a couple issues created on this topic. https://github.com/ppggff/vagrant-qemu/issues/33 https://github.com/ppggff/vagrant-qemu/issues/36
I have done some research for this problem on MacOS:
vmnet-shared
:
allows the guest to communicate with other guests in shared mode and
also with external network (Internet) via NAT. Has (macOS-provided)
DHCP server; subnet mask and IP range can be configured;vmnet-host
:
allows the guest to communicate with other guests in host mode.
By default has enabled DHCP as vmnet-shared
, but providing
network unique id (uuid) can make vmnet-host
interfaces isolated
from each other and also disables DHCP.vmnet-bridged
:
bridges the guest with a physical network interface.vmnet-shared
and vmnet-host
look like a good match to the public and private of vagrant networkBut there still have some problem:
Also there is a third party program socket_vmnet from the lima project:
I prefer to use qemu directly, maybe use sudo to handle the root problem. I will try to make it work with vagrant's network config soon.
Any examples on how can we run a qemu VM with (e.g.) vmnet-bridged
? Because when I tried to add it on the following args:
qe.net_device = 'virtio-net-pci'
qe.extra_netdev_args = 'vmnet-bridged=on,ifname=en0'
I got the following error, which suggests the plugin is pre/appending various other arguments that are not compatible with the vmnet
arguments:
Stderr: qemu-system-x86_64: -netdev user,id=net0,hostfwd=tcp::50022-:22,vmnet-bridged=on,ifname=en0: Invalid parameter 'vmnet-bridged'
@andronat , @ppggff already said this plugin hasn't been adjusted to work with vmnet-* yet.
Like you, I would love to use these solutions, but it's not possible yet.
With regards to your post of May 8th, I feel that you should wait for Qemu to build in the required support for non-privileged users.
They themselves have already identified that their biggest hurdle is that their software isn't flagged by Apple as being permitted to use the com.apple.vm.networking
entitlement. The main reason for this is A) that they haven't requested it and B) that their brew install
does a build from source code. source
That seems like something they as project should be able to work on. Until they've done so, I would not recommend that you build in a sudo
workaround.
Is it possible to setup private network through Vagrantfile?