Peter's Blog

Redefining the Impossible

Funny keys in VNC


After saying how wonderful vnc was yesterday I came across a real weird problem today. Yesterday I was booting vncserver as root using:

sudo vncserver :1

as when I ran it as me I got:

pcw@intranet:~$ vncserver :1
cat: /home/pcw/.vnc/passwd: Permission denied
xauth:  error in locking authority file /home/pcw/.Xauthority
xauth:  error in locking authority file /home/pcw/.Xauthority
sh: /home/pcw/.vnc/intranet:1.log: Permission denied
sh: /home/pcw/.vnc/intranet:1.pid: Permission denied

New 'X' desktop is intranet:1

Starting applications specified in /etc/X11/Xsession
Log file is /home/pcw/.vnc/intranet:1.log

sh: /home/pcw/.vnc/intranet:1.log: Permission denied
pcw@intranet:~$

which is not good. Running as root had the problem that it was effectively a root login session, all processes were owned by root etc and I would rather run as me. Looking at file permissions the problem turned out to be because all those files were read-only for root so by deleting them I could run vncserver as myself.

But.

I connected with VNC and tried running the Synaptic package manager and it refused my password. What? I tried opening a terminal to run dselect and whatever I typed in came out as garbage. for example, the 's' key gave me a 'b'. Quitting out and running the vnc server again as root gave me no problems.

Eventually I found the reason. Under the Gnome preferences, root has the keyboard layout set to vanilla US but my own account had it set to UK which is what I asked ubuntu for when I installed it. Resetting the layout to it's default changed it to US and restarting gave me a functional keyboard: with UK settings including £ characters. Very odd.


Filed under: linux ubuntu vnc

3 Comments

Andy Says:

over 4 years ago

Hi Peter!

I've got the same problem here as you've described. But how did you reset your keyboard layout? I tried 'kbdconfig' and the option in gnome but none of the worked. How did you reset it? Could you lend me a hand, please!?

Greets, Andy

Ps: my first post vanished somehow...

Peter Says:

over 4 years ago

It is a while since I did it but I think I used Gnome Control Center, in the keyboard section, on the layouts tab.

Your posts to my site would appear to vanish because I like to moderate them before they will appear. That way I can cut out lots of adverts for medicinal products.

Peter

Jay Says:

about 1 year ago

Just to say, for anyone else hitting this page and the problem exists for root too, use this links:

blog.yclian.com/2007/12/3-solutions-to-gnomevnc-keyboard.html

The last one works best, I deleted all my layouts and added two random characters. Worked a treat :)

Sorry but comments on this post are now closed.