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

Stem not starting even though ps aux shows processes #92

Closed UmutAlihan closed 9 months ago

UmutAlihan commented 9 months ago

Describe the Bug

I start the steam using "supervisorctl start steam".

But it otuputs no logs, I see only err.log as below:

image

Steam is not starting but when I check "ps aux | grep steam" I see steam related processes:

image

If I execute "sudo /usr/games/steam" it starts but even though steam is installed, it attempts to install new steam into "root" home:

image

I installed steam as it asked me to do it:

image

After installation and update; Steam WebUI starts but after starting a game, the game crashes after a couple of seconds or interactions. I will not give the details of the crash issue here because I assume that is for another issue. Currently I am wondering why supervisor steam service is not able run steam as it is.

Any help is much appreciated. Many thanks for such great repository btw. It is a wonderful contributioun to the community. Cheers,

Steps to Reproduce

No response

Expected Behavior

I was expecting that steam launches and start gaming flawlessly without any crash :'/

Screenshots

No response

Relevant Settings

docker-copose.yaml:

services:
  steam-headless:
    image: josh5/steam-headless:latest
    container_name: steam-headless-alihan
    restart: unless-stopped
    runtime: ${DOCKER_RUNTIME}
    shm_size: ${SHM_SIZE}
    ipc: host # Could also be set to 'shareable'
    ulimits:
      nofile:
        soft: 1024
        hard: 524288
    cap_add:
      - NET_ADMIN
      - SYS_ADMIN
      - SYS_NICE
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined
    ports:
      - 8083:8083
      - 27036:27036
      - 27037:27037
    # NETWORK:
    hostname: ${NAME}
    extra_hosts:
      - "${NAME}:127.0.0.1"
    networks:
      external-macvlan:
        ipv4_address: ${CONTAINER_IP_ADDRESS}

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

    # DEVICES:
    devices:
      # Use the host fuse device.
      - /dev/fuse
      # Add the host uinput device.
      - /dev/uinput
      # Add AMD/Intel HW accelerated video encoding/decoding devices (optional)
      #- /dev/dri
    # Ensure container access to devices 13:*
    device_cgroup_rules:
      - 'c 13:* rmw'

    # VOLUMES:
    volumes:
      # The location of your home directory.
      - /home/host_user/cloudgame/steam-alihan/data/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.
      - /home/host_user/cloudgame/steam-alihan/data/games/:/mnt/games/:rw

      # The Xorg socket. This will be shared with other containers so they can access the X server.
      # Select only one option or leave commented out to not share the Xorg socket with any other Docker containers.
      #   Option #1) Start a X server in the container to share with any other containers.
      - /home/host_user/cloudgame/steam-alihan/data/X11-unix/:/tmp/.X11-unix/:rw
      #   Option #2) Use an existing X server running on the host.
      #- /tmp/.X11-unix/:/tmp/.X11-unix/:rw

      # Pulse audio socket. This will be shared with other containers so they can access the audio sink.
      # Leave commented out to not share the pulse socket with any other Docker containers.
      - /home/host_user/cloudgame/steam-alihan/data/pulse/:/tmp/pulse/:rw

      # Input devices used for mouse and joypad support inside the container.
      - /dev/input/:/dev/input/:ro
      # Host udev data required for input devices
      - /run/udev/data/:/run/udev/data/:ro

      # Store flatpak var files in a volume.
      - /home/host_user/cloudgame/steam-alihan/data/flatpak:/var/lib/flatpak/:rw

      - /dev/dri/card0:/dev/dri/card0
      - /dev/dri/card1:/dev/dri/card1

networks:
  external-macvlan:
    external: true
    name: ${NETWORK_NAME}

.env:

#  ____            _
# / ___| _   _ ___| |_ ___ _ __ ___
# \___ \| | | / __| __/ _ \ '_ ` _ \
#  ___) | |_| \__ \ ||  __/ | | | | |
# |____/ \__, |___/\__\___|_| |_| |_|
#        |___/
#
NAME='steam_alihan'
TZ='Europe/Istanbul'
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='pasword'

