Steam-Headless / docker-steam-headless

A Headless Steam Docker image supporting NVIDIA GPU and accessible via Web UI
GNU General Public License v2.0
734 stars 80 forks source link

[Bug]: Steam not installable into docker container in `latest` tag #55

Closed tnielsen2 closed 12 months ago

tnielsen2 commented 12 months ago

Describe the Bug

Steam is not installed in the container, nor can I install/see it using VNC. I am unable to install using the scripts due to what appears to be a missing user/home.

Steps to Reproduce

Followed exact instructions here: https://github.com/Steam-Headless/docker-steam-headless/blob/master/docs/docker-compose.md

Container launches and I can remote into it using VNC with no issues, however the steam application is missing.

Docker logs:

sudo docker logs d08d99e0f082
Build: [2023-07-09 01:27:11] [master] [0b600108f7447fdbd1017b76887d5da2cb26aff8]

[ /etc/cont-init.d/10-setup_user.sh: executing... ]
**** Configure default user ****
Setting default user uid=1000(default) gid=1000(default)
usermod: no changes
Adding default user to video, audio, input and pulse groups
Adding default user to any additional required device groups
Adding user 'default' to group: 'input' for device: /dev/input/event0
Adding user 'default' to group: 'video' for device: /dev/dri/card0
Setting umask to 000
Create the user XDG_RUNTIME_DIR path '/tmp/.X11-unix/run'
Adding default home directory template
Setting ownership of all log files in '/home/default/.cache/log'
Setting root password
Setting user password
DONE

[ /etc/cont-init.d/20-configre_sshd.sh: executing... ]
**** Configure SSH server ****
Disable SSH server
DONE

[ /etc/cont-init.d/30-configure_dbus.sh: executing... ]
**** Configure container dbus ****
Container configured to run its own dbus
DONE

[ /etc/cont-init.d/30-configure_udev.sh: executing... ]
**** Configure container to run udev management ****
**** Ensure the default user has permission to r/w on input devices ****
DONE

[ /etc/cont-init.d/40-setup_locale.sh: executing... ]
**** Locales already set correctly to en_US.UTF-8 UTF-8 ****
DONE

[ /etc/cont-init.d/50-configure_pulseaudio.sh: executing... ]
**** Configure pulseaudio ****
Configure pulseaudio to pipe audio to a socket
DONE

[ /etc/cont-init.d/60-configure_gpu_driver.sh: executing... ]
**** Found NVIDIA device 'NVIDIA GeForce GTX 1070' ****
Installing NVIDIA driver v525.125.06 to match what is running on the host
**** Found Intel device 'Intel(R) Xeon(R) CPU E5520 @ 2.27GHz' ****
Install Intel vulkan driver
**** No AMD device found ****
DONE

[ /etc/cont-init.d/70-configure_xorg.sh: executing... ]
**** Generate NVIDIA xorg.conf ****
Configure Xwrapper.config
Configure container as primary the X server
Enabling evdev input class on pointers, keyboards, touchpads, touch screens, etc.
'/usr/share/X11/xorg.conf.d/10-evdev.conf' -> '/etc/X11/xorg.conf.d/10-evdev.conf'
Configuring X11 with GPU ID: 'GPU-3c32df75-fba7-9725-d7c3-b0c54d063e6a'
Configuring X11 with PCI bus ID: 'PCI:6:0:0'
Writing X11 config with Modeline "1600x900R"  201.00  1600 1648 1680 1760  900 903 908 953 +hsync -vsync

WARNING: Unable to locate/open X configuration file.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
Option "ProbeAllGpus" "False" added to Screen "Screen0".
Option "BaseMosaic" "False" added to Screen "Screen0".
Option "AllowEmptyInitialConfiguration" "True" added to Screen "Screen0".
New X configuration file written to '/etc/X11/xorg.conf'

DONE

[ /etc/cont-init.d/80-configure-dind.sh: executing... ]
**** Configure Dockerd ****
Enable Dockerd daemon
Add user 'default' to docker group for sudoless execution
DONE

[ /etc/cont-init.d/90-configure_neko.sh: executing... ]
**** Configure Neko ****
Disable Neko server
DONE

[ /etc/cont-init.d/90-configure_sunshine.sh: executing... ]
**** Configure Sunshine ****
Disable Sunshine server
DONE

[ /etc/cont-init.d/90-configure_vnc.sh: executing... ]
**** Configure VNC ****
Configure VNC service port '32036'
Configure noVNC service port '32037'
Configure audio websocket port '32038'
Configure pulseaudio encoded stream port '32039'
Enable VNC server
Patching noVNC with audio websocket
DONE

[ /etc/cont-init.d/95-configure_secondary.sh: executing... ]
DONE

**** Starting supervisord ****
Logging all root services to '/var/log/supervisor/'
Logging all user services to '/home/default/.cache/log/'

