Saturday, November 2, 2019

WSL installation workaround

Is the Windows Subsystem for Linux (WSL) on Windows 10 giving you some troubles during install?  Are you getting the black screen on shell startups?

Here is my hack-around the normal method which usually just involves adding the WSL feature, rebooting and then installing the Linux flavor from the Windows Store.  For me, this resulted in a black screen hang when launching Ubuntu on multiple PCs.   Or WSL would work for my full admin account but my standard user account would get the black screen hang; no one's suggestions on various forums actually seemed to help me.   Hopefully, someone else will find this solution useful.
  1. Change your user account from standard to admin type.  Remember that this is temporary, we will undo this later.  
  2. Following https://www.thomasmaurer.ch/2019/06/install-wsl-2-on-windows-10/  I then ran these from my account via PowerShell (run as administrator) 
    • Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    • Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
  3. A reboot (or two) might be needed before continuing.
  4. Then install the CanonicalGroupLimited.Ubuntu*.appx (or whatever name it happens to be this month) for Ubuntu downloaded from https://docs.microsoft.com/en-us/windows/wsl/install-manual.
  5. Now launch WSL and finish initializing your account in the WSL shell 
    • username = whatEverUwant, 
    • password = iSuggestSomethingUniqueFromYourActualWin10login)
  6. Now reboot again, and then login with your real admin account so we can undo step one.
  7. Switch your account back to standard type, as we no longer need to leave it elevated, nor should you.   It is no longer the year 2005 so your daily usage account should not be full admin.
  8. Now verify WSL shell still works after lowering account back to non-admin.
  9. Verify you can add a package such as: sudo apt-get install zip
  10. Enjoy the Linux prompts and get to bash'n Windows!
PS.  Your personal Linux home folder can be found from within Windows 10 by going to:
%APPDATA%\Local\Packages\CanonicalGroupLimited.Ubuntu*\LocalState\rootfs\home\

No comments:

Post a Comment