# Setup a Windows 11 PC as a Living Room PC with emphasis on gaming

##  Setup PC

### Install Windows 11

Install Windows 11, preferably using an ISO generated from Chris Titus Tech's Winutil. This will ensure a stable system without the bloatware that Microsoft tries to install. And will setup a local account with a password not connected to Microsoft.

You can download Winutil from [here](https://github.com/ChrisTitusTech/winutil/releases).

You can link your Windows local account to your Microsoft account after installation if you need it.

Make sure to install the latest drivers for your GPU, NIC, and other hardware.

### Setup Autologin

There are several methods to enable automatic login in Windows 11. Choose the method that works best for your setup:

#### Method 1: Using netplwiz (Recommended)
1. Press Windows key + R to open Run
2. Type `netplwiz` and press Enter
3. Uncheck "Users must enter a username and password to use this computer"
4. Click Apply
5. Enter your username and password in the popup dialog
6. Click OK to save

#### Method 2: Using Registry Editor
If you prefer using a script, you can modify the registry directly:

```powershell
# Change LocalAccount to your local account name
# Change LocalAccountPassword to your password
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d "LocalAccount" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d "LocalAccountPassword" /f
```

#### Method 3: Using Windows Settings
1. Open Windows Settings
2. Go to Accounts > Sign-in options
3. Under "Additional settings", turn off "Windows Hello sign-in for Microsoft accounts"
4. Enter your password when prompted
5. Follow Method 1 or 2 to complete the setup

**Important Security Considerations:**
- Only enable autologin on private, secure networks
- Consider using a local account instead of a Microsoft account
- Anyone with physical access to your PC will be able to use it
- If using a Microsoft account, you may need to re-enable this after major Windows updates

**Note:** If you used Chris Titus Tech's Winutil ISO, autologin may already be configured with your local account.

### Disable Game Bar

There are several ways to disable the Xbox Game Bar to prevent it from interfering with Steam and other gaming functions:

#### Method 1: Via Windows Settings (Windows 11)
1. Open Windows Settings
2. Go to System > System components > Game Bar
3. Click "..." next to Game Bar and select "Advanced options"
4. Under Background apps permissions, select "Never"
5. Click "Terminate" to stop the game bar app
6. Under Gaming settings, toggle off "Allow your controller to open Game Bar"

#### Method 2: Via Windows Settings (Windows 10)
1. Press Windows + I to open Settings
2. Go to Gaming > Xbox Game Bar
3. Toggle off "Enable Xbox Game Bar"
4. Toggle off "Open Xbox Game Bar using this button on a controller"

#### Method 3: Complete Removal (PowerShell)
To permanently remove Xbox Game Bar:
```powershell
Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage
```

**Note:** If you need to reinstall Xbox Game Bar later, you can download it from the Microsoft Store.

**Important:** Disabling Game Bar is recommended for a living room PC setup as it:
- Prevents conflicts with Steam's overlay
- Stops unwanted popups when using controllers
- Reduces background processes
- Avoids recording conflicts with other capture software

### Install Steam and Configure Big Picture Mode

Steam needs to be configured to provide a console-like experience on startup:

#### Basic Setup
1. Install Steam from https://store.steampowered.com/
2. Create or log into your Steam account
3. Go to Steam Settings > Interface
4. Enable both:
   - "Run Steam when my computer starts"
   - "Start Steam in Big Picture Mode"

#### Optimize for Gaming
- Disable unnecessary startup programs through Task Manager (Winutil will do this for you)
- Configure Steam to launch your most-played games automatically
- Consider using Steam's controller configurations for non-Steam games

**Important Notes:**
- Steam Big Picture Mode provides a TV-friendly interface optimized for controller use
- All your games can be launched without needing a keyboard/mouse
- The interface can be customized with different themes and layouts
- Controller configurations can be saved and shared with the Steam community

**Tip:** Test the full boot sequence once configured:
1. Restart your PC
2. It should auto-login
3. Steam should auto-start
4. Big Picture Mode should launch automatically

### Wireless Adapter for Xbox Controller
Bluetooth connections can have issues if you plan on using a controller ONLY with your living room PC.  Windows Updates can take bluetooth out of commission, and if you want to wake the PC with the controller most Bluetooth adapters do not support this.

If you use an xbox controller, you will likely need a Xbox Wireless Adapter Compatible with Xbox One S/X/Series X/S Controller. It plugs into the USB port of your PCand the controller will connect to it using wifi instead of bluetooth. Becareful, some adapters just use bluetooth. Make sure it supports wifi.
The one I am using https://amazon.com/dp/B08CY14VGD

Some controllers that come included with a wireless adapter.
Razor Wolverine V3 https://amazon.com/dp/B0DB6S6R89
8Bitdo Ultimate 2.4G Wireless Controller https://amazon.com/dp/B00TY8UR2K

### HDMI CEC Setup for PC Gaming

When using an Xbox Wireless Adapter, the goal is to create a seamless gaming experience where you can:
1. Wake the PC from sleep using just the controller
2. Have a TV and AV receiver turn on automatically
3. Have everything switch to the correct input

Key components needed:
- Pulse-Eight HDMI CEC USB Adapter https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter
- LibCEC software installed from https://github.com/Pulse-Eight/libcec/releases
- Windows Task Scheduler to handle wake events

**Important Notes:**
- No current consumer GPUs (NVIDIA, AMD, or Intel) support HDMI CEC natively
- The HDMI CEC adapter may affect display refresh rates
- The adapter sits between your PC and AV receiver/TV

#### Setup Process:
1. Install LibCEC
2. Connect the HDMI CEC adapter
3. Configure Windows Task Scheduler to handle wake events
4. Test the wake-from-sleep functionality with your controller

For testing and debugging CEC commands, you can use: https://www.cec-o-matic.com/
https://karlquinsland.com/pulse-eight-hdmi-cec-injector-teardown/
### Use Controller as Mouse Input

There are two popular options for using your controller as a mouse:

#### Option 1: Gopher360 (Free, Simple Setup)
1. Download Gopher360 from [GitHub](https://github.com/Tylemagne/Gopher360/releases)
2. Extract and run Gopher.exe
3. Default controls:
   - Left analog stick: Mouse movement
   - A button: Left click
   - X button: Right click
   - B button: Enter
   - Right analog stick: Scroll wheel
   - D-pad: Alternative scrolling
   - Start button: Windows key
   - Left stick click: Middle mouse button

To make Gopher360 start automatically:
1. Press Windows + R
2. Type `shell:startup`
3. Copy Gopher.exe to this folder

#### Option 2: AntiMicro (More Customizable)
1. Download and install AntiMicro
2. Connect your controller via USB or wireless adapter
3. Basic setup:
   - Click "All stick" in AntiMicro
   - Set left stick to "Mouse normal"
   - Configure L shoulder for left mouse click
   - Configure R shoulder for right mouse click
4. Adjust mouse sensitivity and other settings as needed
5. Save your configuration profile

**Tips:**
- Test different sensitivity settings to find what works best for your TV setup
- You can create different profiles for different games or applications
- Consider mapping additional buttons for keyboard shortcuts
- Both tools work with most Xbox and compatible controllers

**Note:** For a living room setup, Gopher360 is often the simpler choice as it's preconfigured for common use cases and starts up quickly.

## Optional Setup

### Install bginfo
bginfo is a tool that allows you to display information on your desktop.  It can be useful for a living room PC setup.
``` powershell
winget install Microsoft.Sysinternals.BGInfo
```
Auto run bginfo at startup.
``` powershell
$bginfoPath = "C:\Program Files\Sysinternals\BGInfo.exe"
$startupPath = "C:\Users\Public\Desktop\BGInfo.lnk"

# Create a shortcut to BGInfo
$wsh = New-Object -ComObject WScript.Shell
$shortcut = $wsh.CreateShortcut($startupPath)
$shortcut.TargetPath = $bginfoPath
$shortcut.Save()
```


### Install OpenSSH Server
There may come a time where you need to access your PC remotely.  This will allow you to do so.
This will give you a command prompt to access your PC remotely. 
```powershell
# Check if OpenSSH is already installed
if (-not (Get-WindowsCapability -Online -Name 'OpenSSH.Client~~~~0.0.1.0')) {
    # Install OpenSSH Client
    Add-WindowsCapability -Online -Name 'OpenSSH.Client~~~~0.0.1.0'
} else {
    Write-Host "OpenSSH Client is already installed."
}

if (-not (Get-WindowsCapability -Online -Name 'OpenSSH.Server~~~~0.0.1.0')) {
    # Install OpenSSH Server
    Add-WindowsCapability -Online -Name 'OpenSSH.Server~~~~0.0.1.0'
} else {
    Write-Host "OpenSSH Server is already installed."
}

#Start the OpenSSH SSH Server service and set it to automatic startup.
if((Get-Service sshd).Status -ne "Running"){
    Start-Service sshd
    Set-Service sshd -StartupType Automatic
    Write-Host "OpenSSH SSH Server service started and set to automatic startup."
} else {
    Write-Host "OpenSSH SSH Server service is already running."
}

#Configure the Windows Firewall to allow SSH connections.
if (-not (Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) {
    New-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -DisplayName "OpenSSH Server (TCP)" -Enabled True -Direction Inbound -Protocol TCP -LocalPort 22 -Action Allow
    Write-Host "Firewall rule created for OpenSSH."
} else {
    Write-Host "Firewall rule for OpenSSH already exists."
}

#Optional: you can check the status of the service using get-service sshd.
Get-Service sshd

#Optional: Verify the installation by checking the OpenSSH version.
ssh -V
```

You can now connect to your PC remotely using ssh.
``` powershell
ssh username@your-pc-ip-address
```

### Text Editors
When working with text files remotely, you'll need a text editor. While traditional CLI editors like vim and nano are powerful, they can be challenging for users not familiar with command-line interfaces. Here are your options:

#### Microsoft Edit (Recommended for Most Users)
Microsoft Edit is a modern, user-friendly text editor that provides a familiar Windows interface. It's perfect for users who:
- Are more comfortable with GUI applications
- Don't have extensive CLI experience
- Need a simple, straightforward editing experience

Install Microsoft Edit:
```powershell
winget install Microsoft.Edit
```

#### Alternative CLI Editors
For users who prefer command-line editors:

1. **vim** (via Chocolatey):
```powershell
choco install vim
```

2. **nano** (via Chocolatey):
```powershell
choco install nano
```

**Note:** While vim and nano are excellent choices for experienced users, Microsoft Edit was chosen as the default editor in this setup because it provides the most accessible experience for users who may not be familiar with command-line interfaces. This aligns with the goal of making the living room PC setup as user-friendly as possible.

You can install applications like btop kill process, etc.
```powershell
winget install Microsoft.VCRedist.2015+.x86
winget install btop4win
```

## References
https://youtu.be/xpki1IcjinU?si=GbyGOj6mM51C243L
https://www.youtube.com/watch?v=suwjpXqNeTs
https://github.com/Tylemagne/Gopher360
