# Set up VARUA on Windows with Ubuntu

Follow these steps in order. You only need PowerShell and Ubuntu. No router changes or SSH setup.

## 1. Install Ubuntu

Open **PowerShell as Administrator** on Windows. Paste:

```powershell
wsl --install -d Ubuntu
```

Restart Windows if asked.

## 2. Open Ubuntu

Open **Ubuntu** from the Windows Start menu. Create a Linux username and password when asked.

All remaining commands run **inside Ubuntu**. New to WSL? Open the setup help below.

## First time with WSL? Set up your Ubuntu user

1. **Install and check WSL2 (PowerShell as Administrator).** Run the command from step 1. After restarting Windows if asked, check:

```powershell
wsl --list --verbose
```

Look for **Ubuntu** with **VERSION 2**. If it says 1, run `wsl --set-version Ubuntu 2` in PowerShell.

2. **Create your Linux user (Ubuntu).** On first launch, enter a lowercase username, like `alex`, and create a password. **Nothing appears while you type the password.** That's normal. This is a separate account from Windows.

3. **Check your permissions (Ubuntu).** Paste:

```bash
whoami
id -nG
sudo -v
```

`whoami` should show your new username, not `root`. The groups should include `sudo`. When asked, enter your **Ubuntu password**. If either check fails, fix the Ubuntu user setup before installing VARUA. Never run VARUA with `sudo`.

4. **Make a private project folder (Ubuntu).** Paste:

```bash
mkdir -p "$HOME/projects"
chmod 700 "$HOME/projects"
ls -ld "$HOME/projects"
```

The folder should belong to your Ubuntu username. Keep Linux projects in `~/projects`. Windows drives under `/mnt/c` use different permission rules; don't change their permissions to fix Linux access.

## 3. Prepare Ubuntu

Paste:

```bash
sudo apt update && sudo apt install -y ca-certificates curl jq
mkdir -p "$HOME/projects"
```

Keep the projects you want VARUA to see in `~/projects`.

## 4. Install VARUA

Paste into **Ubuntu**:

```bash
curl -fsSL https://downloads.varua.ca/varua-remote-control/install.sh | sh
```

This installs the Linux client and checks the downloaded file.

## 5. Connect your computer

Inside **Ubuntu**, run one command:

```bash
varua-rc
```

- Choose `~/projects` when asked for a folder.
- Keep **file changes** and **command execution** off unless you need them.
- Select **Link device**. Sign in to your VARUA account in the browser.
- Check that the codes match. Approve, then select **Start Remote Control**.

> Never approve a pairing request if the codes do not match.

## 6. Check that it works

Open https://app.varua.ca/dashboard and look under **Devices**. Your computer should say **Online**.

Keep Ubuntu and the VARUA terminal open while using Remote Control. Press **Ctrl+C** to stop.

## Need help?

- **Command not found?** In Ubuntu, run `export PATH="$HOME/.local/bin:$PATH"`, then try `varua-rc` again.
- **Ubuntu is using WSL1?** In PowerShell, run `wsl --list --verbose`. The Ubuntu row should show `2`.
- **Browser did not open?** Copy the pairing link from Ubuntu into your Windows browser.
- **Computer offline?** Open Ubuntu and start `varua-rc` again. Use the same VARUA account.

## Optional: manual or headless pairing

If Ubuntu cannot open the Windows browser, copy the pairing URL into your Windows browser instead. For advanced/manual pairing, generate a one-time pairing code in your VARUA dashboard, then run in **Ubuntu**:

```bash
varua-rc connect --headless --root "$HOME/projects"
```

Enter the code **only when prompted**, not in the command or shell history. Check and approve the pairing yourself.

## Optional: stronger WSL isolation

The default setup is enough to get started. WSL2 can access Windows files through its integrations. If this Ubuntu installation is **dedicated** to isolated Linux projects, you may choose to disable Windows drive automount, fstab startup mounts and Windows executable interop. **This will break access to Windows drives and commands from Ubuntu.** Keep your current integration if you use it.

First back up any existing `/etc/wsl.conf` and review its settings. In **Ubuntu**, use `sudoedit /etc/wsl.conf` and merge these sections without discarding unrelated settings you still need:

```ini
[automount]
enabled=false
mountFsTab=false

[interop]
enabled=false
appendWindowsPath=false
```

Then in **Windows PowerShell**:

```powershell
wsl --shutdown
```

Reopen Ubuntu and run a strict security check:

```bash
varua-rc doctor --strict
```

This stricter profile checks WSL integration and guest-local project roots. It does not make WSL an operating-system sandbox. If you intentionally retain host integrations, run `varua-rc doctor` to review your accepted settings; a strict isolation check may fail.

For help, visit https://varua.ca/support.
