winapps-org / winapps

The winapps main project, forked from https://github.com/Fmstrat/winapps/
Other
1.16k stars 57 forks source link

Installation and launch issues of RDP apps on custom port #304

Open killahop opened 2 weeks ago

killahop commented 2 weeks ago

My host machine has an RDP server running on UDP port 3389 for support. Docker and Windows are configured on port 3390. I attempted to install Winapps on a port other than 3389. By modifying the setup.sh file and adding :3390 to lines 1055 and 1184, I can connect using xfreerdp3 /v:127.0.0.1:3390 /u:docker /p:password, but the installation fails if I modify only line 86. Additionally, I have installed Excel, which is visible in GNOME, but it does not launch, likely due to the installation logic. I hope this information can assist in resolving the issue.

killahop commented 1 week ago

By modifying the setup.sh file like this: /v:"$RDP_IP:3390" &>"$FREERDP_LOG" & at line 1055 and line 1184, it works."

KernelGhost commented 1 week ago

@killahop Are you suggesting the RDP port should be specified within the WinApps configuration file instead of being hard-coded?

killahop commented 1 week ago

I’ve already specified the port number I wanted to use, which is 3390, in the configuration files. However, I encountered issues with this setup, particularly with the checks for the RDP connection. It didn’t seem to work properly. If you have any suggestions on how to resolve this issue, I would appreciate your help!

Thank you!

xenongee commented 4 days ago

Here's a bit of code from my automation script:

WORKDIR="/opt/winapps"

tee -a ${WORKDIR}/winapps/oem/rdp-allow.ps1 &>/dev/null <<EOF
\$portvalue = 3390

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value \$portvalue

New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort \$portvalue
New-NetFirewallRule -DisplayName 'RDPPORTLatest-UDP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol UDP -LocalPort \$portvalue
EOF

tee -a ${WORKDIR}/winapps/oem/install.bat &>/dev/null <<EOF
powershell -ExecutionPolicy Bypass -File C:\OEM\rdp-allow.ps1
EOF

sudo sed -i 's/local FILE_PATH=""/local FILE_PATH=""\n    RDP_IP="$DOCKER_IP:$RDP_PORT"\n    echo ":: ip: $RDP_IP port: $RDP_PORT"/' ${WORKDIR}/bin/winapps

A file called rdp-allow.ps1 is created that changes the Windows RDP port to 3390 and allows this port through the firewall. I add the rdp-allow.ps1 startup line to install.bat for Windows postinstall. In the bash script /repo/bin/winapps I add 2 lines after the line local FILE_PATH="" on line 507 using sed

local FILE_PATH=""
RDP_IP="$DOCKER_IP:$RDP_PORT"
echo ":: ip: $RDP_IP port: $RDP_PORT" 

I'm not sure about working through other backends, I was testing in Docker.

killahop commented 4 days ago

as soon as I do a new installation I'll try these changes of yours. thanks