Steam-Headless / docker-steam-headless

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

[Bug]: #90

Closed goffy59 closed 1 year ago

goffy59 commented 1 year ago

Describe the Bug

I'm currently facing multiple issues and problems with my setup. I've tried various solutions, including reinstalls and different distributions, but I'm still encountering issues.

I've now settled on using Fedora CoreOS for my host, as it works well with my GPU and provides a minimal environment without a desktop environment (DE). I'm using this container headlessly via SSH, and my ultimate goal is to use Moonlight on my Firestick.

I previously managed to get the NoVNC desktop environment to work both on the NoVNC web UI and my Firestick using a combination of CHATGPT and my own Docker knowledge. However, even though it seemed to work better, it didn't actually work correctly in the end. Steam wouldn't start or function properly, and Big Screen mode wouldn't initiate despite launching and then crashing.

Now, I've switched to Fedora CoreOS, and I'm facing similar issues. I can't even get the web UI to work or have the Moonlight app detect this container.

Request: Please provide your .env and compose file examples so I can compare them with mine and identify what might be causing the issues. Feel free to redact any sensitive information.

Thanks in advance!


# Set the parent network device.
NETWORK_PARTENT=enp4s0
# Name this whatever you like, but ensure you update the `.env` file below to match.
NETWORK_NAME=steam-headless-vlan
# Choose a network subnet and gateway that matches your host network
NETWORK_SUBNET=192.168.1.0/24
NETWORK_GATEWAY=192.168.1.1
# Execute the docker network create command
sudo docker network create -d macvlan \
    --subnet=${NETWORK_SUBNET:?} \
    --gateway=${NETWORK_GATEWAY:?} \
    -o parent=${NETWORK_PARTENT:?} \
    ${NETWORK_NAME:?}

```yaml
# Configuration for steam-headless-container

# General settings
NAME='steam-headless-container'
TZ='America/Phoenix'
USER_LOCALES='en_US.UTF-8 UTF-8'
DISPLAY=':55'
SHM_SIZE='2G'
CONTAINER_IP_ADDRESS='192.168.1.249'
NETWORK_NAME='steam-headless-vlan'
DOCKER_RUNTIME='runc'

# User settings
PUID='1001'
PGID='1001'
UMASK='000'
USER_PASSWORD='password(redacted) not sure if changing this causes problems'

# Steam Headless mode
MODE='primary'

# Web UI settings
WEB_UI_MODE='vnc'
ENABLE_VNC_AUDIO='true'
PORT_NOVNC_WEB='8083'
NEKO_NAT1TO1='192.168.1.64'

# Steam settings
ENABLE_STEAM='true'
# STEAM_ARGS='-silent -bigpicture'

# Sunshine streaming service
ENABLE_SUNSHINE='true'
# SUNSHINE_USER='admin'
# SUNSHINE_PASS='admin'

# Xorg settings
ENABLE_EVDEV_INPUTS='true'

# Nvidia specific config (not required for non-Nvidia GPUs)
# NVIDIA_DRIVER_CAPABILITIES='all'
# NVIDIA_VISIBLE_DEVICES='all'

```yaml
services:
  steam-headless:
    image: josh5/steam-headless:latest
    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

    # 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.
      - /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.
      - /media/games/:/media/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.
      #- /opt/container-data/steam-headless/.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.
      #- /opt/container-data/steam-headless/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.
      - steam-headless-var-lib-flatpak:/var/lib/flatpak/:rw

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

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

### Version

Build: [2023-09-18 04:13:03] [master] [7552680a0179e6373c61034f46e645f0928032ae] [debian]

### Platform

Fedora CoreOS

docker version:
Client:
 Version:           20.10.23
 API version:       1.41
 Go version:        go1.20rc3
 Git commit:        %{shortcommit_cli}
 Built:             Sun Jan 29 17:25:05 2023
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.23
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.20rc3
  Git commit:       %{shortcommit_moby}
  Built:            Sun Jan 29 17:25:05 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.19
  GitCommit:        
 runc:
  Version:          1.1.7
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        

[goffy59@steamy steam-headless]$ uname -r
6.4.7-200.fc38.x86_64

[goffy59@steamy steam-headless]$ docker-compose --version
docker-compose version 1.29.2, build unknown

⬢[goffy59@toolbox ~]$ lspci -v | grep -i VGA
lspci: Unable to load libkmod resources: error -2
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev e7) (prog-if 00 [VGA controller])

### Relevant log output

```Shell
[goffy59@steamy steam-headless]$ docker logs steam-headless_steam-headless_1 
Build: [2023-09-18 04:13:03] [master] [7552680a0179e6373c61034f46e645f0928032ae] [debian]
[ /etc/cont-init.d/10-setup_user.sh: executing... ]
**** Configure default user ****
Setting default user uid=1001(default) gid=1001(default)
Adding default user to any additional required device groups
Adding user 'default' to group: 'video'
Adding user 'default' to group: 'audio'
Adding user 'default' to group: 'input'
Adding user 'default' to group: 'pulse'
Adding user 'default' to group: 'sgx' for device: /dev/input/event0
Adding user 'default' to group: 'irc' for device: /dev/dri/card1
Adding user 'default' to group: 'kvm' for device: /dev/dri/renderD128
Setting umask to 000
Create the user XDG_RUNTIME_DIR path '/tmp/.X11-unix/run'
Setting ownership of all log files in '/home/default/.cache/log'
Setting root password
Setting user password
DONE
[ /etc/cont-init.d/11-setup_sysctl_values.sh: executing... ]
**** Configure some system kernel parameters ****
NOTE: vm.max_map_count is already greater than '524288'
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... ]
**** Disable udev service due to privilege restrictions ****
**** 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 ****
Enable pulseaudio service.
Configure pulseaudio to pipe audio to a socket
DONE
[ /etc/cont-init.d/60-configure_gpu_driver.sh: executing... ]
/etc/cont-init.d/60-configure_gpu_driver.sh: line 15: gpu_select: parameter null or not set
/etc/cont-init.d/60-configure_gpu_driver.sh: line 16: gpu_select: parameter null or not set
**** Found Intel device 'Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz' ****
Install Intel vulkan driver
**** Found AMD device '01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev e7)' ****
Install AMD vulkan driver
**** No NVIDIA device found ****
DONE
[ /etc/cont-init.d/70-configure_desktop.sh: executing... ]
**** Configure Desktop ****
Enable Desktop service.
Ensure home directory template is owned by the default user.
DONE
[ /etc/cont-init.d/70-configure_xorg.sh: executing... ]
**** Generate default 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'
DONE
[ /etc/cont-init.d/80-configure_flatpak.sh: executing... ]
**** Configure Flatpak ****
Flatpak configured for running inside a Docker container
DONE
[ /etc/cont-init.d/90-configure_neko.sh: executing... ]
**** Configure Neko ****
Disable Neko server
DONE
[ /etc/cont-init.d/90-configure_steam.sh: executing... ]
**** Configure Steam ****
Enable Steam auto-start script
DONE
[ /etc/cont-init.d/90-configure_sunshine.sh: executing... ]
**** Configure Sunshine ****
Enable Sunshine server
DONE
[ /etc/cont-init.d/90-configure_vnc.sh: executing... ]
**** Configure VNC ****
Configure VNC service port '32036'
Configure pulseaudio encoded stream port '32037'
Enable VNC server
DONE
[ /etc/cont-init.d/95-setup_wol.sh: executing... ]
**** Configure WoL Manager ****
Disable WoL Manager service.
**** Starting supervisord ****
Logging all root services to '/var/log/supervisor/'
Logging all user services to '/home/default/.cache/log/'
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/dbus.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/desktop.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/neko.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/pulseaudio.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/steam.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/sunshine.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/udev.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/vnc-audio.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/vnc.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/wol-power-manager.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/xorg.ini" during parsing
2023-09-18 22:38:30,394 INFO Included extra file "/etc/supervisor.d/xvfb.ini" during parsing
2023-09-18 22:38:30,394 INFO Set uid to user 0 succeeded
2023-09-18 22:38:30,397 INFO RPC interface 'supervisor' initialized
2023-09-18 22:38:30,397 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2023-09-18 22:38:30,397 INFO supervisord started with pid 1
2023-09-18 22:38:31,399 INFO spawned: 'dbus' with pid 284
2023-09-18 22:38:31,400 INFO spawned: 'xorg' with pid 285
2023-09-18 22:38:31,402 INFO spawned: 'audiostream' with pid 286
2023-09-18 22:38:31,403 INFO spawned: 'frontend' with pid 287
2023-09-18 22:38:31,404 INFO spawned: 'pulseaudio' with pid 288
2023-09-18 22:38:31,405 INFO spawned: 'x11vnc' with pid 291
2023-09-18 22:38:31,407 INFO spawned: 'desktop' with pid 293
2023-09-18 22:38:31,408 INFO spawned: 'sunshine' with pid 295
PULSEAUDIO: Starting pulseaudio service
2023-09-18 22:38:31,643 INFO reaped unknown pid 335 (exit status 0)
2023-09-18 22:38:31,790 WARN exited: desktop (exit status 23; not expected)
2023-09-18 22:38:32,434 INFO success: dbus entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:32,434 INFO success: xorg entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:32,434 INFO success: audiostream entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:32,434 INFO success: frontend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:32,434 INFO success: pulseaudio entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:32,434 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:32,434 INFO success: sunshine entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-09-18 22:38:33,439 INFO spawned: 'desktop' with pid 354
2023-09-18 22:38:33,452 INFO reaped unknown pid 361 (exit status 0)
2023-09-18 22:38:33,578 WARN exited: desktop (exit status 23; not expected)
2023-09-18 22:38:35,581 INFO spawned: 'desktop' with pid 370
2023-09-18 22:38:35,596 INFO reaped unknown pid 376 (exit status 0)
2023-09-18 22:38:35,743 WARN exited: desktop (exit status 23; not expected)
2023-09-18 22:38:39,450 INFO spawned: 'desktop' with pid 394
2023-09-18 22:38:39,465 INFO reaped unknown pid 400 (exit status 0)
2023-09-18 22:38:39,591 WARN exited: desktop (exit status 23; not expected)
Josh5 commented 1 year ago

Please format you yaml woth backticks so it is readable. Thanks

goffy59 commented 1 year ago

Sorry about that.. is this better? My main request for this is to see an example .env and compose file that is currently working? In my situation. I am using a headless server with fedora core OS so no DE whatsoever other than a terminal but i use ssh so there is no monitor hooked up to it.

Josh5 commented 1 year ago

@goffy59 Try updating the docker-compose.yml template and .env files from the compose setup docs: https://github.com/Steam-Headless/docker-steam-headless/blob/master/docs/docker-compose.md

Josh5 commented 1 year ago

Also, GitHub issues are not for support. These are for bugs only. This is not a bug. Feel free to join us on Discord where there are plenty of people willing and able to provide with support for setting up your headless game server.

Thank-you

goffy59 commented 1 year ago

So I've done exactly what you suggested multiple times and I get errors. How is this not a bug? I provided the docker logs showing what looks to be bugs.

Josh5 commented 1 year ago

So I've done exactly what you suggested multiple times and I get errors. How is this not a bug? I provided the docker logs showing what looks to be bugs.

What is the bug? What are you asking me to fix here?

When I looked over your config and logs provided, this seemed more likely to be an issue that can be solved with your configuration. Until I see evidence of your troubleshooting and asking for support in the proper channels, i would not consider this a bug.

Have you looked at the logs for the desktop? If you need help investigating the desktop logs, ask in Discord.