ppggff / vagrant-qemu

Use Vagrant to manage machines using QEMU. Test with Apple Silicon / M1 and CentOS aarch64 image
MIT License
408 stars 32 forks source link

make communicate two guests on the same network #30

Closed bertuz closed 1 year ago

bertuz commented 1 year ago

Hi, I'm unsuccessfully trying to make two/multiple guests defined within my vagrantfile to communicate among each other. Is it possible? As far as I see netwroking is still in progress and a user type is sent by default. I'm wondering if I could use another solution to create a unique virtual network the guests share

ppggff commented 1 year ago

Currently, this plugin uses "user mode networking" for simplicity. I think there still be able to connect multiple guests together:

The latter two methods require the use of extra_qemu_args to set up the new network config.

I haven't tested them (except the first one, I connected to ssh port of another vm), feel free to report any problems.

bertuz commented 1 year ago

done it! Thanks for your support. the extra_qemu_args does help. I'm using Mac OS' Hypervisor with its own networking system.

vb.extra_qemu_args = "-M accel=hvf -netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9 -netdev vmnet-shared,id=mynet1 -device virtio-net-pci,netdev=mynet1,mac=54:54:00:55:55:5#{i}".split