# Network contextualisation in lxd containers

**URL:** <https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390>\
**Category:** Product Support\
**Created:** [June 27, 2019, 11:22pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390 "2019-06-27T23:22:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [June 27, 2019, 11:22pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/1 "2019-06-27T23:22:44Z")

</div>

## Some lxd containers don’t initialize networking or host name.

**Versions of the related components and OS (frontend, hypervisors, VMs):**  
One 5.8.3  
LXD 3.0.4/stable  
Ubuntu 18.04

**Steps to reproduce:**  
Install fedora30 lxd from market place. Instantiate in a priviliged mode or default (unprivileged)  
Install kali linux from the same market place  
Install debian buster from the same market place  
Install ubuntu bionic from the same market place

**Current results:**  
Fedora 30:  
Console doesn’t work, hostname doesn’t change to a container name, container start interface eth0 is up but no ip address assigned

Kali:  
Console works, hostname doesn’t change to a container name, container start interface eth0 is up but no ip address assigned

Debian Buster:  
Console works but not for root, hostname doesn’t change to a container name, container start interface eth0 and IP address assigned

Ubuntu Bionic:  
All things work but only in privileged security mode.

**Expected results:**

1. Console works for all users
2. Hostname is properly set
3. Network is working

All of this, at least 2 and 3 should work consistently in privileged and unprivileged mode.

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [June 28, 2019, 3:27am UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/2 "2019-06-28T03:27:09Z")

</div>

Here a syslog on the node that started lxd. Perhaps it helps.

Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307750.747108] EXT4-fs (nbd0): mounted filesystem with ordered data mode. Opts: (null)  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307750.918929] ISO 9660 Extensions: Microsoft Joliet Level 3  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307750.966879] ISO 9660 Extensions: Microsoft Joliet Level 3  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307750.966944] ISO 9660 Extensions: RRIP\_1991A  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.170200] audit: type=1400 audit(1561678538.493:275): apparmor=“STATUS” operation=“profile\_load” profile=“unconfined” name=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” pid=1035176 comm=“apparmor\_parser”  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) networkd-dispatcher[1036]: WARNING:Unknown index 62 seen, reloading interface list  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.177812] openbr.private: port 3(one-28-0) entered blocking state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.177814] openbr.private: port 3(one-28-0) entered disabled state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.177881] device one-28-0 entered promiscuous mode  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.177986] IPv6: ADDRCONF(NETDEV\_UP): one-28-0: link is not ready  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.177988] openbr.private: port 3(one-28-0) entered blocking state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.177990] openbr.private: port 3(one-28-0) entered forwarding state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) systemd-udevd[1035177]: link\_config: autonegotiation is unset or enabled, the speed and duplex are not writable.  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) systemd-udevd[1035177]: Could not generate persistent MAC address for vethY7Z0FR: No such file or directory  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) systemd-udevd[1035178]: link\_config: autonegotiation is unset or enabled, the speed and duplex are not writable.  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.179010] openbr.private: port 3(one-28-0) entered disabled state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.315642] eth0: renamed from vethY7Z0FR  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) systemd-networkd[743]: one-28-0: Gained carrier  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.347009] IPv6: ADDRCONF(NETDEV\_UP): eth0: link is not ready  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.347219] IPv6: ADDRCONF(NETDEV\_CHANGE): eth0: link becomes ready  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.347255] IPv6: ADDRCONF(NETDEV\_CHANGE): one-28-0: link becomes ready  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.347318] openbr.private: port 3(one-28-0) entered blocking state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.347319] openbr.private: port 3(one-28-0) entered forwarding state  
Jun 27 16:35:38 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.666297] audit: type=1400 audit(1561678538.989:276): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035329 comm="(networkd)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.723370] audit: type=1400 audit(1561678539.049:277): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035366 comm="(networkd)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.767779] audit: type=1400 audit(1561678539.093:278): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035395 comm="(networkd)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.822746] audit: type=1400 audit(1561678539.145:279): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035426 comm="(networkd)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307751.866849] audit: type=1400 audit(1561678539.193:280): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035452 comm="(networkd)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307752.005005] audit: type=1400 audit(1561678539.329:281): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035542 comm="(resolved)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307752.049383] audit: type=1400 audit(1561678539.373:282): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035557 comm="(r-launch)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307752.090312] audit: type=1400 audit(1561678539.413:283): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035571 comm="(r-launch)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) kernel: [1307752.122809] audit: type=1400 audit(1561678539.445:284): apparmor=“DENIED” operation=“mount” info=“failed flags match” error=-13 profile=“lxd-one-28\_\</var/snap/lxd/common/lxd\>” name="/run/systemd/unit-root/" pid=1  
035586 comm="(r-launch)" srcname="/" flags=“rw, rbind”  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) ntpd[8175]: bind(28) AF\_INET6 fe80::fce3:f8ff:fe8c:2ca5%62#123 flags 0x11 failed: Cannot assign requested address  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) ntpd[8175]: unable to create socket on one-28-0 (48) for fe80::fce3:f8ff:fe8c:2ca5%62#123  
Jun 27 16:35:39 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) ntpd[8175]: failed to init interface for address fe80::fce3:f8ff:fe8c:2ca5%62  
Jun 27 16:35:40 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) systemd-networkd[743]: one-28-0: Gained IPv6LL  
Jun 27 16:35:41 [virt3n3-la.xcastlabs.net](http://virt3n3-la.xcastlabs.net) ntpd[8175]: Listen normally on 49 one-28-0 [fe80::fce3:f8ff:fe8c:2ca5%62]:123

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [June 28, 2019, 5:11am UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/3 "2019-06-28T05:11:35Z")

</div>

Hi

The container images imported from the marketplace are meant to be run only under privileged mode. The reasoning for this is basically [this limitation](https://github.com/OpenNebula/one/issues/3258).

Also

> 1. Console works for all users

Are you referring to VNC ?

There is an [open issue](https://github.com/OpenNebula/one/issues/3178) for supporting marketplace images matching [GitHub - OpenNebula/addon-context-linux: Linux VM Contextualization](https://github.com/OpenNebula/addon-context-linux#tested-platforms).

It is possible that some of those images lack a package required for context to work properly, take a look at [Review context package dependencies · Issue #145 · OpenNebula/addon-context-linux · GitHub](https://github.com/OpenNebula/addon-context-linux/issues/145)

That being said, images that are auto-contextualized when importing are: alpine (andy version), centos 6 and 7, ubuntu and debian (any version), fedora will be added, however kali probably not.

I’ll take a look at Debian Buster.

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [June 28, 2019, 5:20am UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/4 "2019-06-28T05:20:39Z")

</div>

I refer to console via VNC

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [June 28, 2019, 5:27am UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/5 "2019-06-28T05:27:12Z")

</div>

Also, fedora 30 has broken vnc and networking. So I guess some images have more problems than others. I will try centos 7 next.

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [June 28, 2019, 2:42pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/6 "2019-06-28T14:42:59Z")

</div>

See [http://docs.opennebula.org/5.8/deployment/open\_cloud\_host\_setup/lxd\_driver.html#guest-issues](http://docs.opennebula.org/5.8/deployment/open_cloud_host_setup/lxd_driver.html#guest-issues), that is probably applicable to fedora as well, the quick test is running `lxc exec fedora_container login`. The network configuration doesn’t work because fedora isn’t contextualized when importing from marketplace.

You can change the login command to get direct acces to the shell and skip the login limitation.

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [June 28, 2019, 4:23pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/7 "2019-06-28T16:23:37Z")

</div>

I see that Fedora 30 contextualization has been added to tested list today. How often the images are being rebuilt? Also I tried to remove and reimport debian buster image but I am getting image 6 exist error.

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [June 28, 2019, 4:46pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/8 "2019-06-28T16:46:36Z")

</div>

Sorry, answered image in use question myself. I had to remove a container using older image and then remove the image itself. It sounds like a problem though. Let say I use image X 1.0 for lxd and then found out that bug fixed in X 1.1. Even if I use X 1.0 for current containers, shouldn’t I be able to use 1.1 for new ones? From my past I remember that the images can be versioned. When you downloading lxd image for debian buste wouldn’t it be a good idea to based id at least on the current image version? So you can have both X 1.0 and X 1.1 perhaps with the different names that incorporate the version?

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [July 1, 2019, 5:28am UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/9 "2019-07-01T05:28:20Z")

</div>

I’m not sure if I understood correctly. Container images are published on a daily basis on [images.linuxcontainers.org](http://images.linuxcontainers.org):

- an image is imported to a datastore
- a day passes (there is an updated version of the image)
- you want to update your local image with the new version, kinda overwriting the linux fs ?

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [July 2, 2019, 2:28pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/10 "2019-07-02T14:28:10Z")

</div>

I download fedora on 11/14. and use it to run 3 containers. Then on. 11/30 a new fedora image becomes available with feature X. I am trying importing a new lxd image but opennebula tells me that I already have one which it can’t overwrite because it is in use by running containers. Versioning of images would allow to have and use more than one image of the same linux distribution.

---

<div class="post-metadata">

**Author:** ![Alexander\_Litvak](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alexander_litvak/32/5935_2.png) [@Alexander\_Litvak](https://forum.opennebula.io/u/Alexander_Litvak)\
**Post date:** [July 2, 2019, 2:31pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/11 "2019-07-02T14:31:14Z")

</div>

To make myself a bit more clear. I am talking about the same os version i.e. lxd images for fedora 30 for example.

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [July 2, 2019, 10:53pm UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/12 "2019-07-02T22:53:12Z")

</div>

Couldn’t you just import it with another name?

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [July 3, 2019, 5:16am UTC](https://forum.opennebula.io/t/network-contextualisation-in-lxd-containers/7390/13 "2019-07-03T05:16:24Z")

</div>

Well, the only rename possible is the template name. Maybe adding a way to rename the image will suffice as the initial workaround. The app could, have a name suffix in both the vm template and the app template to specificy, for example, the release date, and that way it would be possible to update without issues.

Could you open a feature request on github for the team to have a nicer time evaluating this ?
