Eu tive o mesmo problema, então aqui está a solução. A razão pela qual o teclado / mouse não funciona dentro do container 16.04 LXC do ubuntu é que o pacote xserver-xorg-input-kbd
foi descartado, então se você usou algo como
...
Driver "kbd"
...
Driver "mouse"
...
na configuração xorg do seu contêiner - ele não funcionaria no Ubuntu 16.04.
Em vez disso, você deve configurar entradas do xorg com o evdev. Como o número exato de event*
entradas no arquivo de configuração (por exemplo, /usr/share/X11/xorg.conf.d/10-lxc-input.conf
) dependerá do que está no /dev/input/
do seu contêiner, você pode usar um script para gerar um:
#!/bin/bash
cat >/usr/share/X11/xorg.conf.d/10-lxc-input.conf << _EOF_
Section "ServerFlags"
Option "AutoAddDevices" "False"
EndSection
_EOF_
cd /dev/input
for input in event*
do
cat >> /usr/share/X11/xorg.conf.d/10-lxc-input.conf <<_EOF_
Section "InputDevice"
Identifier "$input"
Option "Device" "/dev/input/$input"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
_EOF_
done
Que resulta em algo como: cat /usr/share/X11/xorg.conf.d/10-lxc-input.conf
Section "ServerFlags"
Option "AutoAddDevices" "False"
EndSection
Section "InputDevice"
Identifier "event0"
Option "Device" "/dev/input/event0"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event1"
Option "Device" "/dev/input/event1"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event10"
Option "Device" "/dev/input/event10"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event11"
Option "Device" "/dev/input/event11"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event12"
Option "Device" "/dev/input/event12"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event13"
Option "Device" "/dev/input/event13"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event14"
Option "Device" "/dev/input/event14"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event2"
Option "Device" "/dev/input/event2"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event3"
Option "Device" "/dev/input/event3"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event4"
Option "Device" "/dev/input/event4"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event5"
Option "Device" "/dev/input/event5"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event6"
Option "Device" "/dev/input/event6"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event7"
Option "Device" "/dev/input/event7"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event8"
Option "Device" "/dev/input/event8"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection
Section "InputDevice"
Identifier "event9"
Option "Device" "/dev/input/event9"
Option "AutoServerLayout" "true"
Driver "evdev"
EndSection