Learn how to set up azlin restore on yer platform from scratch.
This tutorial walks ye through settin' up the azlin restore command on yer specific platform. Ye'll learn platform detection, terminal configuration, and test yer setup.
Time Required: 10-15 minutes Prerequisites:
- Azlin CLI installed (
pip install azlin) - At least one running VM (
azlin listshows VMs) - SSH key configured (
~/.ssh/id_rsaor custom)
Choose yer platform:
macOS comes with Terminal.app pre-installed. No installation needed.
# Verify terminal is available
which open
# Output: /usr/bin/openazlin restore --dry-runExpected output:
Detecting platform: macOS
Default terminal: Terminal.app
# Create config file if it doesn't exist
mkdir -p ~/.azlin
cat > ~/.azlin/config.toml << 'EOF'
# macOS configuration
default_resource_group = "my-rg"
terminal_launcher = "macos_terminal"
restore_timeout = 30
[session_names]
"dev-vm" = "development"
EOF# Start one VM first
azlin start my-dev-vm
# Test restore
azlin restore --dry-run
# Actually restore
azlin restoreTerminal.app should open new windows fer each VM. Each window shows:
Last login: Thu Feb 6 12:00:00 2026
[azureuser@dev-vm ~]$
Problem: Terminal windows don't open
# Check if AppleScript execution is enabled
defaults read com.apple.Terminal
# Try forcing macOS terminal
azlin restore --terminal macos_terminalProblem: Wrong SSH key
# Specify custom key in config
cat >> ~/.azlin/config.toml << 'EOF'
ssh_key_path = "~/.ssh/custom_key"
EOF- Open Microsoft Store
- Search "Windows Terminal"
- Click "Install"
Or via command line:
winget install Microsoft.WindowsTerminal# Check Windows Terminal is installed
where wt
# Output: C:\Users\YourName\AppData\Local\Microsoft\WindowsApps\wt.exeazlin restore --dry-runExpected output:
Detecting platform: Windows
Default terminal: Windows Terminal
Multi-tab: enabled
# Create config directory
mkdir $HOME\.azlin
# Create config file
@"
default_resource_group = "my-rg"
terminal_launcher = "windows_terminal"
terminal_multi_tab = true
restore_timeout = 30
"@ | Out-File -FilePath $HOME\.azlin\config.toml -Encoding UTF8# Test with dry-run
azlin restore --dry-run
# Actually restore (opens Windows Terminal tabs)
azlin restoreWindows Terminal opens one window with multiple tabs:
- Tab 1: "azlin - dev-vm-1"
- Tab 2: "azlin - test-vm-2"
- Tab 3: "azlin - prod-vm-3"
Problem: wt.exe not found
# Manual path configuration
$config = @"
terminal_launcher = "windows_terminal"
windows_terminal_path = "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.0.0_x64\wt.exe"
"@
$config | Out-File -Append $HOME\.azlin\config.tomlProblem: Separate windows instead of tabs
# Disable multi-tab in config
azlin restore --no-multi-tab# Check WSL version
cat /proc/version
# Output should contain "microsoft"# Find Windows Terminal executable
ls -la /mnt/c/Users/*/AppData/Local/Microsoft/WindowsApps/wt.exeazlin restore --dry-runExpected output:
Detecting platform: WSL
Default terminal: Windows Terminal
Windows Terminal path: /mnt/c/Users/YourName/AppData/Local/Microsoft/WindowsApps/wt.exe
Multi-tab: enabled
# Get Windows username
WINDOWS_USER=$(cmd.exe /c "echo %USERNAME%" 2>/dev/null | tr -d '\r\n')
# Create config
mkdir -p ~/.azlin
cat > ~/.azlin/config.toml << EOF
# WSL configuration
default_resource_group = "azlin-wsl"
terminal_launcher = "windows_terminal"
terminal_multi_tab = true
restore_timeout = 60 # Longer timeout fer WSL
[session_names]
"dev-vm" = "development"
"test-vm" = "testing"
EOF# Dry-run first
azlin restore --dry-run
# Full restore
azlin restoreWindows Terminal opens in Windows (not WSL) with tabs containing SSH sessions.
Problem: Windows Terminal not found
# Manual path discovery
find /mnt/c/Users -name "wt.exe" 2>/dev/null
# Add to config
echo 'windows_terminal_path = "/mnt/c/Users/YourName/AppData/Local/Microsoft/WindowsApps/wt.exe"' >> ~/.azlin/config.tomlProblem: SSH connection fails from Windows Terminal
# Verify SSH works from WSL first
ssh -i ~/.ssh/id_rsa azureuser@10.0.1.4
# Check SSH key path is accessible from Windows
wt.exe wsl -e ssh -i ~/.ssh/id_rsa azureuser@10.0.1.4Problem: Slow launch times
# Increase timeout in config
sed -i 's/restore_timeout = 30/restore_timeout = 90/' ~/.azlin/config.toml# Ubuntu/Debian
sudo apt update
sudo apt install gnome-terminal
# Fedora/RHEL
sudo dnf install gnome-terminal
# Arch
sudo pacman -S gnome-terminal# Check gnome-terminal
which gnome-terminal
# Output: /usr/bin/gnome-terminal
# Fallback check fer xterm
which xterm
# Output: /usr/bin/xtermazlin restore --dry-runExpected output:
Detecting platform: Linux
Default terminal: gnome-terminal
mkdir -p ~/.azlin
cat > ~/.azlin/config.toml << 'EOF'
# Linux configuration
default_resource_group = "linux-vms"
terminal_launcher = "linux_gnome"
restore_timeout = 30
[session_names]
"dev-vm" = "development"
"build-vm" = "build-server"
EOF# Dry-run
azlin restore --dry-run
# Full restore
azlin restoregnome-terminal opens separate windows fer each VM.
Problem: gnome-terminal not opening
# Check DISPLAY variable
echo $DISPLAY
# Should show :0 or similar
# Set if missing
export DISPLAY=:0
# Test manual launch
gnome-terminal -- bash -c "echo 'Test window'; read"Problem: Permission denied fer terminal launch
# Check if user in correct groups
groups
# Should include: sudo, adm, cdrom
# Add to groups if missing
sudo usermod -aG sudo $USERProblem: xterm fallback instead of gnome-terminal
# Force gnome-terminal in config
echo 'terminal_launcher = "linux_gnome"' >> ~/.azlin/config.toml
# Or install gnome-terminal
sudo apt install gnome-terminalazlin restore --dry-runShould show:
- Detected platform
- Terminal launcher
- List of VMs that would be restored
- No actual terminal windows open
# Start one VM
azlin start test-vm
# Restore it
azlin restore --resource-group test-rgExpected: One terminal window opens with SSH connection.
# Start multiple VMs
azlin start dev-vm test-vm prod-vm
# Restore all
azlin restoreExpected:
- macOS/Linux: 3 separate terminal windows
- Windows/WSL: 3 tabs in one Windows Terminal window (if multi-tab enabled)
# Add session mapping to config
cat >> ~/.azlin/config.toml << 'EOF'
[session_names]
"test-vm" = "testing-session"
EOF
# Restore
azlin restore
# In terminal, check session name
tmux list-sessions
# Should show: testing-sessionAfter setup is complete:
- Configure terminal preferences: Configuration Reference
- Learn restore workflows: How to Restore Sessions
- Handle issues: Troubleshooting Guide
| Platform | Default Terminal | Multi-Tab | Config Location |
|---|---|---|---|
| macOS | Terminal.app | No | ~/.azlin/config.toml |
| Windows | Windows Terminal | Yes | %USERPROFILE%\.azlin\config.toml |
| WSL | Windows Terminal | Yes | ~/.azlin/config.toml |
| Linux | gnome-terminal | No | ~/.azlin/config.toml |