in this video I'm gonna show you how to run wsl version 2 on a Windows 10 a laptop I'm gonna show you how to install WSL and I'm going to show you how to use the integration between Linux and Windows to do interesting things w SL version 2 builds on the work done with WS l version 1 but rather than using a translation layer between Linux and Windows it uses a virtualization technology to allow you to run a lightweight virtual machines directly on Windows 10 gone are the days when Microsoft said Linux is a cancer
gone are the days when Microsoft hated Linux Microsoft have changed dramatically over the last few years they've purchased github they do a lot of work in the cloud and they now give you a Linux kernel directly within Windows yes even though it's unbelievable you get a Linux kernel with Windows 10 these days this makes it very easy to learn Linux allows you to run a Windows operating system but still develop on Linux if you want to very tight integration between WSL version 2 and Windows 10 ok let's get started [Music] now in this example I'm
using this Windows laptop does Windows laptop is running Windows Home Edition it's not running professional you don't need the professional version of Windows to do this Home Edition is fine as you can see here windows Edition Windows 10 home now there are some requirements you need to have a later release of Windows 10 so if I run one version I can see that I'm using version 2004 it's recommended that you have at least that version so OS bold one nine zero four one two four six you can see this on the Windows 10 release information
version 2 0 0 4 was released on the 27th of May 2020 here's the operating system bold so once again that's the version that I'm running on this computer I've basically updated this computer to that version it's recommended that you do the same so as always go to your Windows Update settings go to Windows Update make sure that you've updated your computer to at least this version of Windows 10 okay so once you've updated your Windows computer to that release it's fairly simple to enable this so you need to go to turn Windows Features on
or off in control panel I'm once again using windows home here so I'm not going to enable the hypervisor platform all I'm going to enable is the windows subsystem for linux and the virtual machine platform make sure that you've enabled both of those options windows subsystem for linux and virtual machine platform again we're going to be using a virtual machine here rather than a translation layer between linux and windows much better in wsl version 2 you click OK Windows searches for the required files and then applies the changes what you will need to do now
is reboot your computer so click restart now to restart your Windows computer Windows updates are installed and the computers rebooted so once the computer has rebooted go to the Windows Store and search for booty now Boonta released 2004 LTS in April 2020 so I'm gonna get that latest release of Ubuntu now I've already downloaded this so it displays as install if you haven't downloaded it previously then click download and once you've clicked download click install to install this on your computer it's about 432 Megan sighs okay so once it's downloaded click launch and as you
can see it says installing this may take a few minutes I'm getting an error saying this requires a kernel component I need to go to this URL to get an update so I'm going to go to that URL and I'm told that I need to download the latest wsl to Linux kernel update package for 64 but operating systems so I've already downloaded that but I'll download it again it's only 13 Meaghan size so in my downloads directory this is the file that I've downloaded so I'll double click on that and click run so I'm told
that the setup wizard will install the windows subsystem for Linux update on my computer click Next to continue so I'll click Next click yes to install the software and click finish so now that that's been done I'll press any key to continue and I'll click Launch again to install the software so I'm told installing this may take a few minutes I'm told please create a default UNIX user account the user name does not need to match your Windows user name so I'm going to create a username of David and I'll set a password and I'll
press Enter so I'm told that installation is successful to run a commander's administrator use the sudo command and I'm told welcome to a boon to 2004 LTS notice the Linux version for nineteen one zero for Microsoft Standard Edition x86 64 bit so LS as an example shows me that there are no files PWD shows me the directory I'm in I can go to root as an example so PWD LS shows me the files here as you can see I'm running Linux so I'll type exit now to exit out of that what I've basically done now
is install Linux on this computer so if I want to stop that again I can type a boon to and run ubuntu and notice in a matter of a few seconds I've got an a boon to shell running on my computer now what I'll do is open up PowerShell so this is PowerShell it's not a Linux terminal but I've got a Linux terminal in the background I'll make this a bit bigger so I've got a Windows PowerShell and a Linux terminal I can use the command WS l - l - v to see the version
of the machines that i'm running in this example i'm running version 2 if your Linux VM is running version 1 you can use the command W SL - - a set of version of boon - or whatever the name of the virtual machine is - and this will make it use version 2 you could set it back to version 1 if you wanted to but I'm going to leave that at version 2 you can also make version 2 the default by saying WS l - - set default version 2 and that'll make it a version
to by default now your output may vary slightly to what I'm showing you here because I've already set mine to version two but as an example let's set that our Bunter to version one you can see the linux shell closed the conversion process is taking place now and while I'm waiting for that let's get the bun to 1804 LTS so I'll click get to get 1804 so an older version of Ubuntu and that's now downloading now today it's recommended that you use w SL version - it's a lot more optimized runs a lot quicker it's
using virtualization technology but you could use a version one if you wanted to okay version 1804 has been installed I'll click launch - launch 1804 when I specify a Linux name once again put a password in and as you can see I'm now using 1804 I'll use LSB release actually so we can see the release you can see that the subversion is 1804 or bunty okay going back to my 2004 WS l l version shows me that 1804 is running it's using version 2 2004 has been stopped it's using version 1 but I'll set it
back to version 2 I'd rather have everything running as version 2 you 18:04 started as version two because I set w SL version two as the default I'll close this down I'll open up another powershell WS l - L - version this is being converted this is running at the moment so to start the bun - simply search for the bun - that I want to use so 1804 and there you go LSB release - a I've got 1804 running and once the conversion has completed I'll start 2004 okay so the version has completed WS
L - L we can see we've got two Linux distributions - L - V we can see that a bun - 2004 has stopped it's using version two again 18:04 is running using version t you probably don't want to jump from one version to the other like i've shown you here i just wanted to show you the commands you probably want to stick with version two if that's the version that you starting with but again I could start Ubuntu 2004 here's 2004 I'll make the size of this window a bit bigger so let's go 20
so I've got two windows now again lsbe underscore release - eh shows me that i'm running ubuntu 18:04 here on this window LS b underscore release - eh i'm running ubuntu 2004 and here i'm running windows notice the prompt here is a windows prompt whereas here I've got linux prompts to make these winners a bit bigger so I've got a bunch of 1804 the bun to 2004 and Windows 10 all running on the same computer I can shut these down notice they still running if I just type WSL I'm running directly within a bun to
2004 if I exit out of there I'm back on Windows again so I can use commands such as dir I can also use the command WSL - - help to see help and as you can see here I've got the shutdown command so WS l - - shutdown and then if I look at all my versions again and notice they both shutdown so both 2004 as well as 1804 shutdown but notice I could simply start Ubuntu 2004 this way it's a ready booted so back in PowerShell I can see 2004 is running 1804 is stopped
I've got an a boon to shell here once again it took only a few seconds to boot up that's much quicker than using VMware Workstation player as an example and that being said it's now possible with the latest release of VMware Workstation player to run WSL a version 2 and VMware Player at the same time however I have found that it doesn't work if you want to use nested virtualization so this virtual machine requires nested virtualization and in this case I have problems starting the virtual machine up so if you want to run a virtual
machine let's say Kali or Kali Linux yeah it's possible to boot this up at the same time as running WSL but I have found that it gives me problems so at this point I wouldn't be comfortable running VMware Workstation player at the same time as WSL you might find that it runs really slowly but it is possible to run these two together so notice I've got Kelly or Kali booted up and I've got a bunt to 2004 running within WS l so WS L - L - V I've got a boon to 2004 running as
we can see over here and I've got Kali or Kelly Linux running at at the same time so LSB release - a I'll zoom in a bit here to make it easier to see but notice I've got once again LSB underscore release - eh this is Kali or Kali Linux 2001 and I've got a boon to 2004 running at the same time on a Windows 10 home computer personally I wouldn't run a VMware Workstation play or VMware Workstation pro or VirtualBox at the same time as wsl because nested virtualization is not supported I find that
it runs slowly you're probably going to want to stick with VMware Workstation player or VirtualBox if you want to boot up VMs but the great thing about wsl is there's very tight integration between Windows and wsl and if you want to get your feet wet so to say or if you want to start learning Linux this is a great way to get started one of the advantages of wsl those into is it boot up really quickly you can also compile a lot quicker so a lot quicker than wsl version 1 it's much quicker to boot
up a shell like this than it is to try and boot up a virtual machine but there's also tight integration between windows and Linux so if I type code dot what I'm doing is starting a Visual Studio code which is a Windows application and notice I'm told that the remote WSL extension is recommended as you have WSL installed on your system and I'm going to click install to install that what it's going to allow me to do now is open any folder within Visual Studio code so I'll run that again the vs code server for
x86 is downloaded and installed and notice now I'm able to create code within Visual Studio code but on the Linux subsystem so notice I can see my Bosch history I'm basically working on the Ubuntu system so if I go file a new file and I'll paste some Python code yeah like that a bit bigger this will allow me to SSH to a Cisco switch running on the Internet I'm going to click Save and I'm going to call this X Y P Y and click OK so this is a Python script once again on my Linux
subsystem type LS notice I've got a file called exceed py so I could run this by using the command Python 3x e dot py now I'm told that net Mikko is not available so first thing is Python installed Python version 2 is not installed but python version 3 is installed by default on my Linux subsystem so I'll just minimize that so we can see the screen clearly so I've got Python 3 but I need to install this module neck Mikko to be able to use this command I'm gonna run pup 3 now that's not currently
installed so I'm told I can use sudo apt install Python 3 pepper I'm told that that doesn't exist so let's do a sudo apt update to update my references as you can see these are proper Linux commands and then let's install Python pup 3 so that went quickly so just to show you the command I ran this command sudo apt installed Python 3 pup I'm gonna say yes to install it that's where the installing ok so there you go it's installed so I'll say sudo pup 3 install - you make me Co to install MIT
Miko if Miko's now installed so I'll clear the screen once again we want to run this application so on Linux Python 3x py a Python script this should connect to a Cisco router on the internet and pulled back information such as the interfaces on the router and there you go that came from this command so this is a command that I'm sending to a Cisco switch actually not a router and pulling back at the information so that shows us the output of a command but to show the integration I could use a command yes such
as show IP rot and what I'll do is click file save and then back in Linux if I type cat X e dot py notice the file has changed and if I run that again the output will be different here so here's the output I'm running the script in Linux but I'm editing it from within windows there's very tight integration between the Linux subsystem and the Windows operating system ok so that was a quick overview of wsl running within Windows 10 I hope you enjoyed this video if you did please consider subscribing to my youtube
channel please like this video and please click on the bell to get notifications I'm David bumble I want to wish you all the very best [Music]