website

Personal Website

This project is maintained by NathanCastle

Redefining the Windows Desktop Experience… with Linux

Originally published on 02/28/2017

To most PC users, there is no distinction between the desktop environment and the OS itself. This simplicity, combined with the generally reliable Explorer desktop experience, goes a long way to explaining the success of the Windows desktop. Yet, some users yearn for more; when I talk to Linux desktop users, the #1 reason given is that the desktop is more configurable.

While reading about the Windows logon process, I was inspired; why not use the WinLogon extensibility interface (extensions being called “Credential Providers”) to flip the script and launch a Linux desktop instead of Explorer. Most Linux distros ship with a logon UI that allows selection of a preferred Desktop Environment (DE), so of course I wanted to enable that scenario as well.

Before I get into this, quick clarification about the title: Linux Desktop Environments have absolutely nothing to do with Linux, the kernel; they just happen to run on Linux-based systems most of the time. When I refer to Linux DEs, know that these are desktops that may or may not run on Linux; in this case they're running on Windows via the WSL.

To accomplish this task, I realized I’d need a few components:

Although Credential Providers are intended to enable new authentication scenarios (pin-based login and Windows Hello take advantage of this feature), they also serve as a convenient way to run code that interacts with the Logon UI. The Credential Provider does the following things:

Just changing some things in the registry isn’t enough. Now I needed to get code running immediately after logon to actually launch the DE of choice. WinLogon is configured with several settings in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon. The ones to note are:

Broken Abstraction Alert: UWP apps will not respond to changes in their frame size if Windows Explorer is not running and set as the Shell under WinLogon. The reason for this is unclear, but likely has something to do with why Edge tabs and the like are so buggy. Look forward to a future blog post.

The next part of my project is a small Windows program called ConfigurableShell.exe. ConfigurableShell takes the following action (it is called after Userinit.exe):

With these pieces, it is now possible to boot Windows directly into a Linux DE. Note the following components need to be installed:

Because there is so much that needs to be done for the installation, I created an installer to make things easy. Unfortunately, actually getting the Linux desktops running isn’t easy for a variety of reasons. To make things easy, I’ve put together the steps I took to get things running in a .sh script. This is approximately what I did, starting from scratch, so hopefully its useful.

Check it out on GitHub.