Open reconbot opened 8 years ago
Besides, if we use the VMWare, why do we still need the docker? :)
Not a top priority ... see https://en.wikipedia.org/wiki/Kano_model https://en.wikipedia.org/wiki/Kano_model.
This is a basic need and not negotiable. Dissatisfaction is a natural result of ignoring basic needs.
Is tty exposing still the problem for MacOS Docker?
Yep.
@justincormack, would you mind providing the view of Docker.com once more, like you did back in 2016? And potentially provide a subclass solution only, like e.g. for serial ports only? Thanks in Advance!
Any updates?
Oh wow this is disappointing... this is a major drawback for development on modern macs.
I am also in need of a solution.
Bump, also looking for a solution for this.
Almost 6 years ago and still no solution. :(
In windows, there has a usbipd project to pass the USB devices from windows to WSL linux.
Is there an alternative or possibility to do this on mac and docker??
More than five years and still no solution.
Cannot use zigbee2mqtt in docker on macOS due to the inability to passthrough a USB device. That means my momentum in IOT development has been blocked. Shame.
It is SO infuriating to spend hours looking for a solution to a problem that is clearly very wide-spread only to eventually find a proposal that is said to have NO PRIORITY!
A long list of features under investigation on the docker roadmap and this isn't even included in that list.
Not a single developer @docker feels that this is an important thing to investigate? Come on.
@stephen-turner is there any way we could get a fresh triage of this issue?
I'm also very eager to get this feature.
Docker seems to focus on paying customers and to offer more Business
services. In my opinion features only few people are locking for. But buzzword as SSO, Corporate Policy, ... still sells licenses, as the top management with no technical background finds it kinda cool. Our company decided to avoid docker at all as long as the business model is totally crappy and basic features don't even get on the shortlist.
There are alternatives. For the small and for the big. Bye bye Docker.
This is a big problem for me, please sort it out Docker..
+1, this is also preventing me from using Docker for my development workflow.
+1. Had planned to run/test my rtl-sdr container environment while traveling. Should have left the SDR dongle at home!
--device=[] | Allows you to run devices inside the container without the --privileged flag.
But the --privileged
is needed?
Same problem on Docker Desktop for Linux!
docker run --rm -it --device /dev/ttyACM0:/dev/ttyACM0:rwm --privileged image:latest ls /dev/ttyACM0
ls: cannot access '/dev/ttyACM0': No such file or directory
For my ad-hoc uses as we have simple Docker-compose setup, I got past this error using https://github.com/containers/podman-compose
Where the compose looks like:
devices:
- /dev/ttyACM0:/dev/ttyACM0
Wa-oh, what a long thread.
Any plan to support USB PassThrough for hyperkit now? Or do we still have to use virtual box as backend for this feature, since the following repo is no longer maintained. https://github.com/boot2docker/boot2docker/
Any updates on this?
OMG DOCKER WHY!? is docker a dead project? hmmm...
OMG DOCKER WHY!? is docker a dead project? hmmm...
looks like it ^^
UTM also said the USB passthrough is not supported by apple's Virtualization.framework
.
Maybe we need to wait unitil apple fix this.
https://github.com/utmapp/UTM/issues/3778#issuecomment-1067948682
How is it that Parallels can do this? It is able to attach to both USB-serial adapters as USB devices inside the hosted OS, or it can emulate a hardware serial port by connecting to a serial port on the host OS.
Also, it sure seems Virtualization.framework supports serial ports: https://developer.apple.com/documentation/virtualization/serial_ports
I've been trying to find any kind of possible workaround for this as it is the only thing standing in the way of me Dockerizing my entire embedded workflow. I've investigated USBIP, tty0tty, socat, gensio, ser2net, vtty, ttynvt, tty2com, and a dozen others.
None of these will do the trick as of today because they all require a kernel module to be loaded to create a true TTY (with line control) rather than a PTY.
For what it's worth, if you just need a data stream that sorta looks like a serial port and no line control you can probably just use socat with a PTY. I need RTS and DTR for reset signalling and this requires a TTY.
So, does anyone have any pointers on how to load a kernel module in Docker's LinuxKit VM? If I can get one of the above loaded, or FUSE, or a kernel module of my own, I can at least provide a workaround, but I've had no luck finding resources on that.
Same issue here :(
I really hope someone links up with @vonnieda since he seems uniquely positioned to contribute to this issue
How is it that Parallels can do this? It is able to attach to both USB-serial adapters as USB devices inside the hosted OS, or it can emulate a hardware serial port by connecting to a serial port on the host OS.
@JetForMe How do this with Parallels? lsusb
lists the device inside the container, but I cannot find it in /dev.
@JetForMe How do this with Parallels?
lsusb
lists the device inside the container, but I cannot find it in /dev.
In the Parallels VM window chrome there's a USB icon in the upper-right. Click that, and you get a list of USB devices attached to the host system. If you select one of those (and it's not in use by the host), it will attach to the VM being hosted. Should show up in lsusb
then.
@JetForMe In the Parallels VM window chrome there's a USB icon in the upper-right. ...
That part is working (checked with an Ubuntu VM, device shows up as /dev/ttyACM0
).
But when I spin up ubuntu in a container (docker run --privileged ...
), lsusb lists the device, but it does not show up in /dev
. How can I "mount" it? I've tried creating an udev rule, but did not get that right
That's the subject of this bug. At least, Docker hosted on macOS can't seem to do this. Are you saying you're running Docker inside the VM? And the VM OS is Linux? Not sure if that's that case.
I merely mentioned that Parallels seems to have no issue sharing USB devices with the guest OS, so Docker has no excuses for not being able to do it.
I've installed docker-machine
following the instructions at https://github.com/Parallels/docker-machine-parallels/. This installs a special parallels VM (not docker desktop).
Since, as you point out, parallels can expose usb devices in its VMs, I figure they should also be available in the docker containers that use the parallels VM.
lsusb
in the container seems to confirm this: it does list the device (with the correct VID:PID), suggesting it's available in the container. But I have not figured out how to expose it as a device in /dev
(perhaps just a question of setting Linux up correctly, e.g. with a udev rule).
If this last problem can be solved, I can containers with usb passthrough on the Mac - albeit at the cost of a Parallels Pro subscription.
@iot49
If this last problem can be solved, I can containers with usb passthrough on the Mac - albeit at the cost of a Parallels Pro subscription.
Have you attempt to run docker-machine
on virtual box (which is free to use)?
https://dev.to/rubberduck/using-usb-with-docker-for-mac-3fdd
May you should add -v /dev:/dev
or something like --device /dev...
@JetForMe In the Parallels VM window chrome there's a USB icon in the upper-right. ...
That part is working (checked with an Ubuntu VM, device shows up as
/dev/ttyACM0
).But when I spin up ubuntu in a container (
docker run --privileged ...
), lsusb lists the device, but it does not show up in/dev
. How can I "mount" it? I've tried creating an udev rule, but did not get that right
Wow, just found this issue after all these years and am surprised this has not gotten much attention from the devs despite the number of people it affects
This should be really fixed :(
Hey, exciting new insight, at least for me, which I bumped into via RancherDesktop They have just embraced the Apple Virtualization framework on macOS (VZ). This then supports Virtual I/O Device (VIRTIO) which could fix this serial port issue.
Not that it is there today, but RancherDesktop now offers VZ as experimental feature and it should be a small step to serial port support. Or am I missing something?
Next question is whether Docker will do the same, considering they support VZ already for some time.
@justincormack The high hanging fruit hangs a lot lower now, please come pick it?
Ended up here after a lot of troubleshooting and thinking I was missing something just cause I'm new to Docker, but this is a bummer. Hoping with what @HomeACcessoryKid pointed out we may see an update on this soon.
Same issue here when running zigbee2mqtt
Was completely pointless me buying a zigbee adapter to run on my Mac then...! Will be returning it until this is fixed (if ever...!)
Any update on if this feature will get implemented in docker? USB Passthrough?
I also found this roadmap issue.
just a PSA, there are other alternatives for running containers on a Mac, for example:
i dont know whether any of these support USB passthrough as i dont need this feature anymore (solved my problem by using a different machine), but someone could experiment with these and maybe find an alternative solution to this (very old) issue
I had no luck with Colima
On Sun, Dec 3, 2023 at 15:04 Laszlo Boros @.***> wrote:
just a PSA, there are other alternatives for running containers on a Mac, for example:
- https://github.com/abiosoft/colima
- https://github.com/kubernetes/minikube (tutorial to use it for docker: https://itnext.io/goodbye-docker-desktop-hello-minikube-3649f2a1c469 )
- and this one: https://macoscontainers.org/
i dont know whether any of these support USB passthrough as i dont need this feature anymore (solved my problem by using a different machine), but someone could experiment with these and maybe find an alternative solution to this (very old) issue
— Reply to this email directly, view it on GitHub https://github.com/docker/for-mac/issues/900#issuecomment-1837630211, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATHYSZJU74S6FA7AITHYSHDYHUAPXAVCNFSM4CVJOKW2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTG43DGMBSGEYQ . You are receiving this because you were mentioned.Message ID: @.***>
Another PSA: https://christopherjmcclellan.wordpress.com/2019/04/21/using-usb-with-docker-for-mac/ describes how to USB forward to a docker daemon run in VirtualBox on macOS. I haven't personally tried yet.
Another PSA: https://christopherjmcclellan.wordpress.com/2019/04/21/using-usb-with-docker-for-mac/ describes how to USB forward to a docker daemon run in VirtualBox on macOS. I haven't personally tried yet.
This uses docker-machine
which is now also deprecated. Had a running setup with that in 2019 as well, now docker-machine
is gone too. See https://github.com/docker/roadmap/issues/245.
I’m actually the author of that blog. I’ve not tested that method recently and even at the time it only really worked with certain uart chips. Basically, use at your own caution.
I also don’t know what the odds of this are, but this xkcd dropped today.
I thought I muted this thread long ago but you just made me laugh at loud, so I guess I'm glad I didn't. I hope everyone here is making cool stuff and having fun doing it.
-Francis
Expected behavior
That I can expose a tty dev device from my mac to a linux container by running.
Actual behavior
I can work past this with
--privileged
but I don't see it in/dev/
According to the docs on docker run I shouldn't need
--privileged
.Information
Steps to reproduce the behavior
/dev/tty.usbXXXX
device to the docker image