Howto wsl windows: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
No edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= installation =
open powershell as administrator and restart the computer when asked:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all
when computer start open powershell again as administration then execute the following commands:
wsl --update
wsl --shutdown
download and install kernel update:
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
set wsl version 2 as default:
wsl --set-default-version 2
install hyper-v componets for windows:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
to enable hyper-v manager:
Add-WindowsFeature rsat-Hyper-V-tools
= commands =
list of available wsl distros to install:
list of available wsl distros to install:
  wsl --list -o
  wsl --list -o
Line 11: Line 28:
list distro name and version:
list distro name and version:
  wsl -l -v
  wsl -l -v
restart wsl:
restart wsl, this will shutdown all distros:
  wsl --shutdown
  wsl --shutdown
create a backup of the wsl distro:
create a backup of the wsl distro:
Line 25: Line 42:
to check wsl status:
to check wsl status:
  wsl --status
  wsl --status
view the linux files in windows file explorer:
explorer.exe .
set specific distro as default:
wsl -s kali-linux
wsl --set-default kali-linux
to change the default user for a distribution:
kali-linux config --default-user username
= references =
* https://learn.microsoft.com/en-us/windows/wsl/basic-commands

Latest revision as of 14:51, 2 February 2023

installation

open powershell as administrator and restart the computer when asked:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all 

when computer start open powershell again as administration then execute the following commands:

wsl --update
wsl --shutdown

download and install kernel update:

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

set wsl version 2 as default:

wsl --set-default-version 2

install hyper-v componets for windows:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

to enable hyper-v manager:

Add-WindowsFeature rsat-Hyper-V-tools

commands

list of available wsl distros to install:

wsl --list -o

install specific distro:

wsl --install -d kali-linux

update the wsl kernel:

wsl --update

set windows subsystem for linux 2 your default architecture for new distros:

wsl --set-default-version 2

convert the distro from wsl to wsl 2:

wsl --set-version kali-linux 2

list distro name and version:

wsl -l -v

restart wsl, this will shutdown all distros:

wsl --shutdown

create a backup of the wsl distro:

wsl --export kali-linux kali-linux-backup.tar

restore from backup:

wsl --import kali-linux C:\Users\USERNAME\Distros C:\kali-linux-backup.tar

if you want to uninstall linux distro:

wsl --unregister kali-linux

launch installed the distro:

wsl --distribution kali-linux

terminate or stop a wsl instance:

wsl --terminate kali-linux

to check wsl status:

wsl --status

view the linux files in windows file explorer:

explorer.exe .

set specific distro as default:

wsl -s kali-linux
wsl --set-default kali-linux

to change the default user for a distribution:

kali-linux config --default-user username

references