#  __  __           _
# |  \/  | ___   __| | ___
# | |\/| |/ _ \ / _` |/ _ \
# | |  | | (_) | (_| |  __/
# |_|  |_|\___/ \__,_|\___|
#
#
## 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'

#  ____                  _
# / ___|  ___ _ ____   _(_) ___ ___  ___
# \___ \ / _ \ '__\ \ / / |/ __/ _ \/ __|
#  ___) |  __/ |   \ V /| | (_|  __/\__ \
# |____/ \___|_|    \_/ |_|\___\___||___/
#
#
# Web UI
## WEB_UI_MODE:
##      Options:            ['vnc', 'neko', 'none']
##      Description:        Configures the WebUI to use for accessing the virtual desktop.
##      Supported Modes:    ['primary']
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=''

# Steam
## ENABLE_STEAM:
##      Options:            ['true', 'false']
##      Description:        Enable Steam to run on start. This will also cause steam to restart automatically if closed.
##      Supported Modes:    ['primary', 'secondary']
ENABLE_STEAM='true'
## STEAM_ARGS:
##      Description:        Additional steam execution arguments.
STEAM_ARGS='-debug -bigpicture'

# Sunshine
## ENABLE_SUNSHINE:
##      Options:            ['true', 'false']
##      Description:        Enable Sunshine streaming service.
##      Supported Modes:    ['primary']
ENABLE_SUNSHINE='false'
## SUNSHINE_USER:
##      Description:        Set the Sunshine service username.
#SUNSHINE_USER='user'
## SUNSHINE_PASS:
##      Description:        Set the Sunshine service password.
#SUNSHINE_PASS='pass'

# Xorg
## ENABLE_EVDEV_INPUTS:
##      Available Options:  ['true', 'false']
##      Description:        Enable Keyboard and Mouse Passthrough. This will configure the Xorg server to catch all
##                          evdev events for Keyboard, Mouse, etc.
##      Supported Modes:    ['primary']
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.
##      Supported Modes:        ['primary', 'secondary']
NVIDIA_DRIVER_CAPABILITIES='all'

## NVIDIA_DRIVER_CAPABILITIES:
##      Available Options:      ['all', 'none', '<GPU UUID>']
##      Description:            Controls which GPUs will be made accessible inside the container.
##      Supported Modes:        ['primary', 'secondary']
NVIDIA_VISIBLE_DEVICES='GPU-123456-1234-12345-1234-12341234' # GUID of my 3060  rtx
#NVIDIA_VISIBLE_DEVICES="all"

NETWORK_NAME=cloudgame-steam-alihan-vlan
CONTAINER_IP_ADDRESS=192.168.1.xyz
DISPLAY_VIDEO_PORT='HDMI'

Version

Pulled latest docker image as of 25.09.2023

Platform

Relevant log output

root@steam_alihan:/home/default/.cache/log# tail -n 10 steam.err.log

steam.sh[2967]: Steam client's requirements are satisfied
steam.sh[3107]: Running Steam on debian 12 64-bit
steam.sh[3107]: STEAM_RUNTIME is enabled automatically
setup.sh[3176]: Steam runtime environment up-to-date!
steam.sh[3107]: Steam client's requirements are satisfied
steam.sh[3250]: Running Steam on debian 12 64-bit
steam.sh[3250]: STEAM_RUNTIME is enabled automatically
setup.sh[3319]: Steam runtime environment up-to-date!
steam.sh[3250]: Steam client's requirements are satisfied
Josh5 commented 9 months ago

Don't use supervisorctl to start steam unless you are running outside of the Steam Headless desktop.

Don't run Steam as root with sudo. It will just create a steam config in /root which will be blown away the next time you update the container.

Update your docker-copose.yaml with the latest template found in this project's documentation. It is no longer recommended to use a macvlan network.

Join us on Discord for support. This is not a bug.