Alt key not working on Xfce-4 accessed with tigervnc

58 views
Skip to first unread message

Peter Pearman

unread,
Apr 1, 2023, 9:39:53 AM4/1/23
to TigerVNC User Discussion/Support
Hello All,
I am on a MacPro running Monterey 12.6.3. My vnc client is the native one accessed through Finder=>Go=>Connect to Server.  My local machine has a German (Switzerland) keyboard and the the language is set to CH-DE.
All keys work as expected locally on the local Mac. But when connected to an Ubuntu workstation via vnc, the Alt key has very limited functionality, as to ctrl and cmd.

I am using Xvnc from TigerVNC 1.12.0 on Ubuntu 22.04.  I access this through a tunnel to the server as 5903.127.0.0.1:5903. Alt-3 produces # and linefeed, and Alt-7 and Alt-/ produce nothing, instead of | and \, respectively. Cmd-C and other Cmd-key combinations also do not work. This behavior is reproduced in Libreoffice and Rstudio.

I start a desktop on the remote Ubuntu workstation with
~$ tigervncserver -xstartup startxfce4 -geometry 1920x1080 -localhost yes :3

the contents of ~/.vnc/xstartup are:
.vnc$ cat xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-terminal-emulator -geometry 80x24+10+10 &
x-window-manager &

#gnome-panel &
#gnome-settings-daemon &
#metacity &
#nautilus &
xrdb $HOME/.XRESOURCES
startxfce4 &

On the Ubuntu machine, the file ~/.XRESOURCES is empty.

In the Settings->Keyboard window in Xfce4,
Keyboard model is ‘Macintosh’, which is what is on the MacPro
'Change layout' and 'Compose key' options are both set to ‘-‘
Keyboard layout is ‘German (Switzerland)’. (I have also tried the other Swiss-German keyboard options, but still no working Alt key).

I reviewed the logging of keyboard events with
~$ dev -event keyboard

A single quick press and release of the Alt key appears to produce two Keypress events and two Keyrelease events:

KeyPress event, serial 28, synthetic NO, window 0x3600001,
    root 0x519, subw 0x0, time 4835427, (-189,72), root:(1412,477),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x3600001,
    root 0x519, subw 0x0, time 4835427, (-189,72), root:(1412,477),
    state 0x1, keycode 64 (keysym 0xffe7, Meta_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3600001,
    root 0x519, subw 0x0, time 4835427, (-189,72), root:(1412,477),
    state 0x9, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3600001,
    root 0x519, subw 0x0, time 4835609, (-189,72), root:(1412,477),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

At the Ubuntu workstation, the physical keyboard is a Spanish PC keyboard, and all keys work as expected.  At the workstation:

$ localectl
   System Locale: LANG=en_US.UTF-8
                  LC_NUMERIC=es_ES.UTF-8
                  LC_TIME=es_ES.UTF-8
                  LC_MONETARY=es_ES.UTF-8
                  LC_PAPER=es_ES.UTF-8
                  LC_NAME=es_ES.UTF-8
                  LC_ADDRESS=es_ES.UTF-8
                  LC_TELEPHONE=es_ES.UTF-8
                  LC_MEASUREMENT=es_ES.UTF-8
                  LC_IDENTIFICATION=es_ES.UTF-8
       VC Keymap: n/a
      X11 Layout: es
       X11 Model: pc105

It appears that changing the keyboard layout on Xfce during a tigervnc connection doesn’t update the settings of the accessed Xfce4 desktop.  How should I go about getting a functional Alt key when using a vnc connection to this Ubuntu workstation?  I don’t want to change the Ubuntu machine’s keyboard definition permanently because the computer needs to be usable as a workstation, and doesn’t have a Mac keyboard.
Thanks in advance!
Peter

Pierre Ossman

unread,
Apr 3, 2023, 1:49:48 AM4/3/23
to Peter Pearman, TigerVNC User Discussion/Support
On 01/04/2023 15:39, Peter Pearman wrote:
>
> It appears that changing the keyboard layout on Xfce during a tigervnc
> connection doesn’t update the settings of the accessed Xfce4 desktop. How
> should I go about getting a functional Alt key when using a vnc connection
> to this Ubuntu workstation? I don’t want to change the Ubuntu machine’s
> keyboard definition permanently because the computer needs to be usable as
> a workstation, and doesn’t have a Mac keyboard.

The keyboard is mostly handled by the client in VNC, so I'm afraid this
is likely an issue with Apple's client.

To complicate things, the Alt key behaves a bit differently on macOS
compared to other systems. It essentially behaves like the AltGr key.

Have you tried using the TigerVNC client instead?

Regards
--
Pierre Ossman Software Development
Cendio AB http://cendio.com
Teknikringen 8 http://twitter.com/ThinLinc
583 30 Linköping http://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Peter Pearman

unread,
Apr 24, 2023, 8:37:04 AM4/24/23
to TigerVNC User Discussion/Support
OK, Pierre.  Thank you. Use the TigerVNC client.  That's a reasonable suggestion.
So, I installed TigerVNC Viewer 1.13.1.  Then, after establishing the ssh tunnel with 127.0.0.1:5903 and starting the VNC server:
~$ tigervncserver -xstartup startxfce4 -geometry 1920x1080 -localhost yes :3

I can successfully connect to the VNC server using the Mac native VNC viewer, with vnc://127.0.0.1:5903. So the tunnel seems to be established (even though the Alt-key doesn't work) and the server listening as it should, confirmed here:.
~$ sudo netstat -tulpn
.
.
tcp        0      0 127.0.0.1:5903          0.0.0.0:*               LISTEN      8969/Xtigervnc

I try to connect using the same local host and 5903 port, using TigerVNC Viewer.  I get a error message pop-up with:
Failed to connect to "vnc://127.0.0.1:5903
unable to connect to socket: No such file or directory (2)

There are a number of connection options in TigerVNC Viewer, including Compression, Security, Input, Display, and Misc.These address compression type, encryption and authentication. None of the corresponding checkbox options addresses anything related to a missing file or directorym except one, which has to do with TLS X509 CA and CRL files and certificates. I don't see the Mac VNC client using these. But something essential seems to be missing, perhaps on the Viewer side.  I have tried a number of these options, but I get the same error messages. Does anyone have any suggestions?
Peter

Pierre Ossman

unread,
Apr 25, 2023, 1:48:39 AM4/25/23
to Peter Pearman, TigerVNC User Discussion/Support
On 24/04/2023 14:37, Peter Pearman wrote:
>
> I try to connect using the same local host and 5903 port, using TigerVNC
> Viewer. I get a error message pop-up with:
> Failed to connect to "vnc://127.0.0.1:5903
> unable to connect to socket: No such file or directory (2)
>

Don't use the URL syntax, just connect to "127.0.0.1:5903".

william seo

unread,
May 1, 2023, 7:28:53 AM5/1/23
to TigerVNC User Discussion/Support

Hi!


How are you?


How is everything going?  Hope all is well!


We have skills to boost your website personal blogs. We are providing strong back-links that can Increase Your Website Traffic as well as Your Website/Blog Ranking over Search Engines.


1)- Posting in Time


2)- Will offer discount on Bulk Orders


3)- Your post will fall into the correct category as I have a huge inventory of Sites.


4-) Permanent Guest Post


Websites URLs SEMrush Traffic US Traffic Monthly Visit

https://leedaily.com                            89.7K                48.65%       183.2K

https://landscapeinsight.com        28.5K              24.31%     141.6K

https://gossipsdiary.com               27.2K              41.56%     143.4K

https://startup.info                         22.7K              25.64%     331.5K

https://www.techstry.net               19.5K               29.75%     67.4K

https://www.techfollows.com        16.1K               23.87%     280.3K

https://expressdigest.com            7.59K               29.94%     181.1K

https://geekymint.com                  6.65K               23.64%      397.9K

https://stanfordartsreview.com     2.71K               43.78%      39.6K

https://techbullion.com                 53.5K               29.31%      452.3K


I want to work with you. Give me one chance to work with you.


Kind Regards

Reply all
Reply to author
Forward
0 new messages