Solved Keyboard configuration disaster

quamenzullo

Active Member

Reaction score: 22
Messages: 162

Hello,

I'm trying to setup a FreeBSD desktop as guest in VirtualBox.
I have no /etc/X11/xorg.conf, instead I've put the customized configuration in /usr/local/etc/X11/xorg.conf.d/.
There, I've added two files:
  • mouse0.conf that contains the exact same content as described in the handbook (no problem).
  • keyboard.conf that contains (inspired by the handbook too):
Code:
Section "InputClass"
Identifier "KeyboardDefaults"
Driver "keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "fr"
EndSection

Problem is, when I startx into XFCE, pressing any key outputs a random series of letters and symbols mixed (twice the same key results in different series of symbols). So, it looks like a disaster.

I guess this has to do with this new udev setting of X.Org. Only, suggested solutions from the forum tell about recompiling X.org, but I installed everything from pkg install, so I won't recompile X.Org using this new option (also I don't want to mix ports and packages).

Does it make the use of X.Org configuration files (temporarily, or definitely) unavailable? Is there any workaround or solution for package users available?

(Only workarounds I could find so far: simply remove keyboard.conf and set the keyboard from XFCE settings, this works. I guess using setxkbmap in .xinitrc would work too.)
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

Driver "keyboard"
Remove that line, try again, if problem persists read:
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

Thank you very much, removing the Driver "keyboard" line solves the issue!
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

Well, there are still some weird issues actually: using keyboard.conf works, but the up arrow key is missing; same problem as when I use the XCFE setting; no such problem when using setxkbdmap in .xinitrc. But at some point, the desktop kind of freezes: mouse pointer is still active and moveable but it's impossible to click anywhere (no idea about the keyboard state). Is this maybe related to the fact that FreeBSD is only a guest in VirtualBox? Maybe that leaves this kind of problems?
 

Emrion

Aspiring Daemon

Reaction score: 227
Messages: 690

I have xorg-server-1.20 in VirtualBox but I use Lxde. I haven't this kind of problem with the mouse.

Never added a mouse.conf that said. Can you rename it (remove .conf) to make Xorg ignore it and make a try?
You can sysrc moused_enable=YES or change sysctl.conf to add this: kern.evdev.rcpt_mask=6 (or both).
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

I removed mouse.conf and the mouse still works (but actually moused_enable was already set to YES in /etc/rc.conf).
In the meanwhile I have installed upgraded libudev-devd.
After having added kern.evdev.rcpt_mask=6 to sysctl.conf, and restarted, I let the desktop for a while, it "froze" again after about 10 minutes.
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

Well, there are still some weird issues actually: using keyboard.conf works, but the up arrow key is missing; same problem as when I use the XCFE setting;
That is most likely this bug: PR 244290

I removed mouse.conf and the mouse still works (but actually moused_enable was already set to YES in /etc/rc.conf).
I have no moused_enable set to "YES" (default is set to "NO" in /etc/defaults/rc.conf) in my vm's.

I let the desktop for a while, it "froze" again after about 10 minutes.
Does only the desktop freeze or the whole system? Are you able to change into a console?

Furthermore, have you enough video and base memory assigned for the FreeBSD vm, and have you any 2D/3D video acceleration enabled? You could try a lightweight window manager, to check if it’s related with xfce4.
I have multiple FreeBSD vm’s, running wm’s with small footprint (openbox, awesome, jwm). I don’t experience such a desktop freeze. Apropos which FreeBSD version are you running on which host system?
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

That is most likely this bug: PR 244290
Yes, definitely. So I'll stick to the setxkbmap workaround.

I have no moused_enable set to "YES" (default is set to "NO" in /etc/defaults/rc.conf) in my vm's.
I removed it and now the mouse pointer still moves (and icons react when hovering them) but clicks are ignored. Same behaviour in XFCE and MATE.
If I put mouse.conf back to /usr/local/etc/X11/xorg.conf.d/, I still get the same behavior.
So, anyhow this moused_enable="YES" seems required in my VM. No idea why.

Does only the desktop freeze or the whole system? Are you able to change into a console?
Not the whole system: the mouse pointer still moves. But the icons do not react when hovering them. Clicks get ignored. The terminal seems unfocused. Also, it happened during a pkg upgrade. I let it run until it was finished, I could see the progress in the terminal. I just could not click on it nor anywhere else.

It does not seem possible, unfortunately, to switch to console, because ctrl-alt-F1 doesn't seem to be "catched" by the VM, instead my host system switches to console. Well I've tried before the freeze happens and it's the same, so actually I don't know how to "redirect" these key combinations to the VM. Can't find anything that looks relevant in the VM configuration.

Also sometimes FreeBSD simply seems to crash: it restarts suddenly on its own. Once it happened while XFCE was loading, before showing the complete desktop.

