dockur / windows

Windows inside a Docker container.
MIT License
17.95k stars 1.56k forks source link

Connect via Domainname #808

Open AlphaFlo opened 1 week ago

AlphaFlo commented 1 week ago

Operating system

Ubuntu

Description

I have a reverse Proxy and want to it to point to the windows vnc window. Unfortunaly to the Install it works fine. After the Install it cant connect remotly. Locally it all works fine, even tried it with multiple IP's from the local Net and my VPN net, from public server to home pc where the container is running. image

is there a way to make this work or is this not possible

Docker compose

services: windows: image: dockurr/windows container_name: windows volumes:

Docker log

BdsDxe: failed to load Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0): Not Found BdsDxe: loading Boot0001 "UEFI QEMU DVD-ROM QM00013 " from PciRoot(0x0)/Pci(0x5,0x0)/Sata(0x0,0xFFFF,0x0) BdsDxe: starting Boot0001 "UEFI QEMU DVD-ROM QM00013 " from PciRoot(0x0)/Pci(0x5,0x0)/Sata(0x0,0xFFFF,0x0) ❯ Windows started succesfully, visit http://localhost:8006/ to view the screen...

Screenshots (optional)

No response

kroese commented 1 week ago

The NoVNC website connects back to itself via Websocket. So I think the problem is that you reverse proxy the HTTPS traffic, but not the WS (Websocket) traffic.

I dont know which webserver you are using for the reverse proxy, but Im sure there are examples how to configure it for NoVNC in Google.

I think this might be the answer to your question: https://stackoverflow.com/a/27784398/435733

AlphaFlo commented 1 week ago

The NoVNC website connects back to itself via Websocket. So I think the problem is that you reverse proxy the HTTPS traffic, but not the WS (Websocket) traffic.

I dont know which webserver you are using for the reverse proxy, but Im sure there are examples how to configure it for NoVNC in Google.

I think this might be the answer to your question: https://stackoverflow.com/a/27784398/435733

I think I found the error in using HTTPS in my proxy which seems to automatically use wss:// instead of ws:// I got it working now. Is there a way to change your vnc to wss? I will try to find it but I dont really know much about VNC.

But still thanks for your help

AlphaFlo commented 1 week ago

The NoVNC website connects back to itself via Websocket. So I think the problem is that you reverse proxy the HTTPS traffic, but not the WS (Websocket) traffic. I dont know which webserver you are using for the reverse proxy, but Im sure there are examples how to configure it for NoVNC in Google. I think this might be the answer to your question: https://stackoverflow.com/a/27784398/435733

I think I found the error in using HTTPS in my proxy which seems to automatically use wss:// instead of ws:// I got it working now. Is there a way to change your vnc to wss? I will try to find it but I dont really know much about VNC.

But still thanks for your help

I am getting "Failed to connect to server: SecurityError: The operation is insecure." as an error

kroese commented 1 week ago

Yes because you cannot mix HTTPS and non-HTTPS elements (like ws://) on the same page.

All you need to do is to redirect /websockify to port 5700 of the container. For example, in nginx:

    location /websockify {

      proxy_http_version 1.1;

      proxy_set_header Connection 'upgrade';
      proxy_set_header Upgrade $http_upgrade;

      proxy_pass http://172.17.0.3:5700/;
    }

Instead of reverse proxying, it might be easier to just host a copy of noVNC yourself and make it connect to port 5700 of the container.