2

I'm currently working on a system that is able to run a game on a vm and stream it to a client.

I wanna try to do the same thing on a Docker container. I know that it's not the purpose of a container, but I wanna do some research about accelerating the boot time of a gaming server.

I can run a game on a Xvfb server and stream it with rtsp. I'm also able to send inputs from the client to the docker container. For that, I needed to mount /dev/uinput on my container, for I create input in /dev/input and manipulate my devices with it :

docker run --privileged=true -d --rm \
-p 32776:22  -p 5900:5900 -p 4976:4976 \
-p 8553-8600:8553-8600 -p 1663-1680:1663-1680 -p 6971-6973:6971-6973 \
--device=/dev/uinput:/dev/uinput:rwm \
--mount type=bind,source=/dev/input,target=/dev/input,bind-propagation=slave \
--mount type=bind,source=/run/udev,target=/run/udev,bind-propagation=slave \
--name docker_serv bobomb_proper:lavapools

There are also differents ports that I need for video and input streaming.

For example, I'm able to press escape or ZQSD and move my character on my game.

When I move my mouse device, the inputs are received on the server, but the Xvfb server does not move the cursor on the display.

Is there a way to tell Xvfb-run which /dev/event he needs to listen to ?

Also, I did not succeed to create new inputs only on my container. The only way I succeed to recognize my keyboards inputs is by adding --privileged on the docker run file, but it seems to create devices on my host too.

Can I create devices/event on my container only ?


Update :

https://joshh.info/2016/xserver-inside-docker-container/ I saw on this site that they are not able to move mouse neither, because of udev. But my run.sh contains -v /run/udev:/run/udev and I'm able to use my keyboard in the game, so I don't understand why the mouse cursor isn't moving.

Community
  • 1
  • 1
Ryctus
  • 109
  • 2
  • 12

0 Answers0