Running containers in custom network namespace

Hello, this is my first post here, so tell when i missed some important information, thanks :smiley:.

I’ve created a custom network namespace and i want to know if it is possible to run some containers in this namespace, and, if it is possible, how to do it. Haven’t found anything on google.

Greetings,
DreamTexX

It’s not something that we officially support, but I’d expect raw.lxc set to lxc.namespace.share.net=PID where PID is the PID of another process already in your netns “should work”.

Thx for the reply, were do i need to set this? In a profile?

Is it planned to build in support for that?

You can do lxc config set INSTANCE raw.lxc="lxc.namespace.share.net=" you could also put it in a profile instead if you prefer.

It’s pretty unlikely that we would add full support for this as LXD is really centered around independent machine containers and it has quite a complex network/device support with things get quite confusing when such sharing is in place.

Ok thanks, i will try that.

If there will be no support for that then i may have to look into other options without network namespaces. Don’t really wanna use some workaround that may or may not work properly :confused: