I have a Raspberry Pi 4 with Docker running 5 containers on 10.0.20.x / macvlan20, 1 on 10.0.40.x / macvlan40, and a few others like Portainer & Watchtower that don’t need to be on those. It works great. I’d like to rebuild the entire thing in a VM on a different device.
I’ve got a 2013 Mac Pro, the trashcan version. Not great, but they’re cheap on eBay and reasonably upgradable - up to 12 core/24 thread, 128GB RAM, internal NVMe storage, about $300. Fresh install of macOS 12, fresh install of VirtualBox 6.1. I’ve tried using Ubuntu Server 22.04.1, Photon OS 4 Rev2, and Debian 11.5 as the guest OS, and I can get Docker running just fine, I can get a container running just fine, but as soon as I try and put it on a macvlan network, it doesn’t work. I can see the container in my UniFi network controller - it sees the hostname, the MAC address, and the IP address I’ve set, but I can’t connect via the web portal for containers that have web portals (PiHole, Home Assistant, Homebridge), and if I ping them from my laptop I get no response on any container attempted (Unbound, NTP). (I’ve been using the laptop to ping them because I’ve read that you can’t ping the containers from the host, and the host is downstairs and headless anyway.)
I’ve tried using different network adapter types in VirtualBox (Intel PRO/10000 MT Desktop, Intel PRO/1000 MT Server, PCnet-FAST III), I’ve made sure Promiscuous Mode is on in the VirtualBox settings (tried Allow VMs and Allow All), I’ve set up the macvlan networks through command line and Portainer, and the outcome doesn’t change.
The Mac Pro is wired over ethernet to UniFi switch, and the port profile is set to “All”. I’ve also tried IPvlan for kicks, no difference. I’ve tried deploying containers manually through Portainer, using compose files in Portianer’s Stacks, and straight through command line - when they’re not on macvlan they work great, when they’re on macvlan they don’t work. And none of the containers throw up any error messages.
The command I’ve been using to make the macvlan network is
sudo docker network create -d macvlan --subnet=10.0.20.0/24 --gateway=10.0.20.1 -o parent=eth0.20 macvlan20
(Depending on the VM, sometimes it’s eth0, sometimes it’s enp0s3, I always check every time I try a new VM.)
(The original goal was to run ESXi on the Mac Pro 2013, since it’s supposed to be fully supported - 7 U3 or something like that. But ESXi broke itself twice, and too many features were locked away in vSphere that I decided to try VirtualBox instead. I had the exact same experience with containers working fine no matter the guest OS, and containers + macvlan failing.)