Docker Community Forums

Share and learn in the Docker community.

How to connect USB wifi adapter on host to container?

I added this section to my docker-compose.yml file:

 - "/dev/ttyUSB0:/dev/ttyUSB0"

but I’m not sure how to figure out the right tty values.
ls /dev/ttyUSB*
returns nothing but I can see the device out there when I do

Bus 008 Device 004: ID 0846:9041 NetGear, Inc. WNA1000M 802.11bgn [Realtek RTL8188CUS]

First install this three tools,
apt-get install kali-linux kali-linux-wireless kali-linux-top10

Now commit changes to image,
docker commit

Find image id of newly created docker image,
docker images

Time for magic,
docker run -it --net=“host” --privileged /bin/bash

Think carefully before you run a privileged container especially linked to the host network !