Charlie_Y
Posts: 4
Joined: Sun Aug 24, 2014 3:33 pm

Qt app doesn't run in vnc mode

Sun Aug 24, 2014 3:50 pm

I use vnc to connect the raspberry pi. I program an app by Qt on my PC. Then I copy the app to raspberry pi. I run the app by terminal. There is no error. But there is no graphic interface displayed on the raspberry pi (vnc window). I check the task manager. There is a process of my app.
I connect the display with HDMI. Then I run this app by vnc. The graphic interface is displayed in the display, but not on the vnc.
That's too strange. I really don't know how to solve it.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Qt app doesn't run in vnc mode

Sun Aug 24, 2014 4:54 pm

Most VNC servers spawn a different desktop session for each
connection. To get display :0 (the physical one) , use x11vnc.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Charlie_Y
Posts: 4
Joined: Sun Aug 24, 2014 3:33 pm

Re: Qt app doesn't run in vnc mode

Mon Aug 25, 2014 2:26 pm

ghans wrote:Most VNC servers spawn a different desktop session for each
connection. To get display :0 (the physical one) , use x11vnc.


ghans
Thank you!
I enter vncserver :0 -geometry 800x600.
There is a warning,

Code: Select all

raspberrypi:0 is taken because of /tmp/.X0-lock
Remove this file if there is no X server raspberrypi:0
A VNC server is already running as :0
Then i remove the .X0-lock and try again.
There is also a warning,

Code: Select all

raspberrypi:0 is taken because of /tmp/.X11-unix/X0
Remove this file if there is no X server raspberrypi:0
A VNC server is already running as :0
I remove it and try again. start successfully.
But when I login to the raspberry pi by vnc(5900), the screen is full of gray. The mouse is a "X". I can't see the desktop.

another problem is that
When I start the raspberry pi, it alway start up the graphical interface automatically. I try to configure the boot option in raspi-config or edit the /etc/inittab. But it still start up the graphical interface automatically.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Qt app doesn't run in vnc mode

Mon Aug 25, 2014 7:20 pm

You need to use x11vnc instead of the VNC server you are
currently using.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Charlie_Y
Posts: 4
Joined: Sun Aug 24, 2014 3:33 pm

Re: Qt app doesn't run in vnc mode

Tue Aug 26, 2014 1:11 pm

ghans wrote:You need to use x11vnc instead of the VNC server you are
currently using.

ghans
I connect raspberry pi successfully by 5900. But I still can not see my running app displayed in the vnc window.
I have to connect a display by HDMI to text my app.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Qt app doesn't run in vnc mode

Tue Aug 26, 2014 1:34 pm

Are you using hardware-accleration (OpenGL ES ?). You need the dipmanx_vnc server to display hardware-accelerated stuff remotely.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Charlie_Y
Posts: 4
Joined: Sun Aug 24, 2014 3:33 pm

Re: Qt app doesn't run in vnc mode

Tue Aug 26, 2014 2:24 pm

ghans wrote:Are you using hardware-accleration (OpenGL ES ?). You need the dipmanx_vnc server to display hardware-accelerated stuff remotely.

ghans
Sorry,I don't understand what is dipmanx_vnc. I cannot search something about it on the internet. Can you tell me more about dipmanx_vnc? Thank you!

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Qt app doesn't run in vnc mode

Tue Aug 26, 2014 2:28 pm


DirkS
Posts: 10347
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Qt app doesn't run in vnc mode

Tue Aug 26, 2014 2:32 pm

Charlie_Y wrote:
ghans wrote:Are you using hardware-accleration (OpenGL ES ?). You need the dipmanx_vnc server to display hardware-accelerated stuff remotely.

ghans
Sorry,I don't understand what is dipmanx_vnc. I cannot search something about it on the internet. Can you tell me more about dipmanx_vnc? Thank you!
That's a typo, it should be 'dispmanx_vnc'
BTW: Maybe you should change search engines; Google changed the search term straight away. So they got it right... at least this time ;)

Return to “Troubleshooting”