Skip to content

Instantly share code, notes, and snippets.

@nghyane
Created March 14, 2026 14:46
Show Gist options
  • Select an option

  • Save nghyane/ec94d4085fef45da64676bf64c49988a to your computer and use it in GitHub Desktop.

Select an option

Save nghyane/ec94d4085fef45da64676bf64c49988a to your computer and use it in GitHub Desktop.
Setup Sunshine + Moonlight remote desktop on Ubuntu via Tailscale SSH
# 🖥️ Remote Desktop Ubuntu với Sunshine + Moonlight qua Tailscale
## Yêu cầu
- PC Ubuntu có GPU (NVIDIA/AMD/Intel)
- Tailscale đã cài trên cả 2 máy
- SSH access qua Tailscale
## 1. Cài Sunshine trên Ubuntu (qua SSH)
```bash
# Xác định Ubuntu version
lsb_release -rs
# Tải Sunshine (v2025.924.154138 - latest)
# Ubuntu 24.04
wget https://github.com/LizardByte/Sunshine/releases/download/v2025.924.154138/sunshine-ubuntu-24.04-amd64.deb -O sunshine.deb
# Ubuntu 22.04
# wget https://github.com/LizardByte/Sunshine/releases/download/v2025.924.154138/sunshine-ubuntu-22.04-amd64.deb -O sunshine.deb
# Cài đặt
sudo apt install -f ./sunshine.deb
```
## 2. Cấu hình Sunshine
```bash
# Chạy Sunshine lần đầu
sunshine
```
Truy cập web UI: `https://<tailscale-ip>:47990`
- Tạo username/password
- Cấu hình encoder (NVENC cho NVIDIA, VAAPI cho AMD/Intel)
## 3. Chạy Sunshine như service (tự động khởi động)
```bash
# Enable systemd service
systemctl --user enable sunshine
systemctl --user start sunshine
# Cho phép service chạy khi không login
sudo loginctl enable-linger $(whoami)
```
## 4. Cài Moonlight trên Client
- **macOS**: `brew install --cask moonlight`
- **Windows**: https://moonlight-stream.org
- **iOS/Android**: App Store / Google Play
## 5. Kết nối
1. Mở Moonlight
2. Nhập IP Tailscale của PC Ubuntu (ví dụ: `100.86.201.120`)
3. Pair bằng PIN hiển thị trên web UI Sunshine
4. Stream!
## Ưu điểm
- ✅ Độ trễ cực thấp (hardware encoding)
- ✅ Chạy qua Tailscale → bảo mật, không cần mở port
- ✅ Hỗ trợ 4K60fps
- ✅ Open-source & miễn phí
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment