Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

linux - Accessing Bluetooth dongle from inside Docker?

Is it possible to use a bluetooth (BLE in my case) dongle inside of a docker container?

On my host machine:

$ hcitool dev
    Devices:
       hci0   5C:F3:70:64:F0:11

Inside of Docker it doesn't find anything. I'm running Docker as:

sudo docker run --privileged -i -t ubuntu /bin/bash

I don't know enough about the bluetooth subsystem in Linux to understand what is different between the host and docker.

The hci0 device does show up in both systems:

$ ls -l /sys/class/bluetooth
lrwxrwxrwx  1 root root 0 Mar  5 01:23 hci0 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.3/2-2.3:1.0/bluetooth/hci0

Anyone try to use bluetooth inside of Docker?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try this:

sudo docker run --net=host --privileged -i -t ubuntu /bin/bash

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...