# VS Code Live Share Failed
You try to start a Live Share session, but the link never generates, or guests can't connect despite having the link. Authentication fails repeatedly, or the session disconnects mid-collaboration. Live Share is VS Code's real-time collaboration feature, and when it breaks, team productivity suffers.
Understanding Live Share Architecture
Live Share uses:
- A hosted service for session coordination
- WebSocket connections for real-time communication
- Authentication via Microsoft/GitHub account
- Local relay server for file sharing
Any component failing causes connection problems.
Step 1: Check Authentication Status
Live Share requires authentication:
- 1.Verify sign-in:
- 2.Status bar → Live Share icon
- 3.Should show your username if signed in
- 4.If not, click and select "Sign In"
- 1.Force re-authentication:
- 2.
Ctrl+Shift+P - 3."Live Share: Sign Out"
- 4.Then "Live Share: Sign In"
Browser authentication: If sign-in prompts don't work: - Live Share opens a browser for authentication - Complete the flow in browser - Return to VS Code
Step 2: Check Network Connectivity
Live Share needs internet access:
Test connectivity: ```bash # Test Live Share service curl -I https://prod.liveshare.vsengsaas.visualstudio.com
# Test WebSocket (browser test) # Open browser console and test WebSocket connection ```
Check firewall: Live Share uses these ports: - HTTPS (443) for service communication - Dynamic ports for peer connections
Allow VS Code through firewall: - Windows: Windows Firewall → Allow Code.exe - macOS: System Preferences → Security → Firewall → Allow VS Code
Proxy configuration:
``json
{
"liveshare.proxy.enabled": true,
"liveshare.proxy.address": "http://proxy.company.com:8080"
}
Step 3: Fix Session Start Failures
If "Start Collaboration Session" doesn't generate a link:
- 1.Check Live Share status:
- 2.Output panel → "Live Share" dropdown
- 3.Look for error messages
Common errors:
``
[error] Failed to start collaboration session
[error] Authentication required
[error] Cannot connect to Live Share service
Reinstall Live Share:
``bash
code --uninstall-extension ms-vsliveshare.vsliveshare
# Restart VS Code
code --install-extension ms-vsliveshare.vsliveshare
Clear Live Share cache:
``bash
rm -rf ~/.liveshare # macOS/Linux
rmdir /s "%USERPROFILE%\.liveshare" # Windows
Step 4: Fix Guest Connection Issues
Guests can't join even with valid link:
Verify link format:
Links should look like:
``
https://prod.liveshare.vsengsaas.visualstudio.com/join?...
Guest prerequisites: - VS Code installed - Live Share extension installed - Signed in (optional but recommended)
- 1.Test guest connection:
- 2.Guest opens VS Code
- 3.
Ctrl+Shift+P→ "Live Share: Join Collaboration Session" - 4.Paste link
- 5.Should see authentication prompt if not signed in
Step 5: Handle Corporate Network Issues
Enterprise environments often block Live Share:
Check corporate proxy:
Many companies require proxy authentication:
``json
{
"liveshare.proxy.enabled": true,
"http.proxy": "http://proxy.company.com:8080",
"http.proxyStrictSSL": false
}
Enable alternate connection:
``json
{
"liveshare.allowGuestDebugging": true,
"liveshare.allowGuestTaskExecution": true,
"liveshare.connectionMode": "relay" // or "direct"
}
Contact IT: If blocked, request: - Allow prod.liveshare.vsengsaas.visualstudio.com - Allow WebSocket connections - Allow VS Code outbound HTTPS
Step 6: Fix Session Disconnects
Sessions disconnecting mid-use:
Check auto-disconnect settings:
``json
{
"liveshare.timeout": 3600000 // 1 hour in ms
}
Activity keepalive: Live Share disconnects inactive sessions. Regular editing prevents this.
Network stability:
Test network for intermittent issues:
``bash
ping -t prod.liveshare.vsengsaas.visualstudio.com # Windows
ping prod.liveshare.vsengsaas.visualstudio.com # macOS/Linux
Step 7: Handle File Access Issues
Guests can't see certain files:
Check workspace sharing: Host controls what's shared: - All workspace files (default) - Specific folders only
Configure sharing:
``json
{
"liveshare.shareExternalFiles": true,
"liveshare.files.allowGuestFileRootAccess": false
}
Guest file visibility:
Guests see what host shares. Host can exclude:
``json
{
"files.exclude": {
"**/.env": true,
"**/secrets.json": true
}
}
Step 8: Debug with Live Share Logs
Enable detailed logging:
{
"liveshare.trace.loggingLevel": "verbose",
"liveshare.trace.logToOutput": true
}Then check Output → "Live Share" for detailed connection information.
Verification
Test Live Share works:
- 1.Host: Start Collaboration Session
- 2.Wait for link generation (status bar shows link)
- 3.Copy link
- 4.Guest: Join Collaboration Session (paste link)
- 5.Guest should see host's workspace
- 6.Both edit same file - changes appear real-time
- 7.Host terminal shows to guest (if shared)
- 8.Session remains connected without disconnecting
Quick Reference
| Problem | Cause | Solution |
|---|---|---|
| No link generated | Auth or network | Re-sign in, check connectivity |
| Guest can't join | Extension missing | Install Live Share extension |
| Connection blocked | Firewall/proxy | Allow ports, configure proxy |
| Session disconnects | Network or timeout | Fix network, increase timeout |
| Files not visible | Sharing settings | Host includes/excludes properly |
Live Share issues usually stem from authentication or network connectivity. Start with sign-in, then check network and firewall settings.