# OpenXR Issues
Fix VR runtime and headset detection problems
OpenXR is the standard that connects Vrex to your VR headset. If Vrex doesn't detect your headset, the issue is usually with OpenXR configuration.

## Understanding OpenXR

OpenXR provides a common interface for VR applications. Your system needs:

1. **VR runtime** - Software for your headset (Oculus, SteamVR, etc.)
2. **Active runtime set** - Windows needs to know which runtime to use
3. **Headset connected** - Hardware properly connected and detected

## Common Issues

### "No VR headset detected"

**Cause:** OpenXR active runtime not set or wrong runtime selected.

**Solution:** Set the correct active runtime (see below).

### "OpenXR initialization failed"

**Cause:** VR runtime software not installed or corrupted.

**Solution:** Reinstall your headset's software package.

### Wrong headset detected

**Cause:** Multiple VR systems installed with wrong one active.

**Solution:** Set correct runtime as active.

## Setting the Active Runtime

### For Meta Quest (Link/Air Link)

The Oculus software should set this automatically. To verify:

1. Open **Oculus App** on PC
2. Go to **Settings** → **General**
3. Check **OpenXR Runtime** is set to Oculus

Manual registry check:

```powershell
Get-ItemProperty -Path "HKLM:\SOFTWARE\Khronos\OpenXR\1" -Name "ActiveRuntime"
```

Expected value: `C:\Program Files\Oculus\Support\oculus-runtime\oculus_openxr_64.json`

### For SteamVR (Vive, Index)

1. Open **SteamVR**
2. Go to **Settings** → **Developer**
3. Click **Set SteamVR as OpenXR Runtime**

Or run:

```powershell
& "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg.exe" setruntime
```

### For Windows Mixed Reality

1. Open **Mixed Reality Portal**
2. Go to **Settings** → **Set as active OpenXR runtime**

Registry value: `C:\WINDOWS\system32\MixedRealityRuntime.json`

## Checking Runtime Status

### View Current Active Runtime

```powershell
$runtime = Get-ItemProperty -Path "HKLM:\SOFTWARE\Khronos\OpenXR\1" -Name "ActiveRuntime" -ErrorAction SilentlyContinue
if ($runtime) {
    Write-Host "Active OpenXR Runtime: $($runtime.ActiveRuntime)"
} else {
    Write-Host "No OpenXR runtime configured"
}
```

### List Installed Runtimes

```powershell
Get-ItemProperty -Path "HKLM:\SOFTWARE\Khronos\OpenXR\1\AvailableRuntimes" | Format-List
```

## Troubleshooting Steps

### Step 1: Verify Headset Connection

- Ensure headset is connected (USB or Link)
- Check that headset software detects it
- Try different USB port (preferably USB 3.0)

### Step 2: Check Runtime Software

**For Meta Quest:**
- Open Oculus App
- Verify it sees your headset
- Update if needed

**For SteamVR:**
- Launch SteamVR
- Verify green status indicator
- Check for updates

### Step 3: Set Active Runtime

Use the appropriate method above to set your runtime as active.

### Step 4: Restart Services

After changing runtime:

1. Close Vrex
2. Close VR software
3. Reopen VR software
4. Reopen Vrex

### Step 5: Test in VR

With headset connected:
1. Launch Vrex
2. Open a project
3. Click **Enter VR** or similar option
4. Headset should activate

## Advanced: Manual Registry Fix

> **Warning:** Editing the registry incorrectly can cause system problems. Back up first.

If the active runtime is wrong:

```powershell
# Backup current value
reg export "HKLM\SOFTWARE\Khronos\OpenXR\1" C:\backup-openxr.reg

# Set Oculus as active (example)
reg add "HKLM\SOFTWARE\Khronos\OpenXR\1" /v "ActiveRuntime" /t REG_SZ /d "C:\Program Files\Oculus\Support\oculus-runtime\oculus_openxr_64.json" /f
```

Common runtime paths:

| Runtime | Path |
|---------|------|
| Oculus | `C:\Program Files\Oculus\Support\oculus-runtime\oculus_openxr_64.json` |
| SteamVR | `C:\Program Files (x86)\Steam\steamapps\common\SteamVR\steamxr_win64.json` |
| WMR | `C:\WINDOWS\system32\MixedRealityRuntime.json` |

## Multiple VR Systems

If you have both Oculus and SteamVR installed:

- Only one can be active at a time
- Switch using the respective software's settings
- Vrex uses whichever runtime is active

## When to Reinstall

Consider reinstalling VR software if:

- Runtime files are corrupted
- Registry entries are mangled
- Updates failed mid-installation

**Oculus reinstall:**
1. Uninstall Oculus App
2. Delete `C:\Program Files\Oculus`
3. Reinstall from oculus.com

**SteamVR reinstall:**
1. Uninstall via Steam
2. Delete `steamapps\common\SteamVR`
3. Reinstall via Steam

## Logs for Support

If issues persist, collect:

1. [Vrex logs](/v2/troubleshooting/logs/)
2. OpenXR diagnostic output
3. Screenshots of error messages
