Windows Subsystem for Linux

warningwarning

Using MOOSE on Windows 10 and 11 is experimental and not fully supported.

Caveats:

  • Peacock does not work correctly (artifacts during rendering: surface normals are flipped).

  • Different flavors of Linux are available, but we STRONGLY urge the use of Ubuntu version 20.04.x LTS. Use other Linux flavors and versions at your peril if you are interested in using Peacock. Issues usually involve incompatible system-supplied OpenGL/mesa libraries when used with our Conda packages. Or, system packages that are required might be missing, yet we are unfamiliar with which ones to ask you to install.

Peacock prereqs (skip if not interested in Peacock)

warningwarning:Windows 11

Windows 11 users need not follow the VcXsrv instructions below. OpenGL is natively supported on Windows 11.

  • Install VcXsrv (Windows 10 only).

  • Install video card drivers applicative to your graphics card hardware (All versions of Windows).

Each time you reboot, or basically each time VcXsrv is not running, and you wish to use the graphical capabilities of MOOSE (Peacock), you should start VcXsrv before launching your WSL terminal.

When starting VcXsrv, options for the server can be adjusted. In general, the default options are adequate, except for the following:

  • Check "Disable access control". This allows the WSL instance to open windows via VcXsrv without requiring an authorization protocol.

Again, all other options for VcXsrv can remain the default.

schooltip:VcXsrv network connections

In some cases, the system firewall may block connections to the X window server. If errors or window rendering stalls are experienced after adopting the VcXsrv settings above, check to make sure that all network connections to VcXsrv are allowed.

Install WSL

commentnote

To use the simplified installation instructions outlined below, a recent build of Windows should be used (10 version 2004+ and build 19041+, or 11). For more information see Microsoft's information page on WSL.

Open PowerShell or Windows Command Prompt in administrator mode by right-clicking the application and selecting "Run as administrator". In the prompt that appears, one command can be used to install WSL version 2 dependencies and a default Linux distribution of Ubuntu 20.04 LTS.


wsl --install

Program output will appear showing installation and setup of dependencies before prompting the user for a restart to finish initial setup. See below for an example of the summary output.


C:\Users\USER>wsl --install
Installing: Virtual Machine Platform
Virtual Machine Platform has been installed.
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Downloading: WSL Kernel
Installing: WSL Kernel
WSL Kernel has been installed.
Downloading: Ubuntu
The requested operation is successful. Changes will not be effective until the system is rebooted.

Setup Linux and Enable GUI Dependencies

Once the restart is complete, a prompt will appear on next boot continuing the Ubuntu Linux installation and requesting a username for the new UNIX user account.


Installing, this may take a few minutes....
Please create a default UNIX user account. The username does not need to match your Windows
username. For more information visit: https://aka.ms/wslusers
Enter new UNIX username:

After entering a username and a new password, a standard Linux bash prompt will appear. An update should be performed to check for any out-of-date packages. To enable usage of Peacock, OpenGL libraries must also be installed (all versions of Windows).


sudo apt update
sudo apt upgrade
sudo apt install x11-apps libglu1-mesa libxcb-*

Configure WSL to connect to Windows GUI

Modify the bash profile to allow WSL to connect to the Windows GUI.


echo "export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0" >> ~/.bashrc
commentnote

The above sometimes needs to be run again after a Windows update. If you receive errors about the server not accepting connections, chances are it is this.

Close the WSL terminal

With the above complete, close the WSL terminal and re-open it. Proceed to follow (or return to) any of the Linux instructions on our Getting Started page.

Tips

  • Like WSL installation, the following sections require performing all commands in a PowerShell or Command Prompt in administrator mode!

  • Your Download's folder while using WSL is located at: /mnt/c/Users/<Your User Name>/Downloads

Updating the WSL Linux Kernel

The WSL linux kernel receives periodic updates. To perform these updates, one can run:


wsl --update

Change WSL Version

In this instruction set, WSL version 2 is used (and is the default, recommended release). If WSL version 1 is desired, this can be changed by performing the command:


wsl --set-version 1

The default for new Linux kernel instances can be set by performing the following:


wsl --set-default-version n

where n can be replaced by either 1 or 2, depending on the version desired.

Shutdown All WSL Instances

To shutdown all instances of WSL on the machine, perform the following:


wsl --shutdown

WSL can then be restarted from the Start menu.