Issues with USRP Radio and Docker on newer Ubuntu versions

Hello there,

I’m currently working on getting an Ettus X310 Software-defined-radio (SDR) to work with Docker on Ubuntu 24.04 or 22.04.

My first goal was to create a docker container that finds the SDR using the uhd_find_devices command.

This command does not find the device, which is connected via ethernet, on both operating systems.
On Ubuntu 22.04, I can ping the SDR and get a response. This doesn’t work on 24.04.

The host can however find the device.

I’m using the official dockerfile provided by Ettus which is quite old:

I also tried making my own dockerfile which lets me build the image, however in the container it gives me the same problems as the old official dockerfile.

FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:ettusresearch/uhd && \
    apt-get update && \
    apt-get install -y libuhd-dev uhd-host && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

It’s hard to provide steps to reproduce, as this requires the X310 SDR to test.

My run parameters:

docker run -t -d --privileged --network host uhd-ubuntu:22.04 /bin/bash

My guess is some security updates with Ubuntu 22.04 / 24.04 are preventing the communication of data in Docker via ethernet, but I’m not sure. Maybe someone here has an idea?

If you need any additional information please let me know.

For some reason a previous reply here was deleted,

but I attempted the disabling of the firewall as well as the logging using the --verbose command, however this says that --verbose is an unrecognized argument.

Would it be worth it to attempt another try using the Ubuntu 20.04 version?

I deleted it and suspended the user, because it was a spam post with a link pointing to an irrelevant site. The rest of the content was just to make it harder to notice the link. If you see irrelevant links in a post, always question the content as these are often automatically generated and not really trying to focus on the real problem.

So when you run

on Ubuntu 22.04, that works, when you run it on Ubuntu 24.04 iit doesn’t? I know Ubuntu 24.04 introduced new security fetaures so even running Docker Desktop got harder, but I don’t remember Docker CE issues. If it is true and the problem is only on Ubuntu 24.04, I don’t understand the following:

Doesn’t it work on Ubuntu 22.04 then? Or you mean updates in 24.04 which were not in 22.04?

Couldn’t hurt, but I don’t think that would make a difference. The only way I can imagine ping not working when using the host network is that you installed Docker Desktop and not Docker CE so the host network is the host of the virtual machine, but even then, if the target is not a loopback IP, that should work. Can you share the link to the documentation you followed to install Docker?

Just to make sure I understand it correctly, does ping work when you don’t run it in the container but directly on the host?

Thanks for the reply,

The docker run command itself works, it works on both OS versions. On 24.04, I can not ping the external SDR device, however on 22.04 it successfully pings it.

Yes, I think something new on 24.04 is preventing the communication through ethernet, even while in privileged mode and using the “host” network flag.

I used this tutorial to install both Docker-Desktop and the Docker engine:

Ping works on both OS versions while in the host’s terminal, however only on 22.04 can I ping the device while inside the container.

The command uhd_find_devices provided by Ettus should list relevant information about the SDR connected, however this works only on the host and not even on any docker container in any OS that I tested, even the one that successfully pings the SDR.

And you noticed the following note, right?

The latest Ubuntu 24.04 LTS is not yet supported. Docker Desktop will fail to start. Due to a change in how the latest Ubuntu release restricts the unprivileged namespaces, sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 needs to be run at least once. Refer to the Ubuntu Blog for more details.

Even if you managed to start it, it is not supported.

And you don’t need the engine and the desktop. Install one. Before you decide which one you delete, try switching the context to default

docker context use default

and try the docker commands again. As I stated before, the host network is not a real host network when you use the desktop.