Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run usbtop in a Docker #33

Open
cjds opened this issue Aug 13, 2020 · 6 comments
Open

Run usbtop in a Docker #33

cjds opened this issue Aug 13, 2020 · 6 comments

Comments

@cjds
Copy link

cjds commented Aug 13, 2020

I'm trying to run usbtop in a priveleged Docker.

It keeps saying

No USB bus can be captured thanks to libpcap. Check your name filter and make sure relevent permissions are set !

However, I have run

modprobe usbmon

outside the docker

When I run

lsmod | grep usbmon
usbmon                 28672  0

So the Docker can detect the module. What's going on?

@Saentist
Copy link

Why you need to monitor REAL hardware parameters from pseudo virtualization?
it s normal kernel to kicks such nonreglamented remote access

@cjds
Copy link
Author

cjds commented Aug 14, 2020

The reason I am using Docker is to package my code without easily without affecting the host system. However, the Docker being deployed has

--privileged --cap-add ALL

which does let me monitor devices and interact with kernel modules.

Because the Docker has programs that interact with devices on the USB bus I would like to monitor the CPU usage? Is that so unreasonable?


This isn't unheard of practice? What do you mean by remote access? It's on the same host?

@Saentist
Copy link

You want to act as some virus over kernel.
Docker is a pseudo virtualisation with mean act as separate system in system.

@cjds
Copy link
Author

cjds commented Aug 14, 2020

While that is true it also can access real devices on the system. Even virtualization can need to know the USB Bus bandwidth if it is accessing data on the USB bus and interacting with devices on it.

@alexspurling
Copy link

alexspurling commented Jun 13, 2022

I am also interested in learning how to run usbtop from docker. So far I have this Dockerfile:

FROM ubuntu:22.04

RUN apt update
RUN apt install usbtop -y
RUN apt install kmod -y

RUN usbtop

But I get the error: "No USB bus can be captured thanks to libpcap. Check your name filter and make sure relevent permissions are set !"

If I try to run modprobe like this:

FROM ubuntu:22.04

RUN apt update
RUN apt install usbtop -y
RUN apt install kmod -y

RUN modprobe usbmon

RUN usbmon

Then I get the error: "modprobe: FATAL: Module usbmon not found in directory /lib/modules/5.14.0-1038-oem"

@livneros-greeneye
Copy link

You should run sudo modprobe usbmon on your host before executing your docker run ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants