Ubuntu 23.04 LXC network not configured

When I start a new LXC Ubuntu 23.04 instance, it’s network interface is not configured. Once I add ip address and bring it up I get conectivity, but DNS is not working.
With Ubuntu 22.04 everything works out of the box however, so it is not that much of a problem. Maybe this helps someone.

Using Omnia on 6.4.2 HBS.

How did you install a new Ubuntu instance? Luci or terminal?
I cannot install any instance for over a year.

Just wanted to chime in that I have never had luck with lxc containers on Omnia.

I had this network problem as well with both 22 and 23 Ubuntu. Sometimes it works after downloading a new container, it randomly starts working and I can do apt updates again. Sometimes you create a container and it glitches out and does not give an IP to the host.

I also had a fresh install on 22.04 with working network and configured a service to run (tested IP:Port of service handed out from container), added this container to autostart, did a reboot of the router and it wiped out my container like it never existed. The folder exists but it can’t be accessed like it got corrupted on /srv.
I don’t have problems with other services running on my Msata, but I don’t trust anything to run in these containers after those experiences.

I tried both of course. But it didn’t affect the result.
However LXC worked out of the box, besides networking I didn’t identify any other problems. I used the 22.04 for a Pi-hole and it works flawlessly so far.
I was on fresh Omnia install.

Hi there,

yesterday I wanted to switch out an old Ubuntu 18.04 container to a new 23.04 one, and ran in to the same problem. I spent some time debugging it and came up with a solution.

The problem seems to stem from the fact that the Ubuntu 23.04 image is some sort of “cloud” image that expects to be deployed in “cloud” infrastructure with infrastructure to provision ip addresses etc. Since that infrastructure is not there on (most?) omnias in home networks, the provisioning fails. The key to get the image working with networking is to disable the cloud services, and configure the “normal” networking daemon.

(All commands listed below needs to be run with sudo/as root)

Steps:

  1. Stop & disable the cloud services trying to set up the network.

     systemctl stop cloud-config.service
     systemctl stop cloud-final.service
     systemctl stop cloud-init-local.service
     systemctl stop cloud-init.service
     systemctl disable cloud-config.service
     systemctl disable cloud-final.service
     systemctl disable cloud-init-local.service
     systemctl disable cloud-init.service
    
  2. Just to be sure, in case the cloud services get re-enabled, create the following file:

    /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
    

    with the following content:

    network: {config: disabled}
    
  3. Create a config file for systemd-networkd to bring up the interface “normally”. My interface is eth0, adjust if you call it something else. Also, there are two different ways depending on if you use DHCP for the interface or not.

    Create the following file:

    /etc/systemd/network/50-bridged.network
    

    With the following content (for static config):

    [Match]
    Name=eth0
    
    [Network]
    Address=192.168.1.55/24
    Gateway=192.168.1.1
    

    or the following (for DHCP):

    [Match]
    Name=eth0
    
    [Network]
    DHCP=yes
    

After performing these steps, run

systemctl restart systemd-networkd

and your network should come up. It will also persist between reboots.

I hope this helps!

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.