Skip to content

About

Lend a Windows PC's GPU to a trusted friend over Tailscale: WSL2 + CUDA PyTorch, SSH locked to the private tailnet

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Lending your GPU to a friend — setup guide

Everything here runs on your machine (the one with the GPU). It takes about 20 minutes, most of which is downloads.


What you're actually agreeing to

Worth reading before you run anything.

What this gives your friend: a Linux command line on your PC, inside WSL — a sandboxed Linux environment Windows runs alongside itself. From there they can use your GPU, CPU and RAM to train models, and read/write files inside that Linux environment.

What it does not do: open your PC to the internet. SSH is firewalled to your Tailscale network only — a private encrypted network that just you and the people you invite can see. There is no password login; only the specific key your friend sends you works.

What you should know anyway:

  • WSL can reach your Windows files at /mnt/c. If that bothers you, say so and it can be turned off (one line in /etc/wsl.conf).
  • While a training job runs, your GPU is busy. You will not be able to game. Agree on hours up front — overnight is the usual arrangement.
  • Sustained GPU load costs real electricity. Not nothing over weeks.
  • The script caps Linux at 70% of your RAM and all-but-two CPU cores, so the rest of Windows stays responsive.

Your kill switches, any time, no warning needed:

Command (PowerShell) Effect
wsl --shutdown Kills everything instantly, frees all RAM
Stop-Service sshd Cuts off remote access, leaves jobs running
tailscale down Leaves the private network entirely
nvidia-smi Shows what the GPU is doing right now

You don't owe anyone an explanation for using them.


Setup

Step 0 — NVIDIA driver (skip if you game on this box, you already have it)

Install the current GeForce Game Ready or Studio driver from nvidia.com/drivers. This is the only driver involved — do not install an NVIDIA driver inside Linux later. That is the single most common way people break WSL CUDA.

Check it worked:

nvidia-smi

Step 1 — get your friend's public key

They run this on their machine and send you the one-line output:

ssh-keygen -t ed25519 -C "their-name"   # if they don't have one yet
Get-Content ~\.ssh\id_ed25519.pub

It looks like ssh-ed25519 AAAAC3NzaC1... their-name. It is a public key — safe to send over WhatsApp, it's not a secret.

Step 2 — run the Windows script

Open PowerShell as Administrator, cd to this folder:

Set-ExecutionPolicy -Scope Process Bypass -Force
.\SETUP-WINDOWS-HOST.ps1 -PublicKey "ssh-ed25519 AAAAC3Nz... their-name"

It may stop and tell you to reboot (first time WSL is installed) or to open Ubuntu once from the Start menu to create a Linux username/password. Do that, then run the script again. It's safe to re-run any number of times.

Step 3 — sign in to Tailscale

Click the Tailscale tray icon, sign in (Google/GitHub account is fine), and invite your friend to your tailnet — or have them sign in to the same account.

Then note your address:

tailscale ip -4

Step 4 — run the Linux script

Open Ubuntu from the Start menu and run:

cd /mnt/c/path/to/remote-gpu-setup
bash setup-wsl.sh --key "ssh-ed25519 AAAAC3Nz... their-name"

The first run enables systemd and asks you to restart WSL. Do that from PowerShell, reopen Ubuntu, run the script again:

wsl --shutdown

The second run finishes and prints a PyTorch check. You want to see cuda available: True and your GPU's name.

Step 5 — tell your friend

Send them:

  • your Tailscale address (from step 3) or machine name
  • the Linux username you created in step 2
  • the port: 2222

Done.


Troubleshooting

cuda available: False — the Windows driver is too old or WSL needs restarting. wsl --shutdown in PowerShell, reopen Ubuntu. If it's still false, update the NVIDIA driver on the Windows side.

Friend can't connect — check in order:

tailscale status                      # are you both online?
Get-Service sshd                      # is Windows SSH running?
wsl -d Ubuntu-24.04 -- systemctl status ssh    # is Linux SSH running?

If Linux SSH isn't running: wsl -d Ubuntu-24.04 -- sudo systemctl start ssh.

Connection works but immediately closes — usually the authorized key didn't take. Re-run the Windows script with -PublicKey and check the key was pasted as one unbroken line.

Windows build older than 22621 — mirrored networking isn't available, so port 2222 won't forward automatically. Either update Windows, or connect to the Windows SSH server on port 22 instead and type wsl to get into Linux.

You want your RAM back — edit %USERPROFILE%\.wslconfig, lower the memory= line, then wsl --shutdown.


Files here

File Runs where
SETUP-WINDOWS-HOST.ps1 Admin PowerShell on the GPU machine
setup-wsl.sh Inside Ubuntu on the GPU machine
CLIENT-SETUP.md Instructions for the friend connecting in

About

Lend a Windows PC's GPU to a trusted friend over Tailscale: WSL2 + CUDA PyTorch, SSH locked to the private tailnet

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages