DEV Community

Cover image for WSL+UBUNTU
Anderson Gama
Anderson Gama

Posted on • Edited on

5 2

WSL+UBUNTU

#WSL+UBUNTU

Enable Virtual Machine Platform

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Enter fullscreen mode Exit fullscreen mode

Enable Windows Subsystem Linux

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enter fullscreen mode Exit fullscreen mode

Update Windows Subsystem Linux

Invoke-WebRequest -Uri https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile WSLUpdate.msi -UseBasicParsing
Enter fullscreen mode Exit fullscreen mode
msiexec.exe /package WSLUpdate.msi /quiet
Enter fullscreen mode Exit fullscreen mode

Set Default Version

wsl --set-default-version 2
Enter fullscreen mode Exit fullscreen mode

Download And Import Ubuntu 20.04

Create Folder For ROOTFS

mkdir -p $env:userprofile/Ubuntu/Focal/Ubuntu-20.04
Enter fullscreen mode Exit fullscreen mode

Download ROOTFS Image For WSL

Invoke-WebRequest -Uri https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-wsl.rootfs.tar.gz -OutFile $env:userprofile/Ubuntu/Focal/Ubuntu-20.04.tar.gz -UseBasicParsing
Enter fullscreen mode Exit fullscreen mode

Import ROOTFS Image For WSL

wsl --import Ubuntu-20.04 $env:userprofile/Ubuntu/Focal/Ubuntu-20.04 $env:userprofile/Ubuntu/Focal/Ubuntu-20.04.tar.gz
Enter fullscreen mode Exit fullscreen mode

List Distributions

wsl --list --all
Enter fullscreen mode Exit fullscreen mode

Set Default Distribution

wsl --setdefault Ubuntu-20.04
Enter fullscreen mode Exit fullscreen mode

List All Distributions And Version

wsl --list --all
Enter fullscreen mode Exit fullscreen mode

Run Distribution

wsl --distribution Ubuntu-20.04
Enter fullscreen mode Exit fullscreen mode

OR

wsl
Enter fullscreen mode Exit fullscreen mode

Sources:
https://docs.microsoft.com/pt-br/windows/wsl/install-win10
https://docs.microsoft.com/en-us/windows/wsl/install-manual
https://wiki.ubuntu.com/WSL

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay