VM access to local network

Hi!

IncusOS is pretty cool and I’ve been playing around with it for my home lab today.

I have looked around a bit, but I am trying to figure out how I can configure a network that will allow VMs and containers to access the local network the host is connected to, so no NAT, and use DHCP from my network.

Something like:

[VM1 (10.1.0.25)] <-–> ldn0 (bridge) <--> [incusOS (enp3s0 - 10.1.0.2)] <–> local network (10.1.0.0/24) <–> other hosts
[VM2 (10.1.0.26)] <—-^

Apologies if this is very simple, and I just misread the documentation.

Thanks for a cool project!

Kristoffer

It’s actually super easy because IncusOS always creates bridges for everything, specifically to make this kind of setups (and more complex ones with VLANs, bonds, …) to be as convenient to use as possible.

The main step you need to do is tell IncusOS that it’s okay to put instances on your physical network. You can do that with incus admin os system edit network, then add this to your enp3s0 interface:

roles:
- instances

Once you’ve done that, incus network list should show you enp3s0 as an available network. Then you can launch an instance with incus launch images:debian/13 c1 --network enp3s0 and the instance will land on it.

You could also edit your default profile to put all instances on the physical network with:

incus profile device remove default eth0
incus profile device add default eth0 nic nictype=bridged parent=enp3s0 name=eth0

I opened Add tutorial showing how to get instances onto the physical network · Issue #563 · lxc/incus-os · GitHub so we can add a tutorial for this to the documentation.

1 Like

ah great!

Thanks for a quick answer, this makes sense, however, the admin command scope on the command seem to be being me a hard time (to be precise, it terminates after that description):

❯ incus remote switch core.ldn
❯ incus admin os edit network
Description:
  Manage incus daemon

❯

running on macOS, installed from brew

❯ incus version
Client version: 6.18
Server version: 6.18

admin os system edit network

The MacOS client in 6.18 doesn’t have the admin os commands due to a bug, we published a fixed binary in the Github release, you can grab it here: Release Incus 6.18 · lxc/incus · GitHub

great!, that did it!

Thanks!

And thanks for exposing control server variable for Headscale!

Yeah, I don’t think we’d have done the integration if it didn’t have an option for a self-hosted server (headscale). It’s great that the client is open source, but if it was all entirely dependent on a closed source server, it would have been less of a fit for us.

I still have to look at adding Netbird too as we’ve seen a few requests for that.

1 Like