X11 on Windows

I have several Linux devices at home for testing and I like to have the ability to log in via ssh with forwarding to allow me the ability to start X11 programs and have them appear on my local workstation.

In the past I’ve used an install of Cygwin X11 to handle this need but that is problematic — every time I reinstall Windows (and I do often as an Insider) I have to go through the install and change permissions to get things to work.

During this most recent install of Windows I decided to try something different.  I downloaded Xming (and the fonts packages) as a small and easy X11 server.  I then just used Putty to connect to my Linux boxes.

Then it hit me: Win10 now has the Bash on Ubuntu on Windows subsystem.  This is a fully-functional version of Ubuntu’s userspace system which includes a full Bash shell and SSH client!

I made a few changes to the .bashrc for personal preference:

# color definitions

if [ "$color_prompt" = yes ]; then
    PS1="\n${red}${debian_chroot:+($debian_chroot) }${green}\u@desktop${nocolor} \W\n\D{%I:%M%P} [\#] >> "q
    PS1="\n${debian_chroot:+($debian_chroot) }\u@desktop \W\n\D{%I:%M%P} [\#] >> "

# aliases
alias ll='ls -Flash'
alias la='ls -A'
alias l='ls -CF'
alias xt='xterm -bg black -fg PeachPuff -fn 8x13 &'

# change the directory sort (hidden before visible)
export LC_COLLATE="C"

# set the display for X11 forwarding
export DISPLAY=""

I change the color of the desktop\user area depending on the server to make it obvious which machine I’m accessing.

Adblock: Taboola

Taboola ads are among the worst online; they format the ads to look like additional content on the websites making it easy to trick the users to click an ad when they think they are viewing another story.  I can’t stand deceptive practices like this so I block them completely using the following rules:


UWP: Phone status bar issue in Insider builds

Recent Insider builds seem to have a problem with the status bar on UWP programs that I’ve written and deployed via Visual Studio.  The status bar appears with white text and white background (I use the Dark theme).  I’ve found the following fix for it.

  1. Add a reference to Windows Mobile Extensions for UWP in Universal Windows Extensions.  I use version 10240 for backwards compatibility but I could easily use the 10586 version since I always run Insider builds on my phone.
  2. Add the following code to the bottom of the OnLaunched event:
 if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
 var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
 statusBar.BackgroundColor = Windows.UI.Colors.Black;
 statusBar.BackgroundOpacity = 1;

This forces the background to black which correctly displays the white status text and icons.  Also note that there is the ability to hide the status bar but I don’t use that.  Of course, if you are using the Light theme this change would probably break it in the reverse manner.  But since I use Dark and the programs I’ve written are only for personal use this fix works for me.


Insider builds issue: Microsoft account needs attention

When reloading my computer yesterday I was unable to get any Insider builds to install.  All I saw was a “Your Microsoft account needs attention” with a FixMe button.  Clicking on that button restarts the computer but it doesn’t fix the problem.  You’ll see the same problem and FixMe button when you log back in.

The solution was to:

  1. Opt out of Insider builds completely (reboot)
  2. Delete the following registry keys in HKEY_Current_User > Software > Microsoft > WindowsSelfHost > Applicability
    1. Error State
    2. PilotInfoRing
    3. LastHR
  3. Reboot and sign up for Insider builds again.  It’ll ask you to sign into your Microsoft Account and then you’ll be able to sign up for builds again.

Note: after doing this it took about 12 hours for the first build to show up.

Thanks to @NorthFaceHiker for this tip!



Web z-index fixes

I’ve noticed an annoying trend where web developers are using z-index to place their header above every other element on the page.  When the window is made smaller this header often covers other more-important elements (like media players).

I’ve started using Stylish to fix these problems:

Di.fm (di.fm): #main-header { z-index: 0; }
Groove (https://music.microsoft.com): #player { z-index: 5;} #header { z-index: 0; }


Chrome: missing context menus

I’ve been having a problem with Google Chrome for quite some time, bad enough that I had switched back to Firefox until Edge is more mature.  The problem is that context menus on extensions and profile switching do not always work.  Also the sign in button on the Settings page for setting up synchronization doesn’t do anything.

I finally found this bug report: Issue 516291 – Dropdowns not drawn/drawn incorrectly

This bug appears to happen only on computers with multiple monitors.  When the Chrome window is on the primary monitor the dialogs work correctly but they fail to appear at all on secondary monitors.

Disabling hardware acceleration in the Advanced Settings does fix the problem for me.  It’s a workaround only but given the fact that this bug was reported in Aug 2015 and it still has not been fixed, it’s a workaround we have to use to get this browser working properly on multi-monitor computers.

Getting Windows build number

Normally you can just use “winver” (or “ver” in command prompt) to get the version number but it doesn’t always return the build number.

You can find the build number in the registry; use the following command in cmd:

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr BuildLabEx

Windows ISO version checking

If you want to see which version of Windows is contained in an ISO image, mount the image and run the following command in an elevated cmd/powershell window:

dism /Get-WimInfo /WimFile:A:sourcesboot.wim

Be sure to change A: to the correct drive letter where the image is mounted.  Also, combined x86/x64 ISO images will need to include the architecture before “sources”.

dism /Get-WimInfo /WimFile:A:x86sourcesboot.wim
dism /Get-WimInfo /WimFile:A:x64sourcesboot.wim