What’s New in Windows 11?  

by | Dec 3, 2021 | Infrastructure

Windows 11 comes loaded with new features and a new look. We are going to explore in-depth some of the hidden gems that your power users and developers are going to love, including Windows Terminal and Windows Subsystem for Linux.   

The Windows Terminal App in Windows 11

Microsoft describes Windows Terminal as a modern terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and Windows Subsystem for Linux (WSL). Its main features include multiple tabs, panes, Unicode and UTF-8-character support, a GPU accelerated text rendering engine, and the ability to create your own themes and customize text, colors, backgrounds, and shortcuts.

Let’s customize the default opening app in Windows terminal:

Opening Windows 11 terminal defaults to Windows PowerShell, but that can be changed using settings.

I like to install the cross-platform PowerShell app from the Microsoft Store and make it the default terminal app.

Windows PowerShell 5.1 is built on top of the .NET Framework v4.5. With the release of PowerShell 6.0, PowerShell became an open-source project built on .NET Core 2.0. PowerShell 7.0 is built on .NET Core 3.1. And, with the release of PowerShell 7.2, PowerShell will be built on .NET 6.0. Moving from the .NET Framework to .NET Core allowed PowerShell to become a cross-platform solution. PowerShell runs on Windows, macOS, and Linux.  Differences between Windows PowerShell 5.1 and PowerShell 7.x – PowerShell | Microsoft Docs

Terminal automatically detects that we have installed the new PowerShell. 

Now we can make the new PowerShell the default app.  

Once you close and reopen the terminal, when clicking on the chevron, we see the new PowerShell is in bold, indicating it is the default app. 

You can also customize the settings of the Terminal app by editing the JSON file. However, there is no default app for editing the JSON file type. 

We can install Visual Studio Code from the Microsoft Store to make editing the JSON file easier. 

You should select Manage to allow Visual Studio Code to run in a trusted window. 

We can hide the old PowerShell terminal menu item by editing the powershell.exe section of the settings.json file – change value on the line “hidden”: from false to  true 

To rearrange the terminal menu order, move the PowerShell section to the top of the profiles list section. 

Original settings.json file:

“profiles”:

