game-ci / game-ci/docker

xvfb-run is not invoked as root user when using runAsHostUser

Open
#240 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dockerfile
Stars
470
Forks
140
PR merge metrics
No merged PRs in 30d

Description

**Bug description**

When using the `runAsHostUser` flag in unity-builder and unity-test-runner, `xvfb-run` is invoked without root privileges.
This causes the following errors:
`_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.`
`_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root`

**How to reproduce**

Run unity-builder or unity-test-runner with `runAsHostUser` on a self-hosted runner.

[Full log](https://github.com/game-ci/docker/files/14261679/playmode.log)
[Workflow file used](https://github.com/mfbrantner/MaroonCI-CD/actions/runs/7882440707/workflow)

**Expected behavior**

`xvfb-run` should not throw any errors.

**Additional details**

A similar issue is also described [here](https://phabricator.wikimedia.org/T202710) and [here](https://github.com/dimkir/nightmare-lambda-tutorial/issues/10).

It seems that adding `-nolisten unix` to the arguments that are passed to Xvfb fixes this issue.

My proposal would be to add `--server-args="-nolisten unix"` to the line where the alias for the unity-editor is created:
https://github.com/game-ci/docker/blob/33cc94c160e496034f2b72b39a424b5a5daffbe2/images/ubuntu/editor/Dockerfile#L64

However, I am unsure if this change would have any unforeseen consequences.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.