2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/dbus.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/desktop.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/dind.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/neko.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/pulseaudio.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/sshd.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/steam.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/sunshine.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/udev.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/vnc-audio.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/vnc.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/xorg.ini" during parsing
2023-07-09 19:41:58,371 INFO Included extra file "/etc/supervisor.d/xvfb.ini" during parsing
2023-07-09 19:41:58,371 INFO Set uid to user 0 succeeded
2023-07-09 19:41:58,375 INFO RPC interface 'supervisor' initialized
2023-07-09 19:41:58,376 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2023-07-09 19:41:58,376 INFO supervisord started with pid 1
2023-07-09 19:41:59,378 INFO spawned: 'dbus' with pid 357
2023-07-09 19:41:59,380 INFO spawned: 'udev' with pid 358
2023-07-09 19:41:59,382 INFO spawned: 'dind' with pid 359
2023-07-09 19:41:59,384 INFO spawned: 'xorg' with pid 360
2023-07-09 19:41:59,386 INFO spawned: 'audiostream' with pid 361
2023-07-09 19:41:59,388 INFO spawned: 'novnc' with pid 362
2023-07-09 19:41:59,390 INFO spawned: 'pulseaudio' with pid 364
2023-07-09 19:41:59,392 INFO spawned: 'vncproxy' with pid 366
2023-07-09 19:41:59,394 INFO spawned: 'x11vnc' with pid 367
2023-07-09 19:41:59,397 INFO spawned: 'audiowebsock' with pid 370
2023-07-09 19:41:59,400 INFO spawned: 'desktop' with pid 377
PULSEAUDIO: Starting pulseaudio service
2023-07-09 19:41:59,401 INFO success: vncproxy entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-07-09 19:41:59,424 INFO reaped unknown pid 419 (exit status 0)
2023-07-09 19:41:59,426 INFO exited: dind (exit status 4; not expected)
2023-07-09 19:42:00,417 INFO success: dbus entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,417 INFO success: udev entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,417 INFO success: xorg entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,417 INFO success: audiostream entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,417 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,417 INFO success: pulseaudio entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,417 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,418 INFO success: audiowebsock entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:00,418 INFO success: desktop entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-07-09 19:42:01,412 INFO spawned: 'dind' with pid 453
2023-07-09 19:42:01,996 INFO reaped unknown pid 531 (exit status 1)
2023-07-09 19:42:02,628 INFO success: dind entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Error when trying to install steam:

Error: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.freedesktop.PackageKit: Permission denied

Expected Behavior

Steam is installed and runnable.

Screenshots

image

Relevant Settings

compose file:

---
services:
  steam-headless:
    image: josh5/steam-headless:latest
    restart: unless-stopped
    runtime: nvidia
    ## NOTE: Requires privileged access to host to be able to access the required devices
    privileged: true
    shm_size: ${SHM_SIZE}
    ipc: host # Could also be set to 'shareable'
    ulimits:
      nofile:
        soft: 1024
        hard: 524288

    # NETWORK:
    ## NOTE:  Steam headless always requires the use of the host network.
    ##        If we do not use the host network, then device input is not possible
    ##        and your controllers will not work in steam games.
    network_mode: host
    hostname: ${NAME}
    extra_hosts:
      - "${NAME}:127.0.0.1"

    # ENVIRONMENT:
    ## Read all config variables from the .env file
    env_file: .env

    # VOLUMES:
    volumes:
      # The location of your home directory.
      - /opt/container-data/steam-headless/home/:/home/default/:rw
      # The location where all games should be installed.
      # This path needs to be set as a library path in Steam after logging in.
      # Otherwise, Steam will store games in the home directory above.
      - /mnt/games/:/mnt/games/:rw
      # Input devices used for mouse and joypad support inside the container.
      - /dev/input/:/dev/input/:ro
      # The Xorg socket. This will be shared with other containers so they can access the X server.
      - /opt/container-data/steam-headless/.X11-unix/:/tmp/.X11-unix/:rw
      # Pulse audio socket. This will be shared with other containers so they can access the audio sink.
      - /opt/container-data/steam-headless/pulse/:/tmp/pulse/:rw
      # Store dind var files in a volume
      - steam-headless-var-lib-docker:/var/lib/docker/:rw
      # Store flatpak var files in a volume
      - steam-headless-var-lib-flatpak:/var/lib/flatpak/:rw

volumes:
  steam-headless-var-lib-docker:
  steam-headless-var-lib-flatpak:

env file:

#  ____            _
# / ___| _   _ ___| |_ ___ _ __ ___
# \___ \| | | / __| __/ _ \ '_ ` _ \
#  ___) | |_| \__ \ ||  __/ | | | | |
# |____/ \__, |___/\__\___|_| |_| |_|
#        |___/
#
NAME='SteamHeadless'
TZ='UTC'
USER_LOCALES='en_US.UTF-8 UTF-8'
DISPLAY=':55'
SHM_SIZE='8G'

