Issue
I'm trying to use ROS2 Humble on Ubuntu 22.04.3 on Windows 11, and when I try running "ros2 run turtlesim turtlesim_node" I get the following message:
qt.qpa.xcb: could not connect to display
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
Is there a package I'm missing? I've been following this document to install the necessary packages, and I tried Googling this issue but nothing is helping. I'm fairly new when it comes to Linux so any help or direction is appreciated!
Solution
Is you're running Ubuntu on Windows I assume you're using WSL2. The problem is that WSL2 (or Docker) doesn't have desktop/GUI so by default you can't run any graphical applications. For that you need some kind of XServer (or special setup for Docker).
Here's link for WSL2 GUI to put you on track. I liked to use Xserver built in MobaXTerm.
Alternatively you can use VM or even better if you have disk space and motivation make dual boot and run ROS on Ubuntu natively
Answered By - Combinacijus Answer Checked By - Senaida (WPSolving Volunteer)