WSL: Enable Windows interop to run Windows commands from WSL
WSL can execute Windows binaries (.exe) directly from a Linux terminal thanks to WSL/Windows interoperability. This feature is enabled by default but can be turned off.
Check if interop is enabled
cat /proc/sys/fs/binfmt_misc/WSLInterop
If the file exists and contains enabled, interop is active.
Enable interop
Via wsl.conf
Add or edit the /etc/wsl.conf file:
[interop]
enabled = true
appendWindowsPath = true
enabled: allows running Windows binaries from WSL.appendWindowsPath: appends Windows paths to the Linux$PATH, making it possible to callnotepad.exe,explorer.exe, etc. directly.
Then restart the WSL distribution from PowerShell:
wsl --shutdown
Temporarily (current session only)
sudo sh -c 'echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop'
Usage
Once interop is enabled, any Windows executable can be called:
# Open Notepad
notepad.exe
# Open File Explorer in the current directory
explorer.exe .
# Run a PowerShell command
powershell.exe -Command "Get-Process"
# Copy text to the Windows clipboard
echo "hello" | clip.exe
Note: The
.exeextension must be included when calling Windows commands.
Troubleshooting
If interop does not work after enabling it:
- Make sure WSL is up to date:
wsl --update
-
Verify that
wsl.confis properly formatted (no spaces around=). -
Fully restart WSL:
wsl --shutdown