## DOCKER_RUNTIME:
##      Options:        ['runc', 'nvidia']
##      Description:    The name of an implementation of OCI Runtime Spec
##                      Available runtimes are listed when you run `docker info`.
##                      Your system may have other options available. As a simple rule, if you are
##                      using an NVIDIA GPU, set this to 'nvidia' for anything else, set this to 'runc'.
DOCKER_RUNTIME='nvidia'

#  ____        __             _ _     _   _
# |  _ \  ___ / _| __ _ _   _| | |_  | | | |___  ___ _ __
# | | | |/ _ \ |_ / _` | | | | | __| | | | / __|/ _ \ '__|
# | |_| |  __/  _| (_| | |_| | | |_  | |_| \__ \  __/ |
# |____/ \___|_|  \__,_|\__,_|_|\__|  \___/|___/\___|_|
#
#
PUID='1000'
PGID='1000'
UMASK='000'
USER_PASSWORD='password'

#  ____                  _
# / ___|  ___ _ ____   _(_) ___ ___  ___
# \___ \ / _ \ '__\ \ / / |/ __/ _ \/ __|
#  ___) |  __/ |   \ V /| | (_|  __/\__ \
# |____/ \___|_|    \_/ |_|\___\___||___/
#
#
# Mode
## MODE:
##      Options:        ['primary', 'secondary']
##      Description:    Steam Headless containers can run in a secondary mode that will only start
##                      a Steam process that will then use the X server of either the host or another
##                      Steam Headless container running in 'primary' mode.
MODE='primary'

# Web UI
## WEB_UI_MODE:
##      Options:        ['vnc', 'neko', 'none']
##      Description:    Configures the WebUI to use for accessing the virtual desktop.
WEB_UI_MODE='vnc'
## ENABLE_VNC_AUDIO:
##      Options:        ['true', 'false']
##      Description:    Enables audio over for the VNC Web UI if 'WEB_UI_MODE' is set to 'vnc'.
ENABLE_VNC_AUDIO='true'
## PORT_NOVNC_WEB:
##      Description:    Configure the port to use for the WebUI.
PORT_NOVNC_WEB='8083'
## NEKO_NAT1TO1:
##      Description:    Configure nat1to1 for the neko WebUI if it is enabled by setting 'WEB_UI_MODE' to 'neko'. This will need to be the IP address of the host.
NEKO_NAT1TO1=''

# Sunshine
## ENABLE_SUNSHINE:
##      Options:        ['true', 'false']
##      Description:    Enable Sunshine streaming service.
ENABLE_SUNSHINE='false'
## SUNSHINE_USER:
##      Description:    Set the Sunshine service username.
#SUNSHINE_USER='admin'
## SUNSHINE_PASS:
##      Description:    Set the Sunshine service password.
#SUNSHINE_PASS='admin'

# Xorg
## ENABLE_EVDEV_INPUTS:
##      Options:        ['true', 'false']
##      Description:    Enable Keyboard and Mouse Passthrough. This will configure the Xorg server to catch all evdev events for Keyboard, Mouse, etc.
ENABLE_EVDEV_INPUTS='true'

# Nvidia specific config (not required for non Nvidia GPUs)
## NVIDIA_DRIVER_CAPABILITIES:
##      Options:        ['all', 'compute', 'compat32', 'graphics', 'utility', 'video', 'display']
##      Description:    Controls which driver libraries/binaries will be mounted inside the container.
NVIDIA_DRIVER_CAPABILITIES='all'
## NVIDIA_DRIVER_CAPABILITIES:
##      Options:        ['all', 'none', '<GPU UUID>']
##      Description:    Controls which GPUs will be made accessible inside the container.
NVIDIA_VISIBLE_DEVICES='all'

Version

Build: [2023-07-09 01:27:11] [master] [0b600108f7447fdbd1017b76887d5da2cb26aff8]

Platform

Relevant log output

Error: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.freedesktop.PackageKit: Permission denied
tnielsen2 commented 12 months ago

After doing some digging, I see the shell scripts in /opt/scripts, but when i execute any of them, I receive the following error: USER_HOME: parameter null or not set. I have renamed this issue to be relevant to my latest findings.

Josh5 commented 12 months ago

Can you: 1) Stop the container. 2) Remove the home directory. 3) Pull the latest josh5/steam-headless:latest docker image. 4) Restart the compose stack.

Let me know if that fixed it for you.

tnielsen2 commented 12 months ago

This has fixed the problem, and Proton is also working now, which I had issues with manually installing with Flatpak when the container didn't install.

I am having another issue where I am unable to use the /mnt/games folder for some reason, although permissions seem to be correct. I will troubleshoot and open another issue if I cannot figure it out.

stuCONNERS1983 commented 12 months ago

Ive got this problem now. Ive tried tried the recommended actions and i still have the same problem.

tnielsen2 commented 12 months ago

Ive got this problem now. Ive tried tried the recommended actions and i still have the same problem.

I have created another issue to address this.

stuCONNERS1983 commented 12 months ago

Mine now works. Dont know why. Had another go, and bang it works.