1. Create a dedicated key on the Mac
1ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_winbuild -N "" -C "winbuild-mac"
2cat ~/.ssh/id_ed25519_winbuild.pub2. Enable OpenSSH Server on Windows (PowerShell, Run as Administrator)
1Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
2Start-Service sshd; Set-Service sshd -StartupType Automatic
3New-NetFirewallRule -Name sshd-tailscale -DisplayName "OpenSSH (Tailscale)" -Protocol TCP -LocalPort 22 -Action Allow -RemoteAddress 100.64.0.0/103. Add the public key on Windows
- Admin user: add it to
C:\ProgramData\ssh\administrators_authorized_keys
1Add-Content C:\ProgramData\ssh\administrators_authorized_keys "<contents of the .pub file>"
2icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"- Non-admin user: add it to
C:\Users\<profile>\.ssh\authorized_keys
4. Get the Windows user name: run
whoami on Windows (prints <pc-name>\<user>). The user name is the part after the \. For a Microsoft account this is the short name, not the email.5. Declare the host on the Mac (
~/.ssh/config)1Host winbuild
2 HostName 100.x.y.z
3 User <user>
4 IdentityFile ~/.ssh/id_ed25519_winbuild
5 IdentitiesOnly yes6. Test:
ssh winbuild whoami7. Run PowerShell over SSH: the default shell is
cmd, so send the script through stdin:1ssh winbuild 'powershell -NoProfile -NonInteractive -Command -' <<'EOF'
2Get-ChildItem C:\work
3EOF8. Conventions on the PC: everything lives in
C:\work- Repo:
C:\work\<repo>(clone it from GitHub on the PC; don't copy it over Tailscale, the relay is slow)
- Private .NET SDK:
C:\work\dotnet(install withdotnet-install.ps1 -Version <version> -InstallDir C:\work\dotnet -NoPath)
- In each SSH session, set these before calling
dotnet:
1$env:DOTNET_ROOT = "C:\work\dotnet"; $env:PATH = "C:\work\dotnet;" + $env:PATH
2$env:NUGET_PACKAGES = "C:\work\nuget"; $env:DOTNET_CLI_HOME = "C:\work\dotnet-home"- Deleting
C:\workremoves everything.
1. Install VMPal on Windows: download "VMPal for Windows" from vmpal.com/download and install it.
2. Turn on Remote Control on Windows: open VMPal βΊ Remote Control and turn on the main switch.
- When Windows Security asks for a password: keep the User name as is, type the Microsoft account password (not the PIN).
- Turn on the permissions: See the screen, Use the mouse and keyboard, Run commands as your account (and Unattended access if nobody sits at the PC).
- Turn on Tailscale in Remote Control if you connect through Tailscale.
3. Add the key for VMPal on Windows: VMPal reads
C:\Users\<profile>\.ssh\authorized_keys, not OpenSSH's admin file. Add the same public key from Part 1 to this file.4. Point to the right port on the Mac: VMPal's Remote Control has its own SSH server on port 2222; port 22 is Windows OpenSSH. Add to
~/.ssh/config:1Host <pc-name>.<tailnet>.ts.net
2 Port 2222
3 User <user>
4 IdentityFile ~/.ssh/id_ed25519_winbuild
5 IdentitiesOnly yesTest:
ssh <pc-name>.<tailnet>.ts.net must print VMPAL-REMOTE-LINK (VMPal opens no shell, that's expected).5. Add the PC in VMPal on the Mac: File βΊ Add Computerβ¦
6. First connection:
- Trust VMPal's host key after comparing it with the fingerprint shown in the Remote Control window on Windows (ECDSA
SHA256:...).
- If Windows asks, choose Allow.
