windows remote desktop

UVic computer science
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

windows remote desktop

Post by pan »

on beelink mini s with tailscale running unattended for remote access. by default, windows sleeps and thus tailscale, so breaks remote access (if windows wakes up locally, remote access can resume). set windows -> settings -> system -> power, when plugged in, put my device to sleep after "never" can mitigate this issue

still cannot get wsl to run unattended, does not really work even after changing the vbs script to the right ubuntu distribution. followed the task scheduler each step as specified. it shall be doable as tailscale running unattended
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

once remote login (through tailscale and remote desktop client), run the vbs script manually can launch wsl2 in the background (so windows did not call the script at startup?). with openssh-server and also tailscale installed in wsl2, one can remote login the ubuntu vm in wsl2. if remote user logs out, wsl2 stops as a user task
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

pan wrote:still cannot get wsl to run unattended, does not really work even after changing the vbs script to the right ubuntu distribution. followed the task scheduler each step as specified. it shall be doable as tailscale running unattended
https://github.com/microsoft/WSL/issues/9231
Store WSL currently isn't accessible from session 0 contexts.
This means that it's not possible to interact with WSL from remote sessions such as ssh or psremote.
https://learn.microsoft.com/en-us/windo ... own-issues
Known Issues:
Launching Windows Subsystem for Linux from session zero does not currently work (for example from an ssh connection).
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

it seems that we have solved the windows (mini) pc going sleep issue when used for remote access https://en.wikipedia.org/wiki/ACPI#Global_states
find a solution to the mini pc sleep problem. need to access the bios with a keyboard and monitor. when you power on the mini pc, hit del key to get into bios setting. go to the advanced page, under thermal configuration, enable all thermal functions (so the mini pc can adjust its fan speed to cool better). then under the s5 rtc wake settings, choose to wake system from s5 at fixed time, e.g., 7am, so even if the pc goes sleep, it shall wake up next morning. in s5 rtc wake settings, if choose to wake system from s5 with dynamic time (e.g., with increase 1 minute), it will wake 1 minute after shutdown
now it runs well at sfu in windows
clarkzjw
Posts: 1914
Joined: Thu May 13, 2021 7:38 pm
Contact:

Re: windows remote desktop

Post by clarkzjw »

