I need to have a setup, where when the computer starts, it goes into X server and opens an session with two VirtualBox VMs running. I want to avoid the user starting anything else. Eventually, I hacked a crude rc.d script to start X at boot that does this:
The user's .xinitrc looks like this
Now, it all works "fine", until we get to the keyboard in the virtual machines. The VM host key (right-ctrl) does not work and in the VMs the keyboard gets some rather weird mapping, with the center up arrow being Print, for example.
The strange thing is that it all works properly, if I
- use xdm and login as that user (with the same content of .xsession)
- run an xfce4-terminal from .xinitrc and start the VMs from there
- have an full xfce desktop (but can't figure out how to remove the menus and lock it properly)
- and most weird of all.. if I quit the VMs, which makes them start again .. and this time everything works as it should.
There is probably some timing issue here, but I can't quite figure out what it is and how to address it.
Hardware is some Lenovo ThinkCentre PC, running FreeBSD 13.1-STABLE and it loads i915kms via drm-kmod. Had to recompile the drm-kmod pieces for the STABLE kernel as otherwise it would crash upon loading the module.
It appears I am missing something fairly obvious...
Code:
exec su -l user -c startx
The user's .xinitrc looks like this
Code:
#!/bin/sh
while true; do
VirtualBoxVM --startvm "FreeBSD Internet"
sleep 10
done &
while true;do
VirtualBoxVM --startvm "FreeBSD Internal"
sleep 10
done &
/usr/local/bin/xfce4-panel --sm-client-disable &
exec /usr/local/bin/xfwm4 ---sm-client-disable
Now, it all works "fine", until we get to the keyboard in the virtual machines. The VM host key (right-ctrl) does not work and in the VMs the keyboard gets some rather weird mapping, with the center up arrow being Print, for example.
The strange thing is that it all works properly, if I
- use xdm and login as that user (with the same content of .xsession)
- run an xfce4-terminal from .xinitrc and start the VMs from there
- have an full xfce desktop (but can't figure out how to remove the menus and lock it properly)
- and most weird of all.. if I quit the VMs, which makes them start again .. and this time everything works as it should.
There is probably some timing issue here, but I can't quite figure out what it is and how to address it.
Hardware is some Lenovo ThinkCentre PC, running FreeBSD 13.1-STABLE and it loads i915kms via drm-kmod. Had to recompile the drm-kmod pieces for the STABLE kernel as otherwise it would crash upon loading the module.
It appears I am missing something fairly obvious...