lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.06k stars 589 forks source link

Document how to create a routable IP for an instance on Linux #358

Open jandubois opened 2 years ago

jandubois commented 2 years ago

For macOS we support network configuration and routable addresses via vde_vmnet. For Linux the idea is to use a tap device, but we have not implemented a mechanism to create it (requires root), or to make it available to the instance.

mhio commented 4 months ago

Is it possible to configure this in lima, it just hasn't been documented?

I can manually configure the interface

ip tuntap add mode tap ltap0
brctl addbr lbr0
brctl addif lbr0 ltap0

and can manually run the lima qemu with the additional interface

 -netdev tap,id=net1,ifname=tap0,script=no,downscript=no \
 -device virtio-net-pci,netdev=net1,mac=52:55:55:03:0f:95 \

but I'm not sure how I can configure lima to launch this config.

I can't seen any custom or pass through config for the networks in the qemu command creation