Use USB Devices Within LXC / Docker containers!

preview_player
Показать описание
In this video I'll show you how to use different USB devices by passing them through to LXC containers or even to Docker containers running inside LXC containers. This is something requested by my viewers, so I really hope it'll help many of you.

Chapters:

00:00 Intro
00:44 Preparation
01:46 Serial devices inside LXC containers
06:00 USB disk drives inside LXC containers
13:13 Working with embedded Docker containers
16:27 Closing words

If you enjoyed this video and want to see more, please consider subscribing to my channel!

My secondary YouTube channel (behind the scenes, vlogs, personal projects):

My programming projects and Arduino code samples on GitHub:

My 3D printing Projects on Thingiverse:

My published Docker images on DockerHub:

Also check out the social media for more info on this page, about what I'm up to, etc:

Рекомендации по теме
Комментарии
Автор

OMG I have been trying to do this for months. I gave up and created a VM. Now I finally have it you are amazing

VincentWestberg
Автор

THANK YOU!!!
Lots of pages and noise about this, but this is the clearest and most straightforward. Working like a charm :)

javierromero
Автор

Mate your a genius !!! Was trying forever to figure out how to add my USB HDD to use with Jellyfin and was on the verge of giving up... but this video was so easy to understand and each step was clearly explained which not only helped me get things working but I actually LEARNT so much from this video. Keep it up. You got my Sub 👍

aqueell
Автор

Thank you so much for this!!!! I was about to pack it in and it finally all came together watching YOUR video again. Cheers LadyD

daldom
Автор

This was exactly what I've been searching for! Thank you!

techdad
Автор

Finally it all worked! Thank you very much👍

valerakn
Автор

Thanks for making this video. Always learning something new.

andymok
Автор

Thank you for the tutorial. Any tips if my device isn't showing when I run the ls -la command? I only see the serial devices, no ttyUSB. I do see it in lsusb though. Thank you

timpro
Автор

Hey, thank you for your video! How do you handle unmounting the USB? I wonder if it is safe to unplugged it directly.

NjirNetflix
Автор

Thank you. Until minute 13 all ok. But, how can I copy files from inside the container to the mounted usb drive? I tried averything but it looks like I always get permission denied and I read many people have this problem. Is there a way to copy files out of the container to an external drive?. I'm using a standard debian container. Thanks

JAVIERLLAMAS
Автор

I have the exact same connection with the QinHeng Electronics CH340 device connected. However, when I run the esptool command, it fails to retrieve any information. The device is actually an Ender Pro 3 printer.
I have Debian loaded in an LXC, and followed the instructions you've shown. But the device doesn't report anything
In the PVE console, esptool will at least scan the port, but reports nothing.
I'm trying to pass through to Octoprint. So if I can't pass through the usb device, makes the LXC useless at this point.
Is making this inside a fully fledged VM the better route? PVE 8.0.3, and the LXC is Debian 12, both systems up-to-date (11/17/2023)

korishan
Автор

Hello, Can an NTFS formatted USB hard drive be mounted on a LXC container?

sikiriki
Автор

I followed everything you said. I mounted the drive using mount UUID=XXXX-XXXX/media/usb (using my device UUID) and it mounted. I even added the following in the
/etc/pve/lxc/101.conf (mp0: /media/usb, mp=/media/usb) and ensured the usb directory existed in the /media directory. Everything worked fine, but as soon as I rebooted it becomes unmounted.

Is their anything i need to change to make it stay mounted after reboots?

ecotts
Автор

Hi there, many many thanks for amazing and helpful videos.

I have used your steps to passthrough USB webcam to a privileged LXC container, and then to docker as a devices and also tried as a volume. The USB Web Cam is visible inside the unprivileged docker container, but AgentDVR does not see it. I also tried to run the AgentDVR docker container as PU/PG-ID=0 (root) no luck.

I have taken the same steps for full Ubuntu VM on Proxmox, and pass through to Ubuntu VM and then passthrough to AgentDVR docker containers works. So there is something that Privileged LXC container does not have that Ubuntu VM on Proxmox has.

I will be happy to help in any way if I can with content creation or any support you might need in self-hosting world.
Your suggestions would be very helpful! Many thanks! Keep up the good work!

bexa
Автор

I don't know what to do. I tried to mount the HDD and ok, it worked. I add the HDD to LXC but always i have "Permission denied" with ls -la and i tried to change the owner but it's impossible to grant the access. So, somebody know how i can fix it?

AndinhoJp