Ubuntu 20.04.6 on Virtualbox: Error – can’t open display

Currently using Ubuntu installed on Virtualbox with Windows 7 as the main system. Was going through some ROS basics with rosrun turtlesim turtelsim_node and got errors like:

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.

After googling and trying a lot of different options suggested have had no luck fixing it.
But for me, it looks like it’s not QT problem, but something related to a virtual machine, because when I’m trying to run

sudo apt-get install x11-apps
xeyes

I have almost the same issue

Error: Can't open display:

Maybe someone had the same issue or idea of what to look at.

Read more here: Source link