You don’t need a VM to run Linux on Windows anymore !!
Read this article if
You have Windows 10. You setup VMs within Windows to execute Linux native commands. You ❤ Docker, Kubernetes and Minikube and you don’t have Hyper-V and don’t like the cumbersome setup process and is highly unreliable. You ❤ Power shell + Chocolatey but you simply can’t get over Bash !!. Your Linux VMs are really slow and consume a lot of resources
Do yourself a favor , enable Linux Subsystems for Windows.
Step 1: Open Powershell as an administrator and run this command
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linuxand Restart your system when prompted !!
Step 2: Check OS Build Version
systeminfo | Select-String "^OS Name","^OS Version"if (build version >= Windows build 16215):
Open Microsoft Store;
Search for "Linux"
Select Distro and Install
else:
proceed to Step 3 :(
Step 3: Download Distros based on your requirement. I downloaded Ubuntu 18.04 Links Below
Ubuntu 18.04
Ubuntu 18.04 ARM
Ubuntu 16.04
Debian GNU/Linux
Kali Linux
OpenSUSE
SLES
Step 4: Extract the Archive and Install it
1) Open Powershell
----------------
cd C:\
mkdir Distros
cd Distros2) Copy file from Downloads folder to this folder
------------------------------------------------
3) Open Powershell
-------------------
Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
ls
Run Ubuntu.exe and enter your username and password
!!! Note: Sometimes you may have to rename and unzip the appx file inside the appx archive to see the actual .exe
Step 5: Once the installation is done
Open Powershell and add to path variable (or) do it manually
------------------------------------------------------------
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User") [System.Environment]::SetEnvironmentVariable("PATH", $userenv + "C:\Distros\Ubuntu", "User")
How do I exchange files between the Windows system and Linux Subsystem ?
!!! Don’t Modify them, instead work on a copy. Unless you want to get stuck in the rabbit-hole of file metadata corruption
Linux Files on Windows
%userprofile%\AppData\Local\Packages
Windows Files on Linux
C:\
----------
/mnt/c/D:\
----------
/mnt/d/
Yes you may run multiple Linux distros on the same machine :)