WSL Reveal in File Explorer

A VS Code extension that seamlessly opens Windows File Explorer from WSL and Remote SSH connections, allowing you to reveal files and folders in the native Windows file manager with a simple right-click.
☕ Support
If this extension helps you, consider supporting the development:

Your support helps maintain and improve this extension!
🚀 Features
- Zero Configuration Required - Works out of the box with any WSL distribution
- Remote SSH Support - Also works with Remote SSH connections and mounted drives
- Custom File Explorer Support - Use your preferred file manager or stick with default Windows Explorer
- Context Menu Integration - Right-click any file or folder to reveal it in Windows Explorer or your custom choice
- Automatic WSL Detection - Dynamically detects your WSL distribution name
- Custom Distribution Support - Override auto-detection with your own distribution name
- Configurable Path Prefix - Customize network path prefix for different connection types
- Reliable Path Translation - Converts remote paths to Windows-compatible UNC paths
- Cross-Distribution Support - Works with Ubuntu, Debian, Alpine, and other WSL distributions
📋 Prerequisites
- Windows Subsystem for Linux (WSL) or WSL2, or Remote SSH connection
- Visual Studio Code running in WSL mode or connected to Remote SSH
- PowerShell available on Windows (included by default)
- For Remote SSH: Network drives or shares accessible from Windows
🌟 Show Your Support
If you find this extension useful:
Every star, review, and coffee means a lot and helps keep this project alive! 🚀
🎯 Usage
- Open VS Code in WSL - Make sure you're running VS Code in WSL mode
- Right-click any file or folder in the VS Code explorer panel
- Select "Reveal in File Explorer" from the context menu
- Windows File Explorer opens showing the selected file/folder location
That's it! No configuration needed by default.
🔧 How It Works
The extension automatically:
- Detects your WSL distribution name (or uses your custom configuration)
- Converts Linux paths to Windows UNC format (
\\wsl$\Distribution\path
)
- Uses PowerShell to reliably open Windows File Explorer
- Handles path escaping and special characters
⚙️ Configuration
Custom WSL Distribution Name
If automatic detection fails or you have a custom WSL distribution name, you can override it:
Via Settings UI:
- Open VS Code Settings (
Ctrl+,
)
- Search for "WSL Reveal Explorer"
- Set "Default Distribution Name" to your distribution name
Via settings.json:
{
"wsl-reveal-explorer.defaultDistributionName": "Ubuntu2"
}
Common examples:
Ubuntu2
- for secondary Ubuntu installations
Ubuntu-22.04
- for version-specific Ubuntu distributions
Debian
- for Debian distributions
kali-linux
- for Kali Linux distributions
Note: Leave this setting empty (default) to use automatic detection.
Custom Path Prefix for Remote SSH
For Remote SSH connections or custom network drives, you can configure a custom path prefix:
Via Settings UI:
- Open VS Code Settings (
Ctrl+,
)
- Search for "WSL Reveal Explorer"
- Set "Path Prefix" to your network path
Via settings.json:
{
"wsl-reveal-explorer.pathPrefix": "\\\\server\\share",
"wsl-reveal-explorer.defaultDistributionName": ""
}
Examples:
- WSL (default):
"\\\\wsl$"
- Standard WSL access
- Network Share:
"\\\\server\\share"
- Direct network share access
- Mapped Drive:
"\\\\192.168.1.100\\projects"
- IP-based network path
- SSHFS Mount:
"\\\\sshfs\\hostname"
- SSHFS mounted drives
Note: When using custom path prefixes, the distribution name is optional and can be left empty.
Custom File Explorer
Use your preferred file manager instead of the default Windows Explorer:
Via Settings UI:
- Open VS Code Settings (
Ctrl+,
)
- Search for "WSL Reveal Explorer"
- Set "Custom Command" to your preferred command
Via settings.json:
{
"wsl-reveal-explorer.customCommand": "explorer.exe {path}"
}
Available placeholders:
{path}
- The folder path to open
Examples:
- Total Commander:
"C:\\totalcmd\\TOTALCMD64.EXE /O /T {path}"
- FreeCommander:
"C:\\FreeCommander XE\\FreeCommander.exe /C /T {path}"
- Directory Opus:
"C:\\Program Files\\GPSoftware\\Directory Opus\\dopus.exe {path}"
- Q-Dir:
"C:\\Q-Dir\\Q-Dir.exe {path}"
Note: Leave this setting empty (default) to use Windows Explorer.
🛠️ Development
To contribute or modify this extension:
# Clone the repository
git clone <repository-url>
cd vscode-wsl-reveal-explorer
# Open in VS Code
code .
# Press F5 to run in Extension Development Host
# Test the functionality by right-clicking files in the explorer
🐛 Troubleshooting
If the extension doesn't work:
- Ensure you're running VS Code in WSL mode or Remote SSH (not Windows locally)
- Verify that PowerShell is available on your Windows system
- Check that Windows File Explorer can access your configured paths manually
- For WSL:
\\wsl$\<distribution>
- For Remote SSH: Your custom network path
Distribution Detection Issues
If the extension opens the wrong folder or fails to work:
Check your actual WSL distribution name:
# In WSL terminal, run:
wsl.exe -l -v
Set the correct distribution name manually:
- Use the exact name from the command above
- Go to VS Code Settings and search for "WSL Reveal Explorer"
- Set "Default Distribution Name" to the correct name (e.g.,
Ubuntu-22.04
, Ubuntu2
)
Common distribution name issues:
- Auto-detection might return
Ubuntu
but your distribution is Ubuntu2
- Version-specific names like
Ubuntu-20.04
vs Ubuntu-22.04
- Custom installation names
Remote SSH Issues
For Remote SSH connections:
Verify your network path configuration:
- Set the correct
pathPrefix
in settings
- Test the path manually in Windows File Explorer
Common Remote SSH scenarios:
- SSHFS mounts: Configure path like
\\\\sshfs\\hostname
- Network shares: Use
\\\\server\\share
format
- Direct IP access: Use
\\\\192.168.1.100\\path
format
Path mapping examples:
Remote path: /home/user/project
Windows path: \\server\share\home\user\project
Configuration: "pathPrefix": "\\\\server\\share"
File Explorer Issues
If your custom file explorer doesn't open:
- Verify the file explorer is installed and accessible from the configured path
- Check the custom command syntax - ensure it's a valid PowerShell command
- Test manually: Try running the command directly in PowerShell to debug issues
- Use default: Set the custom command to empty to fall back to Windows Explorer
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Feras Abdalrahman