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

Windows session not starting #334

Open
Boyfinn opened this issue Nov 24, 2024 · 5 comments
Open

Windows session not starting #334

Boyfinn opened this issue Nov 24, 2024 · 5 comments

Comments

@Boyfinn
Copy link

Boyfinn commented Nov 24, 2024

A couple days ago my WinApps setup stopped working. I've tried terminating and restarting the container, but when launching windows for example: I just get a toast saying: "WinApps: Booting Windows", and then nothing happens.
Trying to launch windows through the terminal gives no output either.

I'm on:
OS: Linux mint 22_x86_64
Kernel: 6.8.0-49
Desktop: Cinnamon 6.2.9

@mindset-tk
Copy link
Contributor

mindset-tk commented Nov 25, 2024

I'm also having this issue. Winapps.log is not much help. Related issue that will confuse things, I can run a windows RDP session via winapps, and it runs fine. Below, the log states that windows immediately ended when in fact I ran the session for about 5 minutes, clicked around and opened terminal to test that it worked inside of the freerdp session. The "END" line was not appended until after I closed the session.

OS: Arch X64
Kernel: 6.11.9-arch1-1
DE: KDE Plasma 6.2.3

[Mon Nov 25 11:52:37 AM PST 2024-21660] START
[Mon Nov 25 11:52:37 AM PST 2024-21660] SCRIPT_DIR: /home/[username]/.local/bin
[Mon Nov 25 11:52:37 AM PST 2024-21660] SCRIPT_ARGS: WindowsTerminal
[Mon Nov 25 11:52:37 AM PST 2024-21660] HOME_DIR: /home/elle
[Mon Nov 25 11:52:37 AM PST 2024-21660] LAST_RUN: 1732564267
[Mon Nov 25 11:52:37 AM PST 2024-21660] THIS_RUN: 1732564357
[Mon Nov 25 11:52:37 AM PST 2024-21660] Using FreeRDP command 'xfreerdp3'.
[Mon Nov 25 11:52:37 AM PST 2024-21660] END
[Mon Nov 25 11:52:46 AM PST 2024-13636] START
[Mon Nov 25 11:52:46 AM PST 2024-13636] SCRIPT_DIR: /home/[username]/.local/bin
[Mon Nov 25 11:52:46 AM PST 2024-13636] SCRIPT_ARGS: windows
[Mon Nov 25 11:52:46 AM PST 2024-13636] HOME_DIR: /home/elle
[Mon Nov 25 11:52:46 AM PST 2024-13636] LAST_RUN: 1732564357
[Mon Nov 25 11:52:46 AM PST 2024-13636] THIS_RUN: 1732564366
[Mon Nov 25 11:52:46 AM PST 2024-13636] Using FreeRDP command 'xfreerdp3'.
[Mon Nov 25 11:52:46 AM PST 2024-13636] WINDOWS
[Mon Nov 25 11:52:46 AM PST 2024-13636] END

@mindset-tk
Copy link
Contributor

mindset-tk commented Nov 25, 2024

A nice feature would be an ability to pull the FreeRDP logs for the command being run, via an environment var or similar. Nonetheless after a bit of rubber ducking I was able to extract the exact command being run by:

xfreerdp3 /cert:tofu /sound /microphone /d: /u:[winusername] /p:[winpassword] /scale:100 +dynamic-resolution +auto-reconnect +home-drive +clipboard -wallpaper +span /wm-class:"WindowsTerminal.exe [UWP]" /app:program:"C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.21.3231.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe",icon:"/home/[linuxusername]/.local/share/winapps/apps/WindowsTerminal/icon.svg",name:"WindowsTerminal.exe [UWP]" /v:"127.0.0.1"

Running this command myself resulted in this error:

[13:14:20:011] [33175:00008198] [INFO][com.freerdp.client.x11] - [xf_setup_x11]: Enabling X11 debug mode.
[13:14:20:013] [33175:00008198] [ERROR][com.freerdp.settings] - [monitor_has_gaps]: Monitor configuration has gaps! Monitor 0 does not have any neighbor
[13:14:20:013] [33175:00008198] [ERROR][com.freerdp.core] - [freerdp_connect_begin]: ERRCONNECT_PRE_CONNECT_FAILED [0x00020001]
[13:14:20:013] [33175:00008198] [ERROR][com.freerdp.core] - [freerdp_connect_begin]: freerdp_pre_connect failed

Removing '+span' from the command allowed it to run properly; I was also able to set /monitors:0 and leave +span. This is added by the $MULTI_FLAG var, set on line 214 of winapps. Since this var is not used for regular windows RDP, this explains why the standard windows RDP session via winapps runs without issue.

Thus, my issue was solved by updating the RDP_FLAGS var in the conf file as follows:

RDP_FLAGS="/cert:tofu /sound /microphone /monitors:0"

Looking at my xrandr settings, seems like there's a 1px space between the two monitors.

