UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Option for adding second network interface in bridged mode on macOS

Open tiiiecherle opened this issue 2 years ago • 6 comments

Hey,

thanks for implementing the bridged network option in the lates beta for macOS. Great work. It would be very nice if you could add the possibility for adding a second network interface for the vm in bridged mode including specifying a bridged interface name for the second network interface, too.

Thanks in advance,

Kind regards

tiiiecherle avatar Aug 09 '21 20:08 tiiiecherle

This would be really useful. I found that only the bridged network mode worked for me which meant I wasn't able to SSH into the VM locally. I spent hours looking for solutions, reading issues and articles on UTM and QEMU, but never found anything solid. I read the QEMU network docs properly and understood that it's possible to add multiple NICs to a VM. As such, I added a new restricted NIC which forwards port 22 from the guest to port 8022 on the host via the QEMU tab in UTM.

-nic
user,restrict=on,hostfwd=tcp::8022-:22

It would be nice to not need a deeper understanding of QEMU and its networking to do something basic like SSH into a machine locally. Even just adding this to some documentation somewhere would be really helpful as I imagine it's a relatively common workflow.

(side note: thank you for your work on UTM! I've been using it for a few weeks and it's been great)

uhthomas avatar Nov 09 '21 12:11 uhthomas

Every combination of networking is possible using QEMU arguments directly in QEMU tab. It's far from being userfriendly, but it's cool it's possible.

I'm also waiting for this to be implemented ;)

It would also be cool to have internal VM networks as tagged VLANs are not working using bridges between VMs.

JuniorJPDJ avatar Nov 09 '21 20:11 JuniorJPDJ

Hi

I agree too, that adding more network cards in GUI is a good idea.

As longtime user of virtualbox I was looking for a replacement tool to my new MacBook Pro with apple silicon. I sometimes need to to try out networking tools and try out configurations, like DHCP servers and such. For that I use linux servers virtualized in my Mac. Handy and always with you when needed. So only thing missing for me was just that, a second Nic to tie to any physical USB Nic and preferably bridged, not moving the whole USB Nic in to the virtual machine. If I do that I can't do all wiresharking simultaneously on the host machine. It's a perfect feature to just bridge a second Nic and works so good in so many ways...

So I found this thread, and scratched my head how I could do this. Took me about the same amount of time to figure out and successfully test as it take to write this. So in UTM I configured the main interface as I liked the second interface to be. Exported that in the QEMU tab, edited the netnumber and macaddress and wrote in as just a one-line down in the QEMU tab:

-device virtio-net-pci,mac=36:97:ED:1A:EE:F6,netdev=net1 -netdev vmnet-bridged,id=net1,ifname=en8

And IT WORKS. Love it! I can intercept it with my host machine, I can do everything I want. Perfect for development, how else could you do it that easy and integrated in one hardware?

Most Kind Regards to y'all!

olafriis avatar Jul 05 '22 12:07 olafriis

Hi olafriis I try you cake book but doesn't work, or I´m doing something wrong? Is the second interface defined in the VM and the first one becomes the one on the line you added? I'm not sure exactly where you add the line? Kind regards

antoniomariz avatar Jul 20 '22 17:07 antoniomariz

+1 for adding more network cards / ifcs

stefan1983 avatar Aug 24 '22 09:08 stefan1983

Hi olafriis I try you cake book but doesn't work, or I´m doing something wrong? Is the second interface defined in the VM and the first one becomes the one on the line you added? I'm not sure exactly where you add the line? Kind regards

You add it under "QEMU arguements" on the QEMU tab of the VMs properties

robw83 avatar Sep 01 '22 12:09 robw83