I've always been intrigued by Microsoft's attempt to run Linux inside of windows. With WSL2, both windows and Linux are running as pears both underneath the hypervisor. I've had some fits and stops with trying go get WSL running. I found that you get the best success by installing WSL from the app store and then installing Ubuntu from the app store as well.
Here's some hints/tips that as I keep using, I'll update
If you get this after installing Ubuntu:
Then try this:
Open a powershell window, type wsl --unregister Ubuntu
Then launch Ubuntu from the Microsoft Store
Update the environment to stop prompting for the sudo password:
Type: sudo visudo
At the bottom of the file, enter: <userid> ALL=(ALL) NOPASSWD: ALL
Save
Install systemd
sudo nano /etc/wsl.conf
systemd=true
From a powershell window type: wsl --shutdown Ubuntu
Close the Ubuntu window and open another
From the powershell window you can start a new Ubuntu instance. Click on the down arrow and select Ubuntu
Here's some hints/tips that as I keep using, I'll update
If you get this after installing Ubuntu:
Code:
Failed to attach disk 'C:\Users\<User>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Then try this:
Open a powershell window, type wsl --unregister Ubuntu
Then launch Ubuntu from the Microsoft Store
Update the environment to stop prompting for the sudo password:
Type: sudo visudo
At the bottom of the file, enter: <userid> ALL=(ALL) NOPASSWD: ALL
Save
Install systemd
sudo nano /etc/wsl.conf
systemd=true
From a powershell window type: wsl --shutdown Ubuntu
Close the Ubuntu window and open another
From the powershell window you can start a new Ubuntu instance. Click on the down arrow and select Ubuntu