Steam-Headless / docker-steam-headless

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

[Bug]: Sunshine ports are not exposed #157

Open ohare93 opened 2 months ago

ohare93 commented 2 months ago

Describe the Bug

The docker container installs Sunshine, but does not expose the ports in the dockerfile. Nor are the ports connected opened in the Unraid template.

How is one supposed to connect to Sunshine via Moonlight when the ports are not opened?

Steps to Reproduce

  1. Try connect to Sunshine in Docker container
  2. Cannot

Expected Behavior

Can connect

Screenshots

Sunshine docker image: https://hub.docker.com/r/lizardbyte/sunshine image

Relevant Settings

Dockerfile only has EXPOSE 8305 https://github.com/Steam-Headless/docker-steam-headless/blob/master/Dockerfile.debian#L556 More should be exposed for Sunshine specifically

Version

latest

Platform

Unraid. The rest is irrelevant for this issue.

Relevant log output

None.
alansari commented 2 months ago

Sunshine is the main reason the container needs to be run using host networking. The template on unRAID should reflect that. When using the host network you do not need to expose ports in order to make them available.

ohare93 commented 2 months ago

You don't need to expose ports to make them available through Docker while on host mode? Well that is news to me.

Still I could not connect. Nothing would work. But your reply here gave me the idea to just go add the ports into the Unraid template:

image

And it worked! I can now connect

image

No keyboard or mouse controls, that is surely a small issue. I can actually find the machine now.


So am I understanding right that it is the intention that none of the ports are explicitly opened in either the Dockerfile or Unraid template, and that this setup apparently works for other people? 🤔

alansari commented 2 months ago

"No keyboard or mouse controls, that is surely a small issue. I can actually find the machine now." <-- not a small issue and the root reason for the host networking requirement. The fact that you had to add the ports to the template leads me to believe you are not using host networking. Maybe attempting to run behind a proxy/reverse proxy, or using a custom ip on a bridged network?

Correct in that people are using host networking, not setting any ports in the template, have sunshine connecting, and inputs work correctly. Using ipvlan or macvlan, as i'm guessing you might be, would require the ports being opened for moonlight/sunshine just to connect. But due to the way sunshine handles inputs you still need to use host networking for inputs to function, current options are bind monuting the host udev data and input dev, or use dumb-udev (which is the default and recommended method) that is built into the container. If you need any additional help jump on discord for faster response times. You can refrence docker host networking here: https://docs.docker.com/network/drivers/host/

ohare93 commented 2 months ago

"No keyboard or mouse controls, that is surely a small issue. I can actually find the machine now." <-- not a small issue and the root reason for the host networking requirement.

Interesting.

The fact that you had to add the ports to the template leads me to believe you are not using host networking.

image

Never have been, yet I also cannot get access

Maybe attempting to run behind a proxy/reverse proxy, or using a custom ip on a bridged network?

Nope, none of that. I do have a reverse proxy setup on my server (Traefik) with some self hosted services, but I haven't gotten around to this container yet. Though that would be an end goal, to be able to connect to Steam/Sunshine while away from home and without just connecting to my home vpn. Due to other constraints I can no longer use the Steam streaming method.

"Bridged network" though, I am not 100% on the definitions here. Here is my home internet setup:

  1. The Router is plugged into the wall with its wifi disabled
  2. Network Switch is plugged into the router
  3. A UniFi Cloud Key is plugged into the switch a) which spreads its own wifi to 2 extention boxes across the house, that are also plugged into the switch
  4. Unraid server is plugged directly into the router.

I wonder if I must have it plugged into the switch 🤔 Probably!