3

I'm not sure if this belongs on StackOverflow or here, but since the programs work on one version of Ubuntu, I try here.

We have a small python application that starts a virtual X display on the server once a day and then runs several programs that need the X display. This program ran fine on Ubuntu 10.04, and continued to work fine on a server with 12.04.

Now we are looking at bringing up a server using 14.04 and this application doesn't work, although all of the prerequisites have been met (latest version of PyVirtualDisplay and tightvncserver).

On 14.04 this program fails, and what is most problematic in debugging is, that we cannot peek at the X screen as we do on the 12.04 server, because on 14.04 it asks for a password. I expected this was some security change in the tightvncserver software but on both 12.04 and 14.04 this is version 1.3.9 altough the Ubuntu specific version differs (6.2 vs 6.4).

I use the same VNC client from the client machine to connect to both servers.

What can I try to get rid of the password prompt and continue to see what (else) might be wrong? I'm sure no password has been set since the server was brought up and I cannot begin to guess what it could be.

  • Normally, vncserver prompts the user to set a password the first time it is invoked for that account, which is stored (encrypted) in ~/.vnc/passwd - does such a file exist on the respective servers/accounts? Regardless, you should simply be able to run vncpasswd on the target server to set a password of your choice. – steeldriver Jun 14 '15 at 13:05
  • @steeldriver vncserver as installed from tightvnc doesn't prompt for a password. – Anthon Jun 14 '15 at 13:40
1

You should check if Xvnc -version (on 14.04) gives you:

Xvnc version TightVNC-1.3.9

it probably doesn't if connecting to the vnc server instance, that pyvirtualdisplay creates, prompts you for a password.

The cause for that is that pyvirtualdisplay checks for tightvncserver to be installed by checking if the file /usr/bin/Xvnc exists and invoking that executable if you specify the xnvc backend. That file however is a link to alternatives managed in /etc/alternatives/ and can e.g. be pointing to the vnc4server (that server requires a password and is, IIRC, the one that gets installed if you want to share your desktop via VNC).

You can change the alternative for Xvnc by running:

sudo update-alternatives --config Xvnc

and selecting the tightvncserver option. I am not sure if that has security side-effects for programs relying on the other (currently) selected server alternative.

Therefore if you can, you should change the source that pulls in pyvirtualdisplay and add the following lines (before the invocation of Display())

import pyvirtualdisplay.xvnc
pyvirtualdisplay.xvnc.PROGRAM = "Xtightvnc"

which forces the pyvirtualdisplay library to use the right server binary circumventing the Xvnc selected alternative.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.