How to install Windows Subsystem for Linux (BashOnWindows) offline on Windows


  1. Fiddler
  2. HTTP Web server (Apache/Nginx/Any other)


How To:

  1. First enable Windows Subsystem for Linux from “Program and Features” -> “Turn Windows features on or off”
  2. Restart Windows (MS has a thing for rebooting)
  3. Download one of the image and host it on your local web server if not done already
  4. Start Fiddler and enable “Automatic Breakpoints” (Alt+F11)
  5. Start command prompt and run “lxrun /install /y”
  6. Switch to Fiddler. You will see a request to “”. Click on “Headers” tab -> Right click on “Location” -> “Edit Header” -> Paste your local link URL (i.e. http://localhost/xenial-server-cloudimg-amd64-root.tar.gz) and click on Save -> Run to Completion
  7. There will be another request to “http://localhost/xenial-server-cloudimg-amd64-root.tar.gz”.  Just click on “Run to completion” this time.
  8. After some time, there will again another request to download “ubuntu.ico”. Just allow it.
  9. Create a new user and you are ready to go!

Note for Ubuntu 16.04 users:

There is an issue with “sudo” command in Ubuntu 16.04 build. You will get sudo: no tty present and no askpass program specified. There are two simple possible solutions that I am aware of to fix it.

  • Use “sudo -S” each time. Execute echo $'\n'"alias sudo='sudo -S'" >> ~/.bashrc to create a permanent alias for it
  • Set the default user as root. Execute “LxRun.exe  /setdefaultuser root” in command prompt to do that
Share this Story:
  • facebook
  • twitter
  • gplus
  • Domain

    Step 6, I see a request to “”, and fail, becouse no internet connection, what should I do?

  • Lyndon1115

    Thx,the microsoft download service is bullshit, I wonder its ms’s intention to refuse people to use WSL.

  • nim rod

    glad i came across this instruction,
    thank you very much,
    it actually took me days just to install bash(linux) on my windows 10. thank you for saving me

  • Aslan

    What means “host it on your local web server”, how it happens?
    And where is [Headers] and where is [Location] in Fiddler?

  • Carsten

    Perhaps you can enlighten us in which headers tab and location.
    Using Telerik Fiddler 4.6.20171.14978 I can see 2 header tabs (request and response), but no location.

  • Nobody

    You do not need a local web server. Fiddler allows you to use local files.

  • Fakhreddin

    I couldn’t follow your instruction.
    like Domain comment above, I had the similar problem in step 6
    would you please any suggest?

  • Kagurazaka Bokutake

    So Useful ! My Problem Solved ! Thanks ! (I’m From China