Skip to content

Commit eb7b151

Browse files
authored
Merge pull request #470 from AccelerationConsortium/copilot/fix-4116d1de-8643-4cb9-893f-ba3e1d07f342
Add warning directive for private browser note and reorganize Tailscale setup sections
2 parents 2e07a37 + 8189ede commit eb7b151

File tree

1 file changed

+90
-83
lines changed

1 file changed

+90
-83
lines changed

docs/tailscale-setup.md

Lines changed: 90 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Tailscale](https://tailscale.com/) is a "mesh VPN" that allows secure access to devices across different networks. It simplifies remote access and management of devices.
44

5-
The following covers [tailscale setup](#general-setup-instructions) for general-purpose machines (Linux, macOS, Windows, RPi OS) and SSH access, [setup for an OT-2 environment](#installing-and-auto-starting-tailscale-on-ot-2-opentrons) which requires special installation steps, and [instructions for remote desktop and SSH](#remote-desktop-and-ssh-on-windows) on Windows.
5+
The following covers [tailscale setup](#general-setup-instructions) for general-purpose Linux, macOS, and Raspberry Pi devices with SSH access, [instructions for remote desktop and SSH](#remote-desktop-and-ssh-on-windows) on Windows devices, and [setup for an OT-2 environment](#installing-and-auto-starting-tailscale-on-ot-2-opentrons) which requires special installation steps.
66

77
## General Setup Instructions
88

@@ -59,9 +59,9 @@ You also might want to ["disable key expiry"](https://tailscale.com/kb/1028/key-
5959

6060
![image](https://github.com/user-attachments/assets/23ad57b6-e39f-4694-86ee-7c5d685c763f)
6161

62-
## VS Code Configuration
62+
### VS Code Configuration
6363

64-
Also, consider updating the default SSH username in VS Code settings (Ctrl+,), since it will be your PC's username by default (which may not correspond to the username on the RPi).
64+
Also, consider updating the default SSH username in VS Code settings (Ctrl+,), since it will be your PC's username by default (which may not correspond to the username on the device).
6565

6666
Within the tailscale sidebar interface, I found it useful to try to connect to the terminal first, go through the prompts, then click the "Attach VS Code" button and follow any prompts again. I've had some issues (https://github.com/AccelerationConsortium/ac-training-lab/issues/184#issuecomment-2719179967) with getting VS Code errors when trying to go directly to "Attach VS Code" for a new device. If you click "details" while it's loading, you will likely find that it's waiting on you to authenticate by accessing a particular link.
6767

@@ -72,6 +72,93 @@ Additional resources:
7272
- https://tailscale.com/kb/1265/vscode-extension
7373
- https://tailscale.com/learn/how-to-ssh-into-a-raspberry-pi
7474

75+
---
76+
## Remote Desktop and SSH on Windows
77+
78+
[Tailscale SSH](https://tailscale.com/kb/1193/tailscale-ssh) isn't directly supported on Windows, and SSH on Windows machines can get a bit messy. However, you can still use Tailscale to set up remote desktop access or configure OpenSSH for VS Code compatibility.
79+
80+
### Remote Desktop Setup
81+
82+
Note that you can only use remote desktop on Windows 10/11 Pro or Windows 10/11 Enterprise, not on Windows 10/11 Home.
83+
84+
```{warning}
85+
[Install Tailscale for Windows](https://tailscale.com/kb/1022/install-windows).
86+
We recommend using a private browser for the interactive login step if this is a non-personal device. You may need to copy the auto-opened URL to the private browser manually.
87+
88+
Next, set up the "Remote Desktop Protocol" (RDP) [according to Tailscale's documentation](https://tailscale.com/kb/1095/secure-rdp-windows).
89+
```
90+
91+
Finally, [enable Remote Desktop on your device](https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/remotepc/remote-desktop-allow-access):
92+
93+
<img src=https://github.com/user-attachments/assets/050746cd-a4ff-4bf4-ae4a-5ad1d74f05c1 width=400 alt="Screenshot of enabling Remote Desktop on Windows">
94+
95+
Then, on the device you're planning to use to access the remote device, use Windows' built-in remote desktop:
96+
97+
<img width=350 alt="Image" src="https://github.com/user-attachments/assets/d43c2633-439a-4bd1-a914-c029cdd2ab61" />
98+
99+
You'll enter your full domain:
100+
101+
<img width=350 alt="Image" src="https://github.com/user-attachments/assets/6b947cda-e357-4ca4-a776-08ee7d023cb5" />
102+
103+
Assuming you have access to the admin console, you can find full domain by clicking on the hostname of the corresponding machine within https://login.tailscale.com/admin/machines
104+
105+
This is of the form: `<hostname>.<tailnet-id>.ts.net`
106+
107+
Otherwise, as long as you know the hostname and tailnet ID, you can manually construct that full domain and enter it in. Then, you just need to log in as normal with the remote device's username and password.
108+
109+
### Windows OpenSSH Setup, Including VS Code Compatibility
110+
111+
Since **Tailscale SSH server is not supported on Windows**, you need to set up an OpenSSH Server. Run these commands on an administrator-level PowerShell terminal:
112+
113+
#### Install and Configure OpenSSH Server:
114+
115+
Install OpenSSH Server:
116+
```powershell
117+
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
118+
```
119+
120+
Start the SSH service:
121+
```powershell
122+
Start-Service sshd
123+
```
124+
125+
Set it to start automatically:
126+
```powershell
127+
Set-Service -Name sshd -StartupType 'Automatic'
128+
```
129+
130+
Check if it's running:
131+
```powershell
132+
Get-Service sshd
133+
```
134+
135+
Configure firewall (usually done automatically, but let's make sure):
136+
```powershell
137+
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
138+
```
139+
140+
#### Important: Configure SSH for VS Code compatibility
141+
142+
After the service is running, you'll need to edit the SSH configuration:
143+
144+
```powershell
145+
notepad C:\ProgramData\ssh\sshd_config
146+
```
147+
148+
In the config file, make sure these lines are present and uncommented:
149+
```
150+
AllowTcpForwarding yes
151+
GatewayPorts no
152+
PermitTunnel no
153+
```
154+
155+
Then restart the SSH service:
156+
```powershell
157+
Restart-Service sshd
158+
```
159+
160+
_Based on https://github.com/AccelerationConsortium/ac-training-lab/issues/376_
161+
75162
---
76163

77164
## Installing and Auto-starting Tailscale on OT-2 (Opentrons)
@@ -233,83 +320,3 @@ Now, you can reboot OT-2 and see if the device on the admin page of Tailscale wi
233320
| `/data/start_tailscale.sh` | Startup script |
234321
| `/etc/systemd/system/tailscale-autostart.service` | Systemd autostart service definition |
235322

236-
## Remote Desktop and SSH on Windows
237-
238-
[Tailscale SSH](https://tailscale.com/kb/1193/tailscale-ssh) isn't directly supported on Windows, and SSH on Windows machines can get a bit messy. However, you can still use Tailscale to set up remote desktop access or configure OpenSSH for VS Code compatibility.
239-
240-
### Remote Desktop Setup
241-
242-
Note that you can only use remote desktop on Windows 10/11 Pro or Windows 10/11 Enterprise, not on Windows 10/11 Home.
243-
244-
[Install tailscale for Windows](https://tailscale.com/kb/1022/install-windows). We recommend using a private browser for the interactive login step if this is a non-personal device. You may need to copy the auto-opened URL to the private browser manually. Next, set up the "Remote Desktop Protocol" (RDP) [according to tailscale's documentation](https://tailscale.com/kb/1095/secure-rdp-windows).
245-
246-
Finally, [enable Remote Desktop on your device](https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/remotepc/remote-desktop-allow-access):
247-
248-
<img src=https://github.com/user-attachments/assets/050746cd-a4ff-4bf4-ae4a-5ad1d74f05c1 width=400 alt="Screenshot of enabling Remote Desktop on Windows">
249-
250-
Then, on the device you're planning to use to access the remote device, use Windows' built-in remote desktop:
251-
252-
<img width=350 alt="Image" src="https://github.com/user-attachments/assets/d43c2633-439a-4bd1-a914-c029cdd2ab61" />
253-
254-
You'll enter your full domain:
255-
256-
<img width=350 alt="Image" src="https://github.com/user-attachments/assets/6b947cda-e357-4ca4-a776-08ee7d023cb5" />
257-
258-
Assuming you have access to the admin console, you can find full domain by clicking on the hostname of the corresponding machine within https://login.tailscale.com/admin/machines
259-
260-
This is of the form: `<hostname>.<tailnet-id>.ts.net`
261-
262-
Otherwise, as long as you know the hostname and tailnet ID, you can manually construct that full domain and enter it in. Then, you just need to log in as normal with the remote device's username and password.
263-
264-
### Windows OpenSSH Setup, Including VS Code Compatibility
265-
266-
Since **Tailscale SSH server is not supported on Windows**, you need to set up an OpenSSH Server. Run these commands on an administrator-level PowerShell terminal:
267-
268-
#### Install and Configure OpenSSH Server:
269-
270-
Install OpenSSH Server:
271-
```powershell
272-
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
273-
```
274-
275-
Start the SSH service:
276-
```powershell
277-
Start-Service sshd
278-
```
279-
280-
Set it to start automatically:
281-
```powershell
282-
Set-Service -Name sshd -StartupType 'Automatic'
283-
```
284-
285-
Check if it's running:
286-
```powershell
287-
Get-Service sshd
288-
```
289-
290-
Configure firewall (usually done automatically, but let's make sure):
291-
```powershell
292-
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
293-
```
294-
295-
#### Important: Configure SSH for VS Code compatibility
296-
297-
After the service is running, you'll need to edit the SSH configuration:
298-
299-
```powershell
300-
notepad C:\ProgramData\ssh\sshd_config
301-
```
302-
303-
In the config file, make sure these lines are present and uncommented:
304-
```
305-
AllowTcpForwarding yes
306-
GatewayPorts no
307-
PermitTunnel no
308-
```
309-
310-
Then restart the SSH service:
311-
```powershell
312-
Restart-Service sshd
313-
```
314-
315-
_Based on https://github.com/AccelerationConsortium/ac-training-lab/issues/376_

0 commit comments

Comments
 (0)