pan wrote:still cannot get wsl to run unattended, https://medium.com/swlh/how-to-run-ubun ... 567d6c48f1 does not really work even after changing the vbs script to the right ubuntu distribution. followed the task scheduler each step as specified. it shall be doable as tailscale running unattended
Snipaste_2023-05-30_22-53-57.png
Snipaste_2023-05-30_22-53-57.png (117.77 KiB) Viewed 4351 times
it seems with the Windows Terminal app (https://github.com/microsoft/terminal), you can set Windows Terminal app "Launch on machine startup", and open a default Linux profile, which has systemd enabled and Tailscale installed, then you can access the Linux distro remotely via Tailscale after Windows reboot, without login to the Windows desktop. It seems working on my case.
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

clarkzjw wrote:
pan wrote:still cannot get wsl to run unattended, https://medium.com/swlh/how-to-run-ubun ... 567d6c48f1 does not really work even after changing the vbs script to the right ubuntu distribution. followed the task scheduler each step as specified. it shall be doable as tailscale running unattended
it seems with the Windows Terminal app (https://github.com/microsoft/terminal), you can set Windows Terminal app "Launch on machine startup", and open a default Linux profile, which has systemd enabled and Tailscale installed, then you can access the Linux distro remotely via Tailscale after Windows reboot, without login to the Windows desktop. It seems working on my case.
thanks. can you get the windows mini pc in ecs404 to work like this? if so, we can replicate to other remote locations too
clarkzjw
Posts: 1914
Joined: Thu May 13, 2021 7:38 pm
Contact:

Re: windows remote desktop

Post by clarkzjw »

pan wrote:thanks. can you get the windows mini pc in ecs404 to work like this? if so, we can replicate to other remote locations too
ok, I'll try to set it up for the mini pc in ecs404.
pouriatolouei
Posts: 139
Joined: Mon May 01, 2023 9:27 am

Re: windows remote desktop

Post by pouriatolouei »

pan wrote: thanks. can you get the windows mini pc in ecs404 to work like this? if so, we can replicate to other remote locations too
The mini pc has been configured to automatically start windows terminal app and the wsl2 ubuntu without user login.
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

pouriatolouei wrote:
pan wrote: thanks. can you get the windows mini pc in ecs404 to work like this? if so, we can replicate to other remote locations too
The mini pc has been configured to automatically start windows terminal app and the wsl2 ubuntu without user login.
great. then you can replicate the setup to the mini pc in burnaby as well
pouriatolouei
Posts: 139
Joined: Mon May 01, 2023 9:27 am

Re: windows remote desktop

Post by pouriatolouei »

pan wrote:
pouriatolouei wrote:
pan wrote: thanks. can you get the windows mini pc in ecs404 to work like this? if so, we can replicate to other remote locations too
The mini pc has been configured to automatically start windows terminal app and the wsl2 ubuntu without user login.
great. then you can replicate the setup to the mini pc in burnaby as well
I tried setting it up, but the terminal only automatically launches after I remote login. Before that ping and ssh fail.
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

pouriatolouei wrote:
pan wrote:
pouriatolouei wrote:The mini pc has been configured to automatically start windows terminal app and the wsl2 ubuntu without user login.
great. then you can replicate the setup to the mini pc in burnaby as well
I tried setting it up, but the terminal only automatically launches after I remote login. Before that ping and ssh fail.
can you ask jinwei to help you troubleshoot a bit? i will try the same on a mini pc to be sent to ottawa, currently associated with the new york city point of presence, so you can access coast-to-coast with enough geographical diversity as well
pouriatolouei
Posts: 139
Joined: Mon May 01, 2023 9:27 am

Re: windows remote desktop

Post by pouriatolouei »

pan wrote: can you ask jinwei to help you troubleshoot a bit? i will try the same on a mini pc to be sent to ottawa, currently associated with the new york city point of presence, so you can access coast-to-coast with enough geographical diversity as well
Jinwei looked into it and it seems like the remote mini pc does a full powercycle cold reboot/shutdown, which won't automatically start windows terminal app unless user logins to the desktop. Enabling fast startup should prevent this, but choosing Restart from the UI will still do a full shutdown, followed by a cold boot. But on his laptop even if he chooses Restart, it doesn't do a full shutdown, it's still fast startup. Even though the settings on the remote mini pc looks the same, it still behaves differently.
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

pouriatolouei wrote:
pan wrote: can you ask jinwei to help you troubleshoot a bit? i will try the same on a mini pc to be sent to ottawa, currently associated with the new york city point of presence, so you can access coast-to-coast with enough geographical diversity as well
Jinwei looked into it and it seems like the remote mini pc does a full powercycle cold reboot/shutdown, which won't automatically start windows terminal app unless user logins to the desktop. Enabling fast startup should prevent this, but choosing Restart from the UI will still do a full shutdown, followed by a cold boot. But on his laptop even if he chooses Restart, it doesn't do a full shutdown, it's still fast startup. Even though the settings on the remote mini pc looks the same, it still behaves differently.
then it's likely due to the difference of bios and windows interaction. you can leave it aside for now. let me find an identical mini pc as the remote one too
pouriatolouei
Posts: 139
Joined: Mon May 01, 2023 9:27 am

Re: windows remote desktop

Post by pouriatolouei »

pan wrote:then it's likely due to the difference of bios and windows interaction. you can leave it aside for now. let me find an identical mini pc as the remote one too
I set up wsl on the mini pc that you gave me yesterday and after reboot, the terminal launched before login. I double checked the bios and it was the same as the mini pc in SFU. However, when I specifically performed a full power down with "shutdown /s /f /t 0" then as expected, the terminal didn't launch until I logged in.

So it seems like bios isn't the issue.
pan
Posts: 56976
Joined: Mon Sep 11, 2006 10:23 am

Re: windows remote desktop

Post by pan »

pouriatolouei wrote:
pan wrote:then it's likely due to the difference of bios and windows interaction. you can leave it aside for now. let me find an identical mini pc as the remote one too
I set up wsl on the mini pc that you gave me yesterday and after reboot, the terminal launched before login. I double checked the bios and it was the same as the mini pc in SFU. However, when I specifically performed a full power down with "shutdown /s /f /t 0" then as expected, the terminal didn't launch until I logged in.

So it seems like bios isn't the issue.
if this mini pc works well for you, you can ask jinwei to bring to vancouver next week to swap with the one at haoyuan

another brand new mini pc will be delivered to minming in ottawa next tuesday and you and jinwei can help him enable remote desktop for you to access remotely

a checklist: hit del to get into bios and enable all thermal functions to cool better and automatically power on after power is plugged or one minute after shutdown

finish installing the pre-installed windows 11 pro. use our test username and password. install tailscale and give you the login link, so it will be in your tail network

enable remote desktop access and you can take over from there with tailscale. install whatever you need for gfn over starlink experiments and run wsl2 at startup
Post Reply

Return to “UVic CS”