I have been trying to run Docker container on my laptop. When I run the command inside the container which GUI is required. I get the following error:
qt.qpa.xcb: could not connect to display :1.0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[ros2run]: Aborted
What I expected to happen:
To see turtlesim on qt gui.
I run the following commands on host machine:
export DISPLAY=:1.0
xhost +local:docker
docker run -it --net=host -e DISPLAY=$DISPLAY -v $HOME/.Xauthority:/root/.Xauthority:ro osrf/ros:humble-desktop
I run the following commands inside the container:
source opt/ros/humble/setup.bash
ros2 run turtlesim turtlesim_node
System Information:
Host OS: Ubuntu 22.04
Qmake: 3.1
Qt: 5.15.3
Docker ROS: Humble
I have tried the solutions in this link: QT6: "qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found."
THANK YOU FOR YOUR TIME