Furthermore, have you enough video and base memory assigned for the FreeBSD vm, and have you any 2D/3D video acceleration enabled?
I've let the default values for video (16 MB) and memory (1 GB). Is this too low? The RAM looks OK, but I don't know if it's relevant to try to increase the video memory.
The 3D acceleration is disabled, I give a try with it enabled... Well first, strange thing: I also installed cinnamon just to see and it still complains about missing 3D acceleration (though it's checked in the VM configuration). So, I don't know if it is really taken into account.

You could try a lightweight window manager, to check if it’s related with xfce4.
In the meanwhile, I did try the contrary by installing and running MATE. I let it alone for a much longer time and it didn't freeze like that. Unfortunately I'd prefer XFCE...

I have multiple FreeBSD vm’s, running wm’s with small footprint (openbox, awesome, jwm). I don’t experience such a desktop freeze. Apropos which FreeBSD version are you running on which host system?
It's a FreeBSD 12.1 guest on an up-to-date Manjaro Linux (linux kernel 4.14).
 

Emrion

Aspiring Daemon

Reaction score: 227
Messages: 690

I took a FreeBSD 12.1-RELEASE VM under VirtualBox 6.0.18 / Windows 7 with xorg-server-1.18 (and xfce). I did a pkg upgrade, got xorg-server-1.20, made the required modifications in the config files. There is actually a problem with the up arrow (I choose to suppress the shortcut for the 'print' key in order to solve that).

I don't use moused nor xorg config file for the mouse. All is working correctly. I don't know if it will help you but...
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

I may try on an old laptop, see what happens.
Also I tried with Openbox, no problem. This freeze seems related to XFCE, and may be unrelated to the keyboard problem.
With XFCE, it looks like something is crashing, but not X.Org, or maybe a subprocess of it (don't know how it works). I'd liked to know if there are any logfiles worth checking after such a freeze.
Thanks for your time and replying anyway!
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

It does not seem possible, unfortunately, to switch to console, because ctrl-alt-F1 doesn't seem to be "catched" by the VM, instead my host system switches to console.

Try the key combination in guests fullscreen, or Host + F1.
I'd liked to know if there are any logfiles worth checking after such a freeze.

That I wanted to suggest. On linux the logs should be in $HOME/.VirtualBox/Machines/<vm name>/Logs.

You can also try increasing video and base memory, also disable video acceleration.
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

Well, the VM's log file won't be of any help I fear: I started the VM until XFCE is running and noticed the exact line number where the log stops. Then I leave it alone and check a little bit later that it's frozen: then, there's nothing new in the log file.

The console, on the other hand, looks more interesting:
console.png

Might this not mean that xfce4-panel did crash?

Problem: I tried a second time, to check if the critical error really happens when the freeze happens and the second time, the console didn't show any error (only the GObject critical and the warnings...)

Thanks to Host+F2, Host+F3 etc. I could explore /var/log/Xorg.0.log. I noticed several device removed lines:
console2.png

But they seem to occur from time to time. It does not seem related to anything special (from the user's point of view).

Something weird too: at some point, the text mode does not work any longer. I have to switch to another tty to log in again and further type commands.

Here the configuration files, if there's anything obvious I have forgotten or wrongly included:

/boot/loader.conf
Code:
vboxvfs_load="YES"
kern.ipc.shmseg="1024"
kern.ipc.shmmni="1024"
kern.maxproc="100000"

fuse_load="YES"
coretemp_load="YES"
tmpfs_load="YES"
aio_load="YES"

libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"

aesni_load="YES"

net.link.ifqmaxlen="2048"

/etc/sysctl.conf
Code:
# $FreeBSD: releng/12.1/sbin/sysctl/sysctl.conf 337624 2018-08-11 13:28:03Z brd $
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0

# Enhance shared memory X11 interface
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768

# Enhance desktop responsiveness under high CPU use (200 or 224 for heavy GUI)
kern.sched.preempt_thresh=224

# Bump up maximum number of open files
kern.maxfiles=200000

# Disable PC speaker (syscons and vt modes)
hw.syscons.bell=0
kern.vt.enable_bell=0

/etc/rc.conf
Code:
sendmail_enable="NONE"
hostname="xochipilli"
keymap="fr.kbd"
ifconfig_pcn0="DHCP"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
vboxguest_enable="YES"
vboxservice_enable="YES"
powerdxx_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
ntpd_flags="-g"
firewall_enable="YES"
firewall_type="workstation"
firewall_quiet="YES"
firewall_logdeny="YES"
firewall_logging="YES"
kld_list="/boot/modules/i915kms.ko cuse"
dbus_enable="YES"
hald_enable="YES"
openvpn_if="tun"
 
OP
quamenzullo

quamenzullo

Active Member

Reaction score: 22
Messages: 162

I installed FreeBSD on an old laptop with XFCE and I have the exact same problem.
 
Top