xhost +local:root XAUTH=/tmp/.docker.xauth if [ ! -f $XAUTH ] then xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/') if [ ! -z "$xauth_list" ] then echo $xauth_list | xauth -f $XAUTH nmerge - else touch $XAUTH fi chmod a+r $XAUTH fi docker stop ARM_02 || true && docker rm ARM_02 || true docker run -it \ --gpus all \ --workdir="/arm_ws" \ --env="DISPLAY=$DISPLAY" \ --env="QT_X11_NO_MITSHM=1" \ --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ --env="XAUTHORITY=$XAUTH" \ --volume="$XAUTH:$XAUTH" \ --env="NVIDIA_VISIBLE_DEVICES=all" \ --env="NVIDIA_DRIVER_CAPABILITIES=all" \ --privileged \ --network=host \ --name="ARM_02" \ arm/lab02 \ /bin/bash