Created
April 26, 2024 12:45
-
-
Save t04glovern/a4344cd2d9e6880b39241c8df4cd4944 to your computer and use it in GitHub Desktop.
Create Ubuntu-24.04 WSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create scratch location | |
cd | |
mkdir wsl-ubuntu-24.04 | |
# Download WSL image | |
wget ` | |
https://cloud-images.ubuntu.com/wsl/noble/current/ubuntu-noble-wsl-amd64-24.04lts.rootfs.tar.gz ` | |
-O ubuntu-noble-wsl-amd64-24.04lts.rootfs.tar.gz | |
# Import image to new WSL VM | |
wsl --import Ubuntu-24.04 .\wsl-ubuntu-24.04\ .\ubuntu-noble-wsl-amd64-wsl.rootfs.tar.gz | |
# Start WSL (root user) | |
wsl -d Ubuntu-24.04 | |
# Create new user | |
$ sudo apt update && sudo apt install -y sudo | |
$ myUsername=nathan # Change your name | |
$ sudo adduser --ingroup sudo $myUsername | |
$ echo -e "[user]\ndefault=$myUsername" >> /etc/wsl.conf | |
# Restart WSL | |
wsl --terminate Ubuntu-24.04 | |
wsl -d Ubuntu-24.04 | |
wsl --set-default Ubuntu-24.04 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment