# WSL2 Access Instructions ## Issue When running Vite dev server in WSL2, `localhost` from Windows browser may not connect. ## Solutions ### Option 1: Use WSL IP Address (Recommended) 1. Find your WSL IP address: ```bash hostname -I # or ip addr show eth0 | grep "inet " ``` 2. Access the server using the WSL IP: ``` http://:5173 ``` Example: `http://172.20.10.2:5173` ### Option 2: Use localhost with Port Forwarding Windows automatically forwards `localhost` to WSL, but sometimes you need to: 1. In Windows PowerShell (as Administrator): ```powershell netsh interface portproxy add v4tov4 listenport=5173 listenaddress=0.0.0.0 connectport=5173 connectaddress= ``` 2. Then access: `http://localhost:5173` ### Option 3: Use Windows Hostname Try accessing via Windows hostname: ``` http://$(hostname).local:5173 ``` ### Option 4: Check Windows Firewall If still not working, check Windows Firewall: 1. Windows Defender Firewall → Advanced Settings 2. Inbound Rules → New Rule 3. Allow port 5173 ## Current Configuration The Vite server is configured with: - `host: '0.0.0.0'` - Allows external connections - `port: 5173` - Standard Vite port ## Quick Test Test if server is accessible: ```bash # From WSL curl http://localhost:5173 # From Windows PowerShell curl http://localhost:5173 ``` ## Alternative: Use Windows Terminal If you're using Windows Terminal, you can right-click the tab and select "Open in new tab" to open the URL directly.