Background
Another day with Ubuntu and another nebulous error 8-). I recently setup my 2nd permanent Ubuntu system, which would be used exclusively by my wife. I used 10.04 and the install went fine. During the install one of the dialogs asked if I wanted to login automatically.
Given this was going to be exclusively used by her, I went ahead and enabled it to automatically login.
Well apparently there’s a bit of a bug in the following use case:
- enable automatic login
- enable VNC server (Vino) with a password
- try to connect to box with a VNC client
- Doesn’t work!
Why? Well when I went to check on the Ubuntu box I saw that the Gnome Keyring Manager dialog was popped up waiting for me to put in my password to unlock Gnome’s Keyring. Kinda hard to do this when working remotely 8-).
Solution
This thread on launchpad provided a useful workaround. First open up the Passwords and Encryption Keys app (Applications -> Accessories -> Passwords and Encryption Keys) from Gnome’s top panel Applications pull down.
Right click on Passwords:login and unlock it.
Keyring Passwords:login item is now unlocked.
Expand the Passwords:login item and then delete the entry, vino.local:5900 entry, this is your VNC password within the gnome keyring!
Now close the Passwords and Encryption Keys dialog box and invoke gconf-editor.
1 |
% gconf-editor
|
Next navigate with gconf-editor’s tree to /desktop/gnome/remote_access.
Right click on vnc_password, and an edit key dialog box will pop up.
In a terminal window, run the following command to base64 encode your desired VNC password. For example:
1 2 3 4 5 6 |
# NOTE: YOU MUST USE THE -n SWITCH! # Otherwise the trailing carriage return and linefeed emitted by # the echo command will also be part of the encoded string! me@scully:~$ echo -n "my_vnc_password" | base64 bXlfdm5jX3Bhc3N3b3Jk |
Take the resulting string and paste it into the Edit Key dialog box. Take care not to include any extra charcters such as carriage returns of linefeeds.
Finally close gconf-editor and test out your VNC server by connecting to it with a VNC viewer such as vncviewer. The only drawback with this approach is that your VNC password is weakly stored, Base64 encoded, within a gconf xml file.
1 2 3 4 5 6 7 8 9 10 11 |
% pwd /home/me/.gconf/desktop/gnome/remote_access % ls -l %gconf.xml % more %gconf.xml <?xml version="1.0"?> <gconf> <entry name="vnc_password" mtime="1289286946" type="string"> <stringvalue>bXlfdm5jX3Bhc3N3b3Jk</stringvalue> ... ... |
Useful Links
NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.