Score:0

How would I set up my Windows 11 laptop with WSL2 as a server that I can run commands to remotely?

ph flag

The laptop in question has a GPU so is terrible for carrying around but I want to use the GPU to train neural networks, including Unity ML-Agents for Unity running on Windows 11, from my other no-GPU laptop.

I read this: https://dev.to/composite/a-tiny-but-perfect-guide-how-to-install-wsl-2-on-windows-server-2022-1a8f

and understand some of it but would need to Google the rest.

For example, right now I am training a Unity ML-Agent to drive a race car using PPO algorithm and I usually call mlagents-learn --run-id=April9_current_time in a WSL Ubuntu shell but I want to do this remotely after uploading my updated .yaml or C# script.

I ran lsb_release -a and get

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
David avatar
cn flag
What is the hardware of the machine you want to run the WSL? What version of Ubuntu are you using?
mLstudent33 avatar
ph flag
I updated my question with the relevant info.
David avatar
cn flag
Where is the hardware info I requested?
Score:2
vn flag

Windows Server (mentioned in the link) probably isn't what you actually want for this. Windows Server is a highly specialized version of Windows designed for corporate IT departments who are hosting on-premise services like Microsoft Exchange, Active Directory, enterprise-grade virtualization or web hosting, etc.

Because of its specialization, Windows Server didn't even originally support WSL. Even now, I'm not sure if the latest WSL releases run on it. Regardless, let's consider Windows Server a red-herring for your particular ask.

The laptop in question has a GPU so is terrible for carrying around but I want to use the GPU to train neural networks, including Unity ML-Agents for Unity running on Windows 11, from my other no-GPU laptop.

The first challenge you will face is the same as with any service that you want to access remotely -- The network route to your GPU-laptop. Of course, most computers aren't (and shouldn't be) directly accessible from the public Internet.

To access Ubuntu on WSL from a remote system, you'll need two things:

  • A network path to the GPU-laptop system
  • A way to run commands on that system once connected.

The first is typically going to be the biggest hurdle, especially securely. And it's going to depend on how your desktop accesses the Internet in the first place. If you have VPN access to the normal network the laptop resides in, then that's one possibility, and likely more secure than most other methods.

Another solution, which I saw in another answer to a WSL question at one point, is ngrok. I've never tried this one myself. Note the ngrok RDP help (RDP covered below) - They recommend that you only give access to specific network ranges so that you limit the potential security exposure. It should also go without saying that you'll want a VERY strong password in place if you are opening up your system to remote access from the Internet-at-large.

Once you can at least reach the GPU-system from the other laptop, you'll need to decide on a protocol to use for remote access. The two methods discussed in that article still apply. However, some of the information is a bit out-of-date:

  • Remote Desktop: My preferred solution at the moment is Remote Desktop (RDP). As long as you have Windows Pro, Windows Education, or higher (in other words, not Windows Home), you can enable it through the System -> Remote Desktop settings. You can then connect to it from other Windows systems using the Remote Desktop Connection application. Other operating systems have clients as well.

    The advantage here is that you can access the system whether or not your user is logged into the physical desktop. Other remote desktop solutions exist as well, such as VNC.

  • SSH: The other solution is to SSH into Ubuntu running under WSL. This honestly used to be easier in earlier versions of WSL. However, the shift to running WSL as an application means that you can't start WSL over SSH. This means that you must have already logged into the GPU laptop's desktop and started Ubuntu with the SSH service running. If the system reboots, for instance, and Ubuntu is not running, then you won't be able to use SSH.

    To configure SSH, see my recent answer on that topic here.

mLstudent33 avatar
ph flag
Ok, wow, It sounds like security is a major concern here. And I only have Windows 11 Home so will have to consider the price to upgrade. 130 dollars for me. I'll probably give this a shot.
NotTheDr01ds avatar
vn flag
@mLstudent33 Is that the student discount? I could be wrong, but I seem to remember from some other post that you are taking classes at Georgia Tech? If that's the case, then try [OnTheHub](https://onthehub.com/school). Hopefully, you can get Windows Education for a fraction of that price. -- And yes, security considerations should still be paramount when exposing any system to the Internet at large, especially a personal system where you might have cookies for online-banking, etc.
mLstudent33 avatar
ph flag
That's Canadian pricing for a Lenovo bought in Japan, not sure how that works. Yep, I'll check that Gatech discount for sure.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.