lxc nvidia错误:xf86EnableIOPorts:无法为I / O设置IOPL(不允许操作)

在尝试让lxc容器(主机16.04,lxc 14.04)共享nvidia的过程中,我在容器中启动X时遇到此错误:

startx – vt8

我收到以下错误:

xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted) 

我也在/var/log/Xorg.0.log中收到以下警告:

 (WW) NVIDIA(0): Unable to get display device for DPI computation. 

任何帮助将不胜感激。 到目前为止,我还没有能够使用16.04主机的lxc和nvidia图形。 使用14.04容器我无法使用16.04容器启动图形我无法使键盘/鼠标工作。

我有同样的问题,所以这是解决方案。 键盘/鼠标在ubuntu 16.04 LXC容器内不起作用的原因是xserver-xorg-input-kbd包被删除了,所以如果你使用像

 ... Driver "kbd" ... Driver "mouse" ... 

在容器的xorg配置中 – 它不适用于ubuntu 16.04。

相反,您应该使用evdev配置xorg输入。 由于配置文件中的event*条目的确切数量(例如/usr/share/X11/xorg.conf.d/10-lxc-input.conf )将取决于容器的/dev/input/ ,可以使用脚本生成一个:

 #!/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 

其结果如下: 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