Skip to content

Instantly share code, notes, and snippets.

@nikolasgd
Created January 7, 2021 00:41
Show Gist options
  • Save nikolasgd/d2e600f2aee98c3429a6c8e4e72200e7 to your computer and use it in GitHub Desktop.
Save nikolasgd/d2e600f2aee98c3429a6c8e4e72200e7 to your computer and use it in GitHub Desktop.
Open files from WSL2 with Chrome in Windows 10
#!/bin/bash
/mnt/c/Program\ Files/Google/Chrome/Application/chrome.exe '\\wsl$\Ubuntu-20.04/'"$1"''
# Save this script as /usr/local/bin/open and make it executable. Pass the file name as first argument.
@ayrtoneverton
Copy link

Just to try to help someone who simply wants to open any file that is saved in WSL through the browser, just use a URL like the one below through the browser:
file://wsl.localhost/Ubuntu/tmp/test-image.png

And you can also browse the file list by accessing: file://wsl.localhost/Ubuntu/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment