Unable to create lxc container (undefined symbol: lxc_is_valid_storage_type)

Hello,

Requirements:

I have Searched the forum for my issue and found nothing related or helpful
I have checked the Resources category (Resources Index)
I have reviewed the Wiki for relevant information
I have read the the Release Notes and Errata

OpenMandriva Lx version:

OpenMandriva Lx 6.0 (Vanadium) Rock

Desktop environment (KDE, LXQT…):

KDE

Description of the issue (screenshots if relevant):

I am unable to use LXC on Rock (also on Rome). If I try to create a container, I get error complaining about storage.

[sv@openmandriva-x8664 ~]$ lxc-create -n trixie -t download
lxc-create: symbol lookup error: lxc-create: undefined symbol: lxc_is_valid_storage_type

Relevant informations (hardware involved, software version, logs or output…):

The lxc version is at 4.0.6

[sv@openmandriva-x8664 ~]$ lxc-info --version
4.0.6

I saw a topic on lxc, but that was request for latest version of the software. The issue tracker was also closed because the lxc was updated to the latest LTS. However, I have same error on the latest release on Rome as well.

I do not have this particular error on other distributions like Slackware-15 (ver. 4.0.10) or Slackware-current (ver. 6.0.4) or MX Linux (ver. 5.0.2).

There is a Ubuntu documentation for lxd that discusses storage but there is no lxc-storage command here on OMLx version of ‘lxc’ so as to try out the commands! Not that I understand that document anyway :slight_smile:

Don’t know if it is related but there is no ‘lxcfs’ package in OMLx?!

I am not able to provide any logfile as,

lxc-create --logfile error.log --logpriority DEBUG -n test -t download

doest not produce any file!

Thanks in advance.

OMLx is not based on these distros, so this really doesn’t help solve it.

Does the command work with sudo?

I would also suggest you read this:

To be fair, we cannot possibly determine what your use case might be so the fact it’s not set up to behave in a certain way is so you can configure that to your liking.

Hi,
I guess I did not explain the issue clearly.

I am not doing anything fancy with lxc. I just want to create and run lxc container(s); preferrably unprivileged, but if that is not possible, a privileged container is also OK.

I am aware of alternatives like docker, podman and the wrapper, distrobox (which is actually very good) but somehow I prefer lxc. In fact, I prefer to use plain lxc instead of ‘lxd’ or ‘incus’.

I understand. My intension was not to compare the distros (I have read “OpenMandriva is not <put your distro here>” message :smiley: ). The reason I mentioned them is,

  • Ubuntu has a nice wrapper (or REST API as they call it) called ‘lxd’ which helps manage lxc. It has lxd init command that configures the lxc like storage pool, network etc the first time we run it. The distros mentioned do NOT have ‘lxd’; they use ‘vanilla’ lxc, just like OMLx.
  • The distros I tried (forgot to mention Arch) include both systemd and non-systemd, so it is not an init system issue.
  • The versions are also different (v4.0.10, v5.0.2 and v6.0.4). So it is not an issue with a particular version as well.

It is not like I can create a container but some feature is not working. For example, unprivileged container is not working or networking is not working etc. I am not able to create the container itself. And the error message is related to some “undefined symbol”!.

No. It fails with same error message for sudo/root as well.

[root@openmandriva-x8664 ~]# lxc-create -n test -t download
lxc-create: symbol lookup error: lxc-create: undefined symbol: lxc_is_valid_storage_type

Below are my configuration(s). Please note another “symbol” error below, for ‘lxc-start’ command.

[sv@openmandriva-x8664 ~]$ lxc-info --version
4.0.6
[sv@openmandriva-x8664 ~]$ lxc-checkconfig
lxc-start: symbol lookup error: lxc-start: undefined symbol: lxc_config_define_load
LXC version

--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Namespace limits:
  cgroup: 30619
  ipc: 30619
  mnt: 30619
  net: 30619
  pid: 30619
  time: 30619
  user: 30619
  uts: 30619

--- Control groups ---
Cgroups: enabled
Cgroup namespace: enabled
Cgroup v1 mount points:
Cgroup v2 mount points:
 - /sys/fs/cgroup
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled, not loaded
Macvlan: enabled, not loaded
Vlan: enabled, not loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, not loaded
CONFIG_IP_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, not loaded
FUSE (for use with lxcfs): enabled, loaded

--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled

Note: Before booting a new kernel, you can check its configuration with:

  CONFIG=/path/to/config /usr/bin/lxc-checkconfig
[sv@openmandriva-x8664 ~]$ cat /etc/sysconfig/lxc-net
USE_LXC_BRIDGE="true"

[sv@openmandriva-x8664 ~]$ cat /etc/lxc/default.conf
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 10:66:6a:xx:xx:xx

[sv@openmandriva-x8664 ~]$ cat ~/.config/lxc/default.conf
lxc.include = /etc/lxc/default.conf
lxcpath = ~/.local/share/lxc
lxc.start.auto = 1
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536

[sv@openmandriva-x8664 ~]$ cat /etc/lxc/lxc-usernet
sv  veth  lxcbr0  10

[sv@openmandriva-x8664 ~]$ cat /etc/subuid /etc/subgid
sv:100000:65536
sv:100000:65536

One more peculiar thing, the versions shown by ‘dnf info’ and ‘lxc-info --version’
are different (actually mirror each other!).

[sv@openmandriva-x8664 ~]$ dnf info lxc
Last metadata expiration check: 1:16:59 ago on Friday 27 June 2025 09:36:10 AM.
Installed Packages
Name         : lxc
Version      : 6.0.4
Release      : 1
Architecture : x86_64
Size         : 6.8 M
Source       : lxc-6.0.4-1.src.rpm
Repository   : @System
From repo    : rolling-x86_64
Summary      : Linux Containers
URL          : https://lxc.sourceforge.net
License      : LGPLv2
Description  : The package "lxc" provides the command lines to create and manage
             : containers.  It contains a full featured container with the isolation
             : / virtualization of the pids, the ipc, the utsname, the mount points,
             : /proc, /sys, the network and it takes into account the control groups.
             : It is very light, flexible, and provides a set of tools around the
             : container like the monitoring with asynchronous events notification,
             : or the freeze of the container. This package is useful to create
             : Virtual Private Server, or to run isolated applications like bash or
             : sshd.

[sv@openmandriva-x8664 ~]$ lxc-info --version
4.0.6

I am guessing it is OMLx package issue. May be some configuration is wrong or some required package/library it not available or installed as dependency.

Please confirm the settings in the documentation that I referenced here:

If you feel it’s still a packaging issue, you are free to look over the package spec here:

1 Like

I have read that guide. I have also gone through Stéphane Graber’s (main developer) blog series, Debian and Arch wikis on lxc. The settings are OK to the best of my knowledge. LXC is working fine with the same settings on other distros. I have posted them above. If you or others see anything wrong/missing let me know.

As a matter of fact, I did already :smile: I am new to packaging and could not see anything ‘obvious’ as in mismatch in version numbers or urls etc. I do not understand beyond that. But I’ll keep digging.

If you or anybody else can test installing lxc, may be on a vm and provide your feedback I’ll be grateful.

Keep us posted. You can also join our Cooker room to get real time help with packaging:

You may also check that the permissions on the volume you are trying to create the file on have applied permissions from your current distro. If you are using an external drive that you created from a different distro, some things like UID and GID may not line up.

@zeroability, thank you for the link. I may need it now :smile:

I found the root cause: ‘lib64lxc1’ is at an older version (liblxc.so.1.7.0) compared to what should be with the current version of lxc (liblxc.so.1.8.0). Hence that ‘undefined symbol’ error.

Although I did not get exact match for “undefined symbol: lxc_is_valid_storage_type” error, there were several ‘undefined symbol’ errors. On one of the issue discussion upstream, the lead developer ‘stgraber’ suggested the issue could be due to old version of liblxc. Following that tip confirmed the liblxc version shipped is indeed older than what is required.

Following is what is shipped (Rome as well as Rock).

[sv@openmandriva-x8664 Public]$ rpm -qlp lib64lxc1-4.0.6-2-omv4090.x86_64.rpm 
/usr/lib64/liblxc.so.1
/usr/lib64/liblxc.so.1.7.0

After I compiled the software, the version is at 1.8.0.

[sv@openmandriva-x8664 Public]$ ls -l /usr/lib64/ | grep liblxc
-rw-r--r--  1 root root  13837306 Jun 28 05:53 liblxc.a
lrwxrwxrwx  1 root root        11 Jun 28 05:57 liblxc.so -> liblxc.so.1
lrwxrwxrwx  1 root root        15 Jun 28 05:57 liblxc.so.1 -> liblxc.so.1.8.0
-rwxr-xr-x  1 root root   3265048 Jun 28 05:53 liblxc.so.1.8.0

With this update, lxc is working as intended. I am able to create and use containers.

[sv@openmandriva-x8664 ~]$ lxc-info --version
6.0.4
[sv@openmandriva-x8664 ~]$ lxc-ls -f
lxc-ls: ../src/lxc/utils.c: switch_to_ns: 900 Operation not permitted - Failed to set process 7913 to "net" of 3
lxc-ls: ../src/lxc/utils.c: switch_to_ns: 900 Operation not permitted - Failed to set process 7913 to "net" of 3
lxc-ls: ../src/lxc/utils.c: switch_to_ns: 900 Operation not permitted - Failed to set process 7913 to "net" of 3
NAME STATE   AUTOSTART GROUPS IPV4       IPV6 UNPRIVILEGED 
sid  RUNNING 1         -      10.0.3.120 -    true         
[sv@openmandriva-x8664 ~]$ lxc-attach -n sid
root@sid:/# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.0
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@sid:/#

Please ignore the ‘Failed to set process $PID to “net” of 3’ error message, for now, as there is an open ticket for it. That error has not stopped us from using the container including access to internet.

I’ll mark the topic as solved because with custom build lxc works. I’ll check how to update the lib64lxc1 package. That would be a new learning experience.

I can’t guarantee there will be a backport for it since you are on Rock, but it will definitely make it to ROME in the near future. If you have a GH account, please create an issue here with the “Package Update” label, along with a link to this post:
https://github.com/OpenMandrivaAssociation/distribution/issues

If you don’t want a GH account, let me know and I can make an Issue for you. Otherwise, you are also free to submit a PR with the version number changes.

Thank you for taking the initiative to find the answer and letting us know.

I have raised bug report, issue 3272. I did so instead of ‘Package Update’ because I found there is lib64lxc package provides the required library but it cannot be installed because lxc currently depends on lib64lxc1.

I did try to build rpm package using the spec file (rolling branch) and as instructed in How to Build and Submit Packages for OpenMandriva. This builds the correct library package lib64lxc. I don’t know where ‘dnf’ gets its dependency information; could not find anything ‘liblxc’ under ‘Requires’ in the spec file.

Thank your for your support as well.

Building like that should be done in Cooker because of how we deliver releases.

Normally BuildRequires satisfies most requirements unless something from another project is needed. Since you say it needs lib64lxc1, then the lib64lxc package needs updated. Once that is done, the lxc package can also be updated with the new library as a BuildRequires. Unless they are both built in the same spec.