Skip to content

Commit c127e5a

Browse files
committed
docker*.sh scripts: add kvm support and missing authentication so that .docker_*.sh make BOARD=qemu* run launches kvm through gtk window as expected
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent 3b656d0 commit c127e5a

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

docker_latest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ echo
5151
# Execute the docker run command with the provided parameters
5252
if [ -d "/dev/bus/usb" ]; then
5353
echo "--->Launching container with access to host's USB buses (some USB devices were connected to host)..."
54-
docker run --device=/dev/bus/usb:/dev/bus/usb -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) $DOCKER_IMAGE -- "$@"
54+
docker run --device=/dev/bus/usb:/dev/bus/usb --device=/dev/kvm:/dev/kvm -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority:rw -w $(pwd) $DOCKER_IMAGE -- "$@"
5555
else
5656
echo "--->Launching container without access to host's USB buses (no USB devices was connected to host)..."
57-
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) $DOCKER_IMAGE -- "$@"
57+
docker run --device=/dev/kvm:/dev/kvm -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority:rw -w $(pwd) $DOCKER_IMAGE -- "$@"
5858
fi

docker_local_dev.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ echo
8686
# Execute the docker run command with the provided parameters
8787
if [ -d "/dev/bus/usb" ]; then
8888
echo "--->Launching container with access to host's USB buses (some USB devices were connected to host)..."
89-
docker run --device=/dev/bus/usb:/dev/bus/usb -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) $DOCKER_IMAGE -- "$@"
89+
docker run --device=/dev/bus/usb:/dev/bus/usb --device=/dev/kvm:/dev/kvm -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority:rw -w $(pwd) $DOCKER_IMAGE -- "$@"
9090
else
9191
echo "--->Launching container without access to host's USB buses (no USB devices was connected to host)..."
92-
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) $DOCKER_IMAGE -- "$@"
92+
docker run --device=/dev/kvm:/dev/kvm -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority:rw -w $(pwd) $DOCKER_IMAGE -- "$@"
9393
fi

docker_repro.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ echo
5959
# Execute the docker run command with the provided parameters
6060
if [ -d "/dev/bus/usb" ]; then
6161
echo "--->Launching container with access to host's USB buses (some USB devices were connected to host)..."
62-
docker run --device=/dev/bus/usb:/dev/bus/usb -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) $DOCKER_IMAGE -- "$@"
62+
docker run --device=/dev/bus/usb:/dev/bus/usb --device=/dev/kvm:/dev/kvm -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority:rw -w $(pwd) $DOCKER_IMAGE -- "$@"
6363
else
6464
echo "--->Launching container without access to host's USB buses (no USB devices was connected to host)..."
65-
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) $DOCKER_IMAGE -- "$@"
65+
docker run --device=/dev/kvm:/dev/kvm -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority:rw -w $(pwd) $DOCKER_IMAGE -- "$@"
6666
fi

0 commit comments

Comments
 (0)