Ubuntu 22.04 LTS Inside Windows 11

Running Ubuntu 22.04 LTS on Windows 11 is a breeze.

First, install Windows Terminal and Ubuntu from the Microsoft store. Next, in Ubuntu, setup your .bash_aliases hacks and sudo apt installs. Finally, windows_98_tada.wav

Ubuntu WSL
Tip 1: Make sure the line endings in your .bash_aliases file are LF and not CRLF or you’ll get weird “not found” errors. Tip 2: cd-home is my alias to cd /mnt/c/Users/ME

If you’re like me, a developer who wants Ubuntu not Windows to be the main environment when working, create a /etc/wsl.conf file with:

[automount]
options = "metadata,umask=022,fmask=111,case=off"

This makes file permissions in /mnt/c behave like how you would expect in Linux. More info.

After this change all files in /mnt/c/Program Files/ and /mnt/c/Program Files (x86)/ requires the WSL terminal to be started as administrator to be able to modify permissions (aka chmod +x)  and it is not currently possible to change permissions in /mnt/c/Windows/

To make Git in Windows more compatible with your workflow (not Git in Ubuntu leave it alone) add this to your .gitconfig

[core]
autocrlf = false
fileMode = false

More in depth info available here.

One thought on “Ubuntu 22.04 LTS Inside Windows 11”

  1. My idea was to store and work on my code in the Windows filesystem. While working I found out that WSL2 has bad performance across OS file systems. It was too slow.

    I have decided that if a project is meant to be using cli tools from Ubuntu, I will put it in /home, not /mnt/c. I’ve changed my /etc/wsl.conf to:

    options = "metadata,case=off"

    (leaving Windows filesystem fluorescent green chmod 777 directory lists alone for now…)

Leave a Reply

Your email address will not be published.