Starting Xserver in Docker Ubuntu container

北慕城南 提交于 2019-12-07 11:33:34

问题


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


回答1:


In my case it works nicely when I start container in privileged mode:

docker run --privileged

So XServer gets access to some devices from host (including /dev/tty0).

In general case it is a bad idea to run container in privileged mode, but in my case it's okay. To avoid using --privileged you can also try --device option of docker run command.



来源:https://stackoverflow.com/questions/26075741/starting-xserver-in-docker-ubuntu-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!