Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

Discussion in 'Unity Render Streaming' started by wechat_os_Qy0zE5QqhaFnaGrMJcdDzXYCQ, May 18, 2022.

  1. wechat_os_Qy0zE5QqhaFnaGrMJcdDzXYCQ

    wechat_os_Qy0zE5QqhaFnaGrMJcdDzXYCQ

    Joined:
    May 9, 2022
    Posts:
    6
    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?
     
  2. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    76
  3. sunxia

    sunxia

    Joined:
    Apr 10, 2019
    Posts:
    7
    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!
     
  4. wechat_os_Qy0zE5QqhaFnaGrMJcdDzXYCQ

    wechat_os_Qy0zE5QqhaFnaGrMJcdDzXYCQ

    Joined:
    May 9, 2022
    Posts:
    6
    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.