Page 1 of 1

[SOLVED] vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 17th, '18, 10:19
by magfan
I need a vncserver running on my workstation to send the graphical output of some programs there. But occasionally I have to login that server to see what is going on. This was working with mga5 but now with mga6 I will see only a black screen with a KDE message box: "Plasma is unable to start as it couldn't correctly use OpenGL 2. Please check that your graphic drivers are set up correctly." Any idea how to overcome this problem? Where could I choose a different window manager if KDE/Plasma causes this problem?

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 17th, '18, 13:46
by wintpe
Hi Magfan

interpreting your problem, im guessing you mean you have a server running mageia and a workstation, the server is headless and you want to view its desktop on your workstation.

That should be possible with vnc, but i must admit ive not tried vnc recently because this is not how unix people run servers, maybe windows people do it that way.

instead of running a graphical desktop on the server, why not enable sshd and administer the server via the command line.

This is how those of us who are loosely termed unix system admins work all the time.

if your using your so called server to run desktop apps then maybe you should know that Xwindows has the ability to start an app on one system, and display it on another.

its done either with Xforwarding enabled in ssh automatically (ssh will set your DISPLAY=workstationaddress:10.0

or without ssh tunneling by explicitly setting the DISPLAY=worksattionaddress:0.0, followed by export DISPLAY

then just start the app on the server using an ssh connection and it will appear on your workstation.

(note, workstation firewall may need to be configured or disabled, and xhost + run in a terminal on your workstation, initially followed by some tweaking once its working to make it secure again)

otherwise a server should serve , by running services that workstations, tablets, and phones connect to. otherwise its just another desktop that you want to connect to.

regards peter

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 17th, '18, 14:05
by magfan
No, I have only a workstation. And I have a program based on Matlab which displays a lot of windows while running. The problem with this program is that it will show new windows on the active DISPLAY. So, occasionally there will be windows popping up from that program - no matter which DISPLAY I am currently using. In mga5 I simply sent the output of that program to a vncserver running on my workstation because the program will not start at all if I use the Matlab option "-nojvm" (= no Java). This makes it very hard to make that program run in the background...

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 17th, '18, 15:47
by wintpe
OK i understand now.

there is a way to start a background X server , that does not actually attach to your screen.

Xvfb :10 -ac -screen 0 1024x768x24 &

then start your client like this

DISPLAY=:10 mattlab

regards peter

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 18th, '18, 09:34
by magfan
OK, this works. But now I do not have a chance to see any progress of that program, do I?

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 18th, '18, 11:04
by wintpe
nope, but you could attach your vnc server to that display, if thats what you need.

matlab also has a cli mode that allows you to create a m-file and run jobs in the background

regards peter

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 18th, '18, 13:28
by magfan
What I have now is the following:

Start a display via systemd service:
Code: Select all
[Unit]
Description=xvfb Service
After=network.target

[Service]
ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset

[Install]
WantedBy=multi-user.target


Attach vncserver to that display via systemd service:
Code: Select all
[Unit]
Description=x11vnc service
After=network.target xvfb.service

[Service]
ExecStart=/usr/bin/x11vnc -display :99 -localhost

[Install]
WantedBy=multi-user.target

Look at the display from a terminal:
Code: Select all
# /usr/bin/vncviewer :0


This works well. But when I close the vncviewer also the vncserver dies. How can I avoid this?

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 18th, '18, 15:49
by wintpe
from the man page

By default x11vnc will not allow the screen to be shared and it will exit as soon as the client disconnects.
See -shared and -forever below to override these protections.

-forever

Keep listening for more connections rather than exiting
as soon as the first client(s) disconnect. Same as -many
To get the standard non-shared VNC behavior where when
a new VNC client connects the existing VNC client is dropped use: -nevershared -forever This method can also be used to guard against hung TCP connections that do not go away.

regards peter

Re: vnc: black screen with KDE/Plasma (mga6)

PostPosted: Jan 18th, '18, 17:04
by magfan
Thank you Peter! It is working now.