Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
killahop opened this issue Oct 21, 2024 · 5 comments
Open

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

killahop opened this issue Oct 21, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers legacy Using legacy winapps

Comments

@killahop
Copy link

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.

@oskardotglobal oskardotglobal added the enhancement New feature or request label Oct 22, 2024
@killahop
Copy link
Author

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

@killahop killahop reopened this Oct 22, 2024
@KernelGhost
Copy link
Member

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

@killahop
Copy link
Author

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
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers legacy Using legacy winapps
Projects
None yet
Development

No branches or pull requests

4 participants