8

I have minimal Ubuntu installation in my container and I want to have Xserver running. I need XServer, because my app requires meshlabserver, which itself needs Xserver.

I installed xserver-xorg and all other packages, but when I try to start X in container via

/usr/bin/X :0

it says:

Fatal server error:
(EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)

What am I doing wrong? How do I start X server?

UPDATE:

related question: Host screen turns off when I start X server in docker container

4

1 回答 1

12

就我而言,当我以特权模式启动容器时,它运行良好:

docker run --privileged

因此 XServer 可以从主机(包括/dev/tty0)访问某些设备。

在一般情况下,以特权模式运行容器是一个坏主意,但在我的情况下没关系。为避免使用--privileged,您还可以尝试使用命令--device选项。docker run

于 2014-09-29T16:20:55.730 回答