Skip to content
← Notes bash

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 call notepad.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 .exe extension must be included when calling Windows commands.

Troubleshooting

If interop does not work after enabling it:

  1. Make sure WSL is up to date:
wsl --update
  1. Verify that wsl.conf is properly formatted (no spaces around =).

  2. Fully restart WSL:

wsl --shutdown

References

  1. Microsoft documentation — WSL/Windows interoperability