Xorg and keyboard, help!

Good morning!

I am running FreeBSD as a guest system in Virtualbox and need to add keyboard setting for the xorg.conf file and get the desired language, how do I proceed?

In the window managers it is essential add the keyboard configuration for the Xorg file because it does not detect the system the desired of keyboard language in thes .profile or .xinitrc and login.conf or ~/.bashrc files.
 
I'm not sure if I understand the question correctly, but to switch keyboard layouts I use the following command (added to .xinitrc):
Code:
setxbkmap -layout us,ru -option grp:caps_toggle

That is switching between us and ru layouts using CapsLock (got used to it in macos).

Also see the xkeyboard-config(7) man page for other modifiers and options.
 
it does not detect the desired keyboard language in thes files of .profile or .xinitrc files
There is no such think as "detection", you have to set your desired keyboard layout. To me the easiest way is using x11/setxkbmap, which can be launched from ~/.xinitrc. You can use Xorg configuration files as well. Your question is not FreeBSD related, there are many resources explaining available options, e.g. Arch wiki.
 
You can use Xorg configuration files as well.

That's what I want to proceed to put the keyboard configuration in the desired language in the Xorg file so that it detects the system with the window manager, example FluxBox. Remember that I am running FreeBSD as a guest system in virtualbox.
 
It's purely an Xorg setting ― not related to the WM.
I think you do not formulate your question properly, it is not clear what Xorg your are talking about: one running in the host OS or in the guest?
 
It's purely an Xorg setting ― not related to the WM.
I think you do not formulate your question properly, it is not clear what Xorg your are talking about: one running in the host OS or in the guest?
Xorg this installed in the guest system that is FreeBSD, add the language to those files mentioned above so that it detects the keyboard in the desired language however when entering the window manager it does not detect the keyboard in the desired language.
 
How do you access the guest? Via VNC?
It could be a conflict between your host keyboard layout and the guest layout.
As other people and myself mentioned above, try using setxbmap() in a terminal running in the guest to understand whether it's an Xorg issue or something else. It perfectly works in any scenarios, and I use it as preferred method in all my computers with a simple wrapper I wrote to indicate the actual layout with an icon in the status bar. Again, you don't have to use it, but it's worth checking to understand the issue.
 
How do you access the guest? Via VNC?
I don't understand what you mean by VNC? The virtual machine is accessing the guests by Adding Guests. When the guest system is installed, the guest system detects what is on the main system hardware, in this case the keyboard and others.
 
T-Daemon pointed the right chapiter in the handbook. Please, take time to read it.
It's exactly what I use concerning Xorg, no matter if it is a VM or not.
 
In the window managers it is essential add the keyboard configuration for the Xorg file because it does not detect the system the desired of keyboard language in thes .profile or .xinitrc and login.conf or ~/.bashrc files.

For present and future VirtualBox FreeBSD guest installations, if you are interested why the settings for the keyboard layout in the mentioned files are ineffective, you could share them here. In case you are concerned about privacy, copy & past only the relevant parts from those files.
 
T-Daemon pointed the right chapiter in the handbook. Please, take time to read it.
It's exactly what I use concerning Xorg, no matter if it is a VM or not.
I proceed to add this to the Xorg configuration file, and it gave an error.

# vi /usr/local/etc/X11/xorg.conf.d/keyboard-es-oss.conf

Code:
Section  "InputClass"
                 Identifier    "KeyboardDefaults"
                Driver        "keyboard"
                MatchIsKeyboard    "on"
                Option        "XkbLayout" "es"
                Option        "XkbVariant" "oss"
EndSection


And:

# vi /etc/xorg.conf

Code:
Section   "InputDevice"
               Identifier       "Keyboard0"
               Driver          "kbd"
               Option          "XkbModel"     "pc105"
              Option          "XkbLayout"     "es"
EndSection


Or:

# vi /usr/local/etc/X11/xorg.conf.d/keyboard-fr-oss.conf

Code:
Section "InputClass"
             Identifier  "FreeBSD DEVD kbdmux interface"
             MatchIsKeyboard  "on"
             MatchDevicePath  "/dev/kbdmux*"
             Driver  "keyboard"
            Option  "Protocol"  "standard"
            Option  "XkbRules"  "base"
            Option  "XkbLayout" "es"
            Option  "XkbModel"  "pc105"
EndSection
 
The first wrong think I see is:
Option "XkbLayout" "es"
Option "XkbVariant" "oss"
"oss" is a variant of French, not Spanish. Check /usr/local/share/X11/xkb/rules/xorg.lst.

Why don't you want to use x11/setxkbmap to check your settings? Make sure they are correct, then add them to a *.conf file.
 
I don't use any xorg.conf and as far as I know, you shouldn't. You have to place your Xorg configuration files in /usr/local/etc/X11/xorg.conf.d/.
Have you tried to delete (or rename) xorg.conf and create a file, say /usr/local/etc/X11/xorg.conf.d/keyboard.conf like this?
Code:
Section   "InputClass"
               Identifier       "KeyboardDefaults"
               Driver          "keyboard"
               MatchIsKeyboard "on"
              Option          "XkbLayout"     "es"
EndSection

And if it doesn't work, what is the error you mention?
 
I don't use any xorg.conf and as far as I know, you shouldn't. You have to place your Xorg configuration files in /usr/local/etc/X11/xorg.conf.d/.
Have you tried to delete (or rename) xorg.conf and create a file, say /usr/local/etc/X11/xorg.conf.d/keyboard.conf like this?
Code:
Section   "InputClass"
               Identifier       "KeyboardDefaults"
               Driver          "keyboard"
               MatchIsKeyboard "on"
              Option          "XkbLayout"     "es"
EndSection

And if it doesn't work, what is the error you mention?

It seems that I have configured the keyboard of the Xorg file getting the desired language, thanks for your ideas. Finally it was like that and it didn't give any error.


# vi /usr/local/etc/X11/xorg.conf.d/keyboard.conf
Code:
Section  "InputClass"
              Identifier        "KeyboardDefaults"
              Driver            "keyboard"
              MatchIsKeyboard   "on"
              Option            "XkbLayout"     "es"
              Option            "XkbModel"      "pc105"
EndSection
 
Back
Top