How to run Unity standalone player on container(eg. Docker) ?

I tried to dockerlize the sample in this project, but it failed to work.

I deployed the sample in a pod, within 2 containers, one is unity demo, another is webserver. The network is fine, I can access from browser, but:

Browser screen is like:


Unity log shows:

<I> Failed to get cursor position:
This operation requires an interactive window station

It seems that Unity play can’t run on server without GUI/displayer.

I tried to use batchmode. Unity log seems to be normal, but browser screen is still black.

What should I do to run this in docker?

Could you check these issues? I think they had same your issue.

Unity.WebRTC must run with Rendering. (not batchmode)

I have a similar problem , I can run RenderStreaming standalone game with -batchmode on Windows desktop, Windows container, and Ubuntu Desktop, but failed to get it work inside ubuntu container. There seems to be something wrong with headless logic.

Do you have any idea? Many thanks!

I can run the sample in linux container.
You can refer to this article: https://zhuanlan.zhihu.com/p/521023922

If you have any questions, please PM me in zhihu. I’m also curious about you getting it running on Windows.