Ubuntu 14 16 Plots GR - cannot get a plot window

From a terminal, I launch julia 0.6.3 and try to plot something as follows:

import Plots ; pl=Plots ;
pl.gr(legend=false, format=:png) ;
pl.plot([0,1])

On VNC-connected logins to two different Ubuntu servers (one a VM), I get error messages instead of a plot window popping up.

On my Mac, I get what I expect:

plot01

On the Ubuntu 14.04.5 LTS (VM) server, I get “Qt: XKEYBOARD extension not present” and then a seg fault (which doesn’t crash the julia session).

On the Ubuntu 16.04.4 LTS (actual) server, I get “QXcbConnection: Falied to initialize XRandr” then the same Qt message as above, then “Unsupported screen format: depth 16, red_mask: 3f, blue_mask: f800”, then “Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.” then “qksqt: Fatal IO error 2 (No such file or directory) on X server :1.”

On both servers, plotting works fine in a Jupyter notebook. And XWindows pop-ups work on both as well (e.g. xload from a terminal).

Please help!

Update 1: If I switch the backend to Plotly, I can get plots rendered into a browser tab, but cannot save programmatically as PNG. (I can use the mouse to download as PNG, but this will be tedious and unworkable for my project needs.)

Could you please install the required packages on those Ubuntu servers as described here:

apt install libxt6 libxrender1 libgl1-mesa-glx

Those were already installed, so that’s not it. Thanks anyway.

Could you please try plain X11, e.g.

using Plots
gr(format=:x11)
plot(randn(10))

Still no joy.

I use the same underlying OS (LinuxMint) and this is working – check your startups and make sure something with XRandr in the name is active as a startup program. I cannot tell you how to do that, but I do know that fixed things for me.

Can you open any X11 client? xclock xterm, …

Yes, as I wrote in the first post -