WSL (Linux on Windows)

Install WSL2 https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#3-download-ubuntu

Useful linux tools you may wish to install

apt -y install pigz atool lzop p7zip rar unrar lzip htop nmap nbtscan traceroute tofrodos hexedit ncdu tree expect fping rsync sshuttle pv colordiff pdftk rename pdftk

FAQ

https://learn.microsoft.com/en-us/windows/wsl/faq

Can I run WSL 2 in a virtual machine?

(from https://learn.microsoft.com/en-us/windows/wsl/faq#can-i-run-wsl-2-in-a-virtual-machine-)

Yes! You need to make sure that the virtual machine has nested virtualization enabled. This can be enabled in your parent Hyper-V host by running the following command in a PowerShell window with Administrator privileges:

Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true

Make sure to replace '<VMName>' with the name of your virtual machine.

How can I login as non-root user

adduser ndemou
# OPTIONAL but very usedful: add ndemou to sudoers without password
visudo #append:  ndemou   ALL=(ALL) NOPASSWD:  ALL
# set WSL to boot as ndemou
echo '[user]' > /etc/wsl.conf 
echo 'default=ndemou' > /etc/wsl.conf 
# exit WSL
exit

Restart WSL
# from admin PS terminate WSL
wsl --list; wsl --terminate Ubuntu-22.04

If you want to start WSL as root:
wsl --list; wsl --distribution Ubuntu-22.04 -u root
Topic revision: r2 - 10 Sep 2024, NickDemou
Copyright © enLogic