Screen 0: minimum 16 x 16, current 7681 x 2160, maximum 32767 x 32767
HDMI-A-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 330mm
[long list of output resolutions]
DP-1 connected 3840x2160+3841+0 (normal left inverted right x axis y axis) 597mm x 336mm
[...]

Note the "total size" here is 7681px wide instead of the expected 3840+3840=7680. DP-1 is also placed at xy 3841,0.

I traced that back to the scaling setting I use in my desktop environment (175% on both monitors). turning that to 100%, 150% or 200% and running winapps again works without issue, and my xrandr output displays as expected (7680px wide).

Clearly, the issue was related to the interactions of xfreerdp3 and display scaling on linux; 3840 is cleanly divisible by 1.5 and 2, but not by 1.75, introducing issues there. I plan to raise a bug with xfreerdp as a result; however, I'd like to request the following:

  1. An option to output the xfreerdp logs for a given session to the winapps folder, or wherever is appropriate. Troubleshooting this issue was confounded by the lack of data provided by the cli output or the winapps.log file
  2. The winapps script contains an error in the dprint() function. It will use the same timestamp for the entirety of the run due to the $RUN var being initialized once. I suggest instead only generating the RUN ID (the random int) and instead getting the date each time the dprint() function is run to get an accurate date. I will submit a PR to this effect.
  3. An option in the config file to specify which monitor to display on would go a long way to avoid recurrence of this bug. That said my change to RDP_FLAGS did fix the issue, so this is up to the maintainers how they would proceed in this situation.

mindset-tk added a commit to mindset-tk/winapps that referenced this issue Nov 25, 2024
Logging was misleading and the date/times logged to file were always the time that the app was initialized, instead of the time of the actual log entry. Issue was noted in winapps-org#334.
@Boyfinn
Copy link
Author

Boyfinn commented Nov 26, 2024

I'm also having this issue. Winapps.log is not much help. Related issue that will confuse things, I can run a windows RDP session via winapps, and it runs fine. Below, the log states that windows immediately ended when in fact I ran the session for about 5 minutes, clicked around and opened terminal to test that it worked inside of the freerdp session. The "END" line was not appended until after I closed the session.

OS: Arch X64 Kernel: 6.11.9-arch1-1 DE: KDE Plasma 6.2.3

[Mon Nov 25 11:52:37 AM PST 2024-21660] START
[Mon Nov 25 11:52:37 AM PST 2024-21660] SCRIPT_DIR: /home/[username]/.local/bin
[Mon Nov 25 11:52:37 AM PST 2024-21660] SCRIPT_ARGS: WindowsTerminal
[Mon Nov 25 11:52:37 AM PST 2024-21660] HOME_DIR: /home/elle
[Mon Nov 25 11:52:37 AM PST 2024-21660] LAST_RUN: 1732564267
[Mon Nov 25 11:52:37 AM PST 2024-21660] THIS_RUN: 1732564357
[Mon Nov 25 11:52:37 AM PST 2024-21660] Using FreeRDP command 'xfreerdp3'.
[Mon Nov 25 11:52:37 AM PST 2024-21660] END
[Mon Nov 25 11:52:46 AM PST 2024-13636] START
[Mon Nov 25 11:52:46 AM PST 2024-13636] SCRIPT_DIR: /home/[username]/.local/bin
[Mon Nov 25 11:52:46 AM PST 2024-13636] SCRIPT_ARGS: windows
[Mon Nov 25 11:52:46 AM PST 2024-13636] HOME_DIR: /home/elle
[Mon Nov 25 11:52:46 AM PST 2024-13636] LAST_RUN: 1732564357
[Mon Nov 25 11:52:46 AM PST 2024-13636] THIS_RUN: 1732564366
[Mon Nov 25 11:52:46 AM PST 2024-13636] Using FreeRDP command 'xfreerdp3'.
[Mon Nov 25 11:52:46 AM PST 2024-13636] WINDOWS
[Mon Nov 25 11:52:46 AM PST 2024-13636] END

Basically the most I've gotten out of this as well after looking deeper into it.
I'll try this later with podman just in case it gives anything more verbose than this.

@mindset-tk
Copy link
Contributor

mindset-tk commented Nov 26, 2024

Check what version of freerdp you're running and see if you can finagle a command out of that. You aren't going to get much from winapps itself unfortunately. I am looking at adding a log file so that the xfreerdp runs are logged to file and thus present more debug info.

Winapps itself is a big bash script - to find mine I added an echo in the segment where it launches the rdp session. if you're on xfreerdp3 with a win11 client os, you could try running the command I posted, it should open a windows terminal window. There's also a folder containing the data for each of your winapps installed apps at ~/.local/share/winapps/apps/ if you want to sub in the data for a different application.

@Boyfinn
Copy link
Author

Boyfinn commented Nov 29, 2024

I can confirm now that this happens on podman too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants