Ask Your Question

How do I use xhost for this situation?

asked 2016-12-30 04:47:28 -0500

sharan100 gravatar image

updated 2017-01-04 03:40:06 -0500

I am currently trying to make an autonomous drone using the Robot Operating System (ROS). To do this, I have installed Raspbian Lite (Jessie) on a Rasperry Pi 3 and am currently using ROS Kinetic on it. I decided to go with Openbox Window Manager and installed a terminal onto it for convenience. I can just call sudo startx. Since it is a system-wide terminal, I have also installed tmux for convenience. I am running the xserver on a particular pane and conduct my ROS work on other panes.

Now when I try to run commands that call on a GUI application from my system-wide terminal, I get the error:

QxcbConnection: Could not connect to display

After a recommendation from this question, I decided to install xhost on my terminal emulator. After invoking xhost + in the same emulator, I get this:

access control disabled, clients can connect from any host

After which I invoke xhost which returns with:

access control disabled, clients can connect from any host

Therefore, within my system-wide terminal, I have set the environmental variable to 5 different values which have been listed below, and tried to run the program which calls on the $DISPLAY, but I get the same QxcbConnection: Could not connect to display error.


The last one was actually from the linked question. To my understanding, I am doing exactly what is listed out in this man page. What am I doing wrong?

Extra notes

Currently my remote drone isn't flying at all. I am programming on the Raspberry Pi completely as of now. So therefore, the only way, that I can get a GUI screen is to output the GUI of the window manager from a kernel virtual terminal device. I want to know how I can connect from one virtual device to the other using xhost. Should I do this over the internet?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-01-01 09:18:50 -0500

ChriMo gravatar image

updated 2017-01-01 12:19:38 -0500

gvdhoorn gravatar image

Hi, I'm not completely sure, what you want to do :-(

First of all I need to know proper names: Drone + ControlPC

My ControlPC has X-Windows-Server running and I enable remote display access with: xhost +

Now my remote drone is allowed to open a graphics display at my ControlPC.

From the ControlPC you can do now a simple ssh -C -X <drone ip address> to access the drone. When you start now inside the ssh session a graphical application the output window will be shown at you ControlPC.

Is this what you want to do ?

Happy hacking Cheers Christian

edit flag offensive delete link more


Hey, sorry about my late reply. Just added some info to the question to clear a few things out.

sharan100 gravatar image sharan100  ( 2017-01-04 03:40:37 -0500 )edit

I cannot ssh into my drone, since I don't have a control PC to start with.

sharan100 gravatar image sharan100  ( 2017-01-04 03:48:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-12-30 04:47:28 -0500

Seen: 672 times

Last updated: Jan 04 '17