Sunday, November 10, 2019

cmd.exe opens to a blank/black screen

Is your cmd.exe opening to a blank/black screen?    It works if you run-as administrator?  It works if you open PowerShell first, and then execute cmd.exe?     Yeah, that's where I have ended up on several various machines, including home and enterprise edition.     

In all my cases, the prompt is actually working as I tested it with .bat file and they ran, but screen still looks blank/black, implying hung process.  Nope, somehow the colors have gotten reset to black on black on black.   I certainly did not set these values on over a dozen different machines with the same problem.

Pick the top left of the blank/black cmd.exe screen, and select properties.  Then simply make sure your text, background, and are not all the same value.  In all my situations somehow Windows set them to RGB 0. 

I changed my background to a flavor of green for this quick fix, and now the problem is rather simply solved.

Apparently this was never really was an OS problem for my multiple machines, but I've seen dozens of forum posts from people all reverting to restores, and resets to fix when it was simply black-on-black text.   Still no idea why this has happened so many times, can't blame me on this one as my corporate enterprise Windows has had the same problem and I have no admin control of those systems to modify or install software.

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\