LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
15.62k stars 748 forks source link

Cannot access the WebUI or use Moonlight to connect in the Windows 24H2 version #2793

Open WhiteByeBye opened 1 week ago

WhiteByeBye commented 1 week ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

I updated the Windows build to 24H2 yesterday, and I find that my PC with Sunshine server installed became offline when I try to connect it through Moonlight client on my Android phone. So I back to PC side to check the status of Sunshine server (ver. 0.23.1), however, I can't access the Web UI, specificly, the address https://localhost:47990/ are loading and show a blank page forever, i.e. the screenshot shown below. image

Even after rebooting, re-installing ver 0.23.1, or installing the pre-release version ([v2024.629.13903] https://github.com/LizardByte/Sunshine/releases/tag/v2024.629.13903)), the problem presents.

Expected Behavior

No response

Additional Context

No response

Host Operating System

Windows

Operating System Version

Windows 11 Pro for Workstation, 24H2, Build 26100.1000

Architecture

64 bit

Sunshine commit or version

0.23.1

Package

Windows - installer

GPU Type

Nvidia

GPU Model

RTX 4090

GPU Driver/Mesa Version

556.12

Capture Method

None

Config

fps = [10,30,60,90,120,144,180]
nvenc_preset = 7
nvenc_twopass = full_res
resolutions = [
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    3440x1440,
    1920x1200,
    3840x2160,
    3840x1600,
    2560x1440,
    3200x1440
]
upnp = enabled
origin_web_ui_allowed = wan
qsv_preset = slowest
sw_preset = veryslow
address_family = both
hevc_mode = 3
av1_mode = 3
qsv_coder = cabac
qp = 0
locale = zh

Apps

{
  "env": {
    "PATH": "$(PATH);$(ProgramFiles(x86))\\Steam"
  },
  "apps": [
    {
      "name": "Desktop",
      "image-path": "desktop.png"
    },
    {
      "name": "Steam Big Picture",
      "detached": [
        "steam steam://open/bigpicture"
      ],
      "image-path": "steam.png"
    }
  ]
}

Relevant log output

[2024:07:02:12:02:00]: Info: Sunshine version: v2024.629.13903
[2024:07:02:12:02:01]: Info: nvprefs: No need to modify application profile settings
[2024:07:02:12:02:01]: Info: nvprefs: Changed OGL_CPL_PREFER_DXPRESENT to OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED for base profile
[2024:07:02:12:02:01]: Info: Compiling shaders...
[2024:07:02:12:02:01]: Info: System tray created
[2024:07:02:12:02:01]: Info: Compiled shaders
[2024:07:02:12:02:01]: Warning: Gamepad x360 is disabled due to gamepads.vigem-not-available
[2024:07:02:12:02:01]: Warning: Gamepad ds4 is disabled due to gamepads.vigem-not-available
[2024:07:02:12:02:01]: Warning: No gamepad input is available
[2024:07:02:12:02:01]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:07:02:12:02:01]: Info: Trying encoder [nvenc]
[2024:07:02:12:02:01]: Info: ddprobe.exe [1] [] returned: 0x00000000
[2024:07:02:12:02:01]: Info: Set GPU preference: 1
[2024:07:02:12:02:01]: Info: 
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002684
Device Video Mem   : 22612 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 32674 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2024:07:02:12:02:01]: Info: Active GPU has HAGS enabled
[2024:07:02:12:02:01]: Info: Using realtime GPU priority
[2024:07:02:12:02:01]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
Bits Per Color     : 10
Red Primary        : [0.685547,0.308594]
Green Primary      : [0.264648,0.667969]
Blue Primary       : [0.150391,0.0576172]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.3915 nits
Max Luminance      : 408.76 nits
Max Full Luminance : 408.76 nits
[2024:07:02:12:02:01]: Info: Desktop resolution [2560x1440]
[2024:07:02:12:02:01]: Info: Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]
[2024:07:02:12:02:01]: Info: Display refresh rate [179.96Hz]
[2024:07:02:12:02:01]: Info: Requested frame rate [60fps]
[2024:07:02:12:02:01]: Info: SDR color coding [Rec. 601]
[2024:07:02:12:02:01]: Info: Color depth: 8-bit
[2024:07:02:12:02:01]: Info: Color range: [JPEG]
[2024:07:02:12:02:01]: Info: NvEnc: created encoder P7 two-pass rfi
[2024:07:02:12:02:01]: Info: SDR color coding [Rec. 601]
[2024:07:02:12:02:01]: Info: Color depth: 8-bit
[2024:07:02:12:02:01]: Info: Color range: [JPEG]
[2024:07:02:12:02:01]: Info: NvEnc: created encoder P7 two-pass rfi
[2024:07:02:12:02:01]: Info: SDR color coding [Rec. 601]
[2024:07:02:12:02:01]: Info: Color depth: 8-bit
[2024:07:02:12:02:01]: Info: Color range: [JPEG]
[2024:07:02:12:02:01]: Info: NvEnc: created encoder P7 two-pass rfi
[2024:07:02:12:02:02]: Info: 
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002684
Device Video Mem   : 22612 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 32674 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2024:07:02:12:02:02]: Info: Active GPU has HAGS enabled
[2024:07:02:12:02:02]: Info: Using realtime GPU priority
[2024:07:02:12:02:02]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
Bits Per Color     : 10
Red Primary        : [0.685547,0.308594]
Green Primary      : [0.264648,0.667969]
Blue Primary       : [0.150391,0.0576172]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.3915 nits
Max Luminance      : 408.76 nits
Max Full Luminance : 408.76 nits
[2024:07:02:12:02:02]: Info: Desktop resolution [2560x1440]
[2024:07:02:12:02:02]: Info: Desktop format [DXGI_FORMAT_R16G16B16A16_FLOAT]
[2024:07:02:12:02:02]: Info: Display refresh rate [179.96Hz]
[2024:07:02:12:02:02]: Info: Requested frame rate [60fps]
[2024:07:02:12:02:02]: Info: HDR color coding [Rec. 2020 + SMPTE 2084 PQ]
[2024:07:02:12:02:02]: Info: Color depth: 10-bit
[2024:07:02:12:02:02]: Info: Color range: [JPEG]
[2024:07:02:12:02:02]: Info: NvEnc: created encoder P7 10-bit two-pass rfi
[2024:07:02:12:02:02]: Info: HDR color coding [Rec. 2020 + SMPTE 2084 PQ]
[2024:07:02:12:02:02]: Info: Color depth: 10-bit
[2024:07:02:12:02:02]: Info: Color range: [JPEG]
[2024:07:02:12:02:02]: Info: NvEnc: created encoder P7 10-bit two-pass rfi
[2024:07:02:12:02:02]: Info: 
[2024:07:02:12:02:02]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:07:02:12:02:02]: Info: 
[2024:07:02:12:02:02]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2024:07:02:12:02:02]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2024:07:02:12:02:02]: Info: Found AV1 encoder: av1_nvenc [nvenc]
[2024:07:02:12:02:02]: Info: Configuration UI available at [https://localhost:47990]
[2024:07:02:12:02:03]: Info: Registered Sunshine mDNS service
[2024:07:02:12:02:04]: Info: Completed UPnP port mappings to 192.168.0.155 via http://192.168.0.1:5000/rootDesc.xml
[2024:07:02:12:02:15]: Info: Opening UI from system tray
[2024:07:02:12:02:15]: Info: Resolved user-provided command 'https://localhost:47990' to '"C:\Program Files\Google\Chrome Beta\Application\chrome.exe" --single-argument https://localhost:47990'
[2024:07:02:12:02:15]: Info: https://localhost:47990 running with PID 27700
[2024:07:02:12:02:15]: Info: Opened url [https://localhost:47990]
[2024:07:02:12:02:15]: Info: Web UI: [::1] -- not authorized
WesleyVanNeck commented 1 week ago

Works fine for me on windows 11 ltsc

WhiteByeBye commented 1 week ago

Works fine for me on windows 11 ltsc

Now, I foud that I can succesfully connect to PC, but the Web UI is still not accessable. Also, I found a detail in the log:

[2024:07:02:12:02:15]: Info: Opened url [https://localhost:47990] [2024:07:02:12:02:15]: Info: Web UI: [::1] -- not authorized

It seems the Web UI is using ipv6? But when I use https://[::1]:47990/config#, it shows unsafe reminder, when I click access anyway, the webpage remain unchange. And I try access Web UI by modify hosts file that state 127.0.0.1 localhost, it is not working. Also, I try to accesee Web UI by upnp, that is, `https://192.168.0.155:47990, not working again.

ReenigneArcher commented 1 week ago

the webpage remain unchange

Please clarify your statement. Does this mean it's working as expected, or it is still in a broken state?

The unsafe reminder is unavoidable, since we use a self signed certificate.

WhiteByeBye commented 1 week ago

Please clarify your statement. Does this mean it's working as expected, or it is still in a broken state?

Thanks for asking. To be clear, now I can stream the PC screen normally on the Android device (no need to enter the PIN in the Sunshine server because the connection has been saved before), and I use the browser on the Android device through UPNP mapping (https://192.168. 0.155:47990, of which 192.168.0.155 is the PC with Sunshine Server installed) can access the Web UI normally.

However, on the PC side, I still can't access the Web UI through any of the addresses below:

  1. https://localhost:47990
  2. https://127.0.0.1:47990
  3. https://[::1]:47990

Regarding the unsafe reminder, I mean that sometimes when accessing the aforementioned address on the PC, the browser displays an insecure connection page. However, as you know, the browser usually provides a "Continue" button, and typically, clicking this button allows the browser to proceed to the desired webpage (in this case, the Web UI). But this time, nothing happens; it just stays on the insecure connection page without any changes.

To summarize, so far, streaming is possible, and the Web UI can be successfully accessed via port mapping through UPNP and the local network address of the PC from other devices on the same local network. The only issue is that the Web UI cannot be accessed on the PC where the Sunshine Server is installed. This is a peculiar problem.

ReenigneArcher commented 1 week ago

I would try removing the certificates and restart sunshine, forcing them to be re-generated.

WhiteByeBye commented 1 week ago

I would try removing the certificates and restart sunshine, forcing them to be re-generated.

I tried but still not working.

Thanks for this! I'm not sure if it's a problem with some configuration of my PC, such as a firewall, or with Windows Build 24H2. But in any case I can stream now. But we can leave this Issue for now and see if the same thing happens when the 24H2 update is pushed out massively.

taitaitai1777 commented 1 week ago

Title: Resolving Inaccessibility of WebUI and Moonlight Connection on Windows 24H2: LizardByte/Sunshine Issue #2793


Summary:

Users are reporting difficulties accessing the WebUI and establishing connections via Moonlight on Windows 24H2. These issues may stem from network configurations or security policies introduced in the latest Windows update. By diagnosing and applying precise modifications, we aim to restore full functionality.


Step-by-Step Guide:

1. Issue Identification:

2. Possible Causes:

3. Proposed Solutions:

Diagnostic Steps:
  1. Check Network Configurations:

    • Verify that the WebUI and Moonlight are configured to connect to the correct IP address and port.
    • Review Sunshine application settings.
  2. Firewall and Antivirus Checks:

    • Ensure that the Windows Firewall or any third-party antivirus software isn't blocking Sunshine.
    • Add exceptions for the necessary Sunshine ports:
      • Port for WebUI.
      • Port for Moonlight.
  3. Service Status Verification:

    • Confirm that the Sunshine service is operational in the new Windows environment.
Diagnostic Steps and Solutions:

4. Code Change Proposal:

Review and update the repository to ensure Sunshine binds to the correct IP and listens on the required ports.

Original Code Example:

Make sure that Sunshine binds to the correct IP and listens on required ports.

// Example of binding code

listener, err := net.Listen("tcp", "localhost:47989")
if err != nil {
    log.Fatal("Failed to bind to localhost:47989", err)
}
Updated Code:

Update the binding to allow access from all required interfaces.

// Modified binding to ensure proper connection
listener, err := net.Listen("tcp", "0.0.0.0:47989")
if err != nil {
    log.Fatal("Failed to bind to 0.0.0.0:47989", err)
}

5. Implementation Steps:

  1. Fork the Repository:

    • Fork the LizardByte/Sunshine repository to your GitHub account.
  2. Clone the Repository:

    git clone https://github.com/yourusername/Sunshine.git
    cd Sunshine
  3. Modify the Code:

    • Open the necessary files using your preferred editor.

      vim path/to/sunshine/server.go
    • Implement the necessary changes to ensure proper binding.

  4. Testing:

    • Build the modified application.
    • Test the application on the Windows 24H2 environment to ensure WebUI and Moonlight connections are functional.
  5. Commit and Push Changes:

    git add path/to/modified/files
    git commit -m "Fix: Ensure proper binding for WebUI and Moonlight on Windows 24H2"
    git push origin main
  6. Create a Pull Request:

    • Navigate to the original repository.
    • Create a pull request from your fork.

By following these diagnostic steps and applying the proposed code changes, we aim to resolve the accessibility issues of the WebUI and Moonlight connections on the Windows 24H2 environment. This approach targets potential network and configuration issues that may arise from the recent Windows update.

ReenigneArcher commented 1 week ago

@taitaitai1777 do not post ai generated answers here