2024-12-06 23:11:00
In my Linux and DevSecOps classes, my students run a handful of virtual machines for their labs. We see all kinds of host OS configurations: Windows, MacOS, all kinds of Linuxen. And then there's both Intel, AMD and Apple CPUs. It makes for an interesting mish-mash.
In most cases we build a NAT network, which has the VMs in it. This shields the VMs from the rest of the network (keeping them safer), while still giving them Internet access.
Every hypervisor (virtualisation software) has its own approach for this. In VMWare it's almost by default that VMs end up in the same, shared NAT network. In VirtualBox you have to change the adapter connection from "NAT" to "NAT Network".
UTM on MacOS on aarch64 (Apple Silicon ARM) confounded me for quite a while. Unfortunately their documentation isn't perfectly clear on the subject. But, this week we got it to work!
To setup more than one VM, in UTM, in a shared NAT network, you do the following. For each virtual machine, go into the Networking configuration. Make these settings:
The networking configuration screen suggests that DHCP works out of the box, without configuration, but it doesn't. I have had to manually enter the information which was already in the boxes (but greyed out), to make it work.
Now when you boot the VMs, they will be in 10.0.2.0/24 and they'll get IPs starting at .15. They can ping each other, plus you can SSH to them directly from your MAC without needing any port forwards.
kilala.nl tags: studies, mentor,
View or add comments (curr. 0)
All content, with exception of "borrowed" blogpost images, or unless otherwise indicated, is copyright of Tess Sluijter. The character Kilala the cat-demon is copyright of Rumiko Takahashi and used here without permission.