{

“defaults”: {},

“list”:

[

{

“commandline”: “powershell.exe”,

“guid”: “{61c54bbd-c2c6-5271-96e7-009a87ff44bf}”,

“hidden”: false,

“name”: “Windows PowerShell”

},

{

“commandline”: “cmd.exe”,

“guid”: “{0caa0dad-35be-5f56-a8ff-afceeeaa6101}”,

“hidden”: false,

“name”: “Command Prompt”

},

{

“guid”: “{b453ae62-4e3d-5e58-b989-0a998ec441b8}”,

“hidden”: false,

“name”: “Azure Cloud Shell”,

“source”: “Windows.Terminal.Azure”

},

{

“guid”: “{574e775e-4f2a-5b96-ac1e-a2962a402336}”,

“hidden”: false,

“name”: “PowerShell”,

“source”: “Windows.Terminal.PowershellCore”

}

Modified settings.json file:

“profiles”:

{

“defaults”: {},

“list”:

[

{

“guid”: “{574e775e-4f2a-5b96-ac1e-a2962a402336}”,

“hidden”: false,

“name”: “PowerShell”,

“source”: “Windows.Terminal.PowershellCore”

},

{

“commandline”: “powershell.exe”,

“guid”: “{61c54bbd-c2c6-5271-96e7-009a87ff44bf}”,

“hidden”: true,

“name”: “Windows PowerShell”

},

{

“commandline”: “cmd.exe”,

“guid”: “{0caa0dad-35be-5f56-a8ff-afceeeaa6101}”,

“hidden”: false,

“name”: “Command Prompt”

},

{

“guid”: “{b453ae62-4e3d-5e58-b989-0a998ec441b8}”,

“hidden”: false,

“name”: “Azure Cloud Shell”,

“source”: “Windows.Terminal.Azure”

}

Now PowerShell is the default ( bold text ) and is first on the list: 

More cool terminal features are available in the Windows Terminal preview 1.1. release, available from the Microsoft Store: 

You can now set the Windows Terminal stable build as your default terminal emulator if you’re on the Windows Insider Program Dev Channel or Windows 11! This means when you launch any command-line application, it will automatically launch inside Windows Terminal.  Windows Terminal Preview 1.12 Release – Windows Command Line (microsoft.com) 

 

Unfortunately, there is currently a bug that causes the default terminal application setting to be ignored.

After 22000.65 update, Console Host is always used instead of Terminal Preview (ignoring user’s choice). Even if I set Terminal Preview as the default terminal instead of conhost, it always opens everything (cmd, PowerShell, wsl2 etc.) in conhost.

Installing Visual C++ fixes the issue

@The-MAZZTer … We believe this was due to an accidental dependency on the CRT. Manually installing the C Runtime should fix this (until we roll out a hotfix build of the Terminal that doesn’t have this dependency anymore)

 

Before setting the default terminal application from Windows Console Host to Windows Terminal Preview, running cmd would open in conhost.exe.

After setting the default terminal application to Windows Terminal, running cmd, PowerShell, etc. opens in Windows terminal. 

The Windows 11 Subsystem for Linux (WSL)

The Windows Subsystem for Linux lets developers run a GNU/Linux environment — including most command-line tools, utilities, and applications — directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual boot setup. The Windows Subsystem for Linux on Windows 11 can be easily installed by command line or from the Microsoft Store. Linux graphical apps (WSLg) work straight out of the box without any 3rd party software.

You can install the Windows Subsystem for Linux from the terminal using the command:

Wsl –install

This will install the default distro “Ubuntu”

We must reboot the system before we can use WSL 

This is real Ubuntu from Canonical (the publisher of Ubuntu) running on Windows 11 subsystem for Linux  

You can also install WSL from the Microsoft Store

The Windows Subsystem for Linux (WSL) preview is now available in the Microsoft Store as a store application for Windows 11 machines! Installing WSL through the store will allow you to get the latest WSL updates and features faster, and without needing to modify your Windows version.

Traditionally, WSL has been installed as an optional component inside of Windows. This means that you would go to the “Turn Windows Features on or off” dialogue to enable it, requiring you to restart your machine. The actual binaries that make up WSL’s logic are optional components of the Windows image and are serviced and updated as part of Windows itself.

This change moves those binaries from being part of the Windows image, to instead being part of an application that you install from the Store. This decouples WSL from your Windows version, allowing you to update through the Microsoft Store instead. So now once new features like GUI app support, GPU compute, and Linux file system drive mounting are developed, tested and ready for a release you will get access to it right away on your machine without needing to update your entire Windows OS, or going to Windows Insider preview builds.

Other available Linux distributions can be viewed using the command wsl –list –online or in the Microsoft Store

PS C:\Users\Dan> wsl –list –online

The following is a list of valid distributions that can be installed:

Install using ‘wsl –install -d <Distro>’.

 

NAME            FRIENDLY NAME

Ubuntu          Ubuntu

Debian          Debian GNU/Linux

kali-linux      Kali Linux Rolling

openSUSE-42     openSUSE Leap 42

SLES-12         SUSE Linux Enterprise Server v12

Ubuntu-16.04    Ubuntu 16.04 LTS

Ubuntu-18.04    Ubuntu 18.04 LTS

Ubuntu-20.04    Ubuntu 20.04 LTS

 

Let’s install Debian using the command ‘wsl –install -d <Distro>’

PS C:\Users\Dan> wsl.exe –install Debian

Now we have Ubuntu and Debian distros installed 

Running Linux graphical apps on Windows 11

With WSL on Windows 11, we are no longer limited to running Windows programs.

We can also run Linux graphical programs!

Let’s install GIMP – “GNU Image Manipulation Program” on Ubuntu. The command to install GIMP is “sudo apt-get install -y gimp”

Now Windows notices that the Ubuntu, Debian and GIMP were installed and adds them to the Start Menu. Incredible! 

We can start GIMP from the Windows Start Menu. We can access the Windows file system by opening File System > mnt > C and select files to edit pictures using GIMP on Windows 11. How awesome is that! 

 

Windows 11 is an exciting new release that your users are going to love, especially administrators, power users and developers. 

Need more information? Email info@peters.com. We are happy to help.