Tiryoh / docker-ros-desktop-vnc

🐳 Dockerfiles to provide HTML5 VNC interface to access Ubuntu Desktop + ROS
https://memoteki.net/archives/2955
Apache License 2.0
273 stars 56 forks source link

qt.qpa.xcb: could not connect to display #28

Closed oaix closed 2 years ago

oaix commented 3 years ago

This image tiryoh/ros-desktop-vnc noetic 723aa1948265 can't show UI such as rviz because of no Qt platform plugin could be initialized. Some discuss about Could not load the Qt platform plugin "xcb" in "" even though it was found has been found. But no useful solution can solve this problem in docker image. When run rviz get this error: image Could you please give some advise?

oaix commented 3 years ago

Set DISPLAY solving this problem. Just run `export DISPLAY=:1` in terminal. You may set different number such as 2, 3 based on your own host compter setting.

echo ${DISPLAY} # host compter: get :0, then set export DISPLAY=:1 in docker image working for me.
export DISPLAY=:1 # run in docker image terminal
Tiryoh commented 3 years ago

Hi @oaix, thanks for your report. I tried but I could not able to reproduce. Could you tell me more detailed information?

Tiryoh commented 3 years ago

I tried on Ubuntu 20.04, with docker run --rm -p 6080:80 --shm-size=512m tiryoh/ros-desktop-vnc:noetic.

https://user-images.githubusercontent.com/3256629/131215903-593eadf4-9e79-4367-bc0b-3532d1fda6ef.mp4

oaix commented 3 years ago

@Tiryoh Thank you for your reply.
When opening terminal in browser as you do, this problem doesn't appear.
I used docker exec -it my_container bash to enter the container, then I met this problem.

Tiryoh commented 3 years ago

When opening terminal in browser as you do, this problem doesn't appear. I used docker exec -it my_container bash to enter the container, then I met this problem.

I see what you mean, did you override ENTRYPOINT or something? I don't think bash can be started as it is now, because startup.sh is being called by ENTRYPOINT. Could you share your Dockerfile? I might be able to figure out something more.

Tiryoh commented 2 years ago

Thank you for your contribution. However, at this stage it seems like this issue needs more information for the discussion. Since the updates have stopped for a period of time, I will close this once. Please feel free to reopen it.