 Hello, everyone, my name is John Hammond and this is a video tutorial helping you getting started with Windows subsystem for Linux WSL version 2. So let's dive in. Let's just go ahead and get after it. I think that's the best way to do it Let's not waste any time. I'm gonna fire up Chrome. I'm gonna use my web browser here. Just Google Chrome That's kind of what I've been using lately and I'm already on Google So I don't have to go to Google comm but typically when you want something on your computer on the internet You just have to search for what you want. So let's look at WSL to Windows 10 Simply all we need to search for and looks like I have a result here Let's install the Windows subsystem for Linux WSL on Windows 10 with the Microsoft documentation here docs.microsoft.com Because I think that's the best source. Let's go for the real documentation So this explains to us if we want to install the Windows subsystem for Linux What we have to do is we have to turn on some of these optional features on Windows 10 Now you can do this with the graphical user interface if you were to simply go and type in like okay Windows features and gives you turn Windows features on and off through your control panel. That's an option It also explains you can just run these simple commands that will go ahead and do that right for you It says open PowerShell as administrator and run this command So we could copy this with that copy button there or just select all of it Copy however you'd like to I'm using control C because I like to use those keyboard hotkeys and Now as it said we could open PowerShell as the administrator and run that the way that you could do this If you just type it in in your start menu, you'll have an option here run as administrator If you right-click it, there's an option run as administrator again If you're kind of a keyboard junkie you could do control shift enter and then it will prompt you for whatever you particularly Want to run as administrator now note here You could be opening this in PowerShell or cmd.exe again as administrator. I just simply type in cmd there Note that we're using a DSIM Excuse me dis m dot exe. So this is going to be an old school cmd.exe Like program that we're using it's not a Windows PowerShell Commandlet right doesn't exactly matter what we're in but PowerShell is totally fine to use Let me close out of that and I'll open PowerShell just because I don't know that's what we should be using these days Let me actually amp that text up So I'll go into properties here move that font to something that you can actually see Amazing, okay now we could just simply run that command that we copied You could right-click to paste it in you could shift and press insert to paste it in but once that is all Displayed in the command line. Let's go ahead and hit enter on that and it will Take effect right it'll enable those features and we can hit the I believe button. That's really all we need Before we move on That explains. Okay. We just set it up for WSL version 1 now What we're doing is we're gonna be setting up WSL version 2 WSL version 2 is a little bit better Because it's using a real virtualization layer and Windows 10 is packaged Essentially with a Linux kernel that allows us to kind of natively run Linux applications, which is super cool but that means we have to have a little bit of Recent mainstream up-to-date stuff This says you need to make sure that you are running Windows 10 updated a version 2004 build 1904 or higher the way you could determine that is by simply running a Windows command and they specify you could do this with kind of the run dialog box if you press the Windows key and are you can type in win ver or WIN VR hit, okay Hit enter whatever you want and it'll tell you that Version number right there if your build is lower than that you will have to upgrade update Windows do whatever you got to do From what I understand this has been troubling it has been troublesome trying to get it to upgrade and update In a previous version you might have to do a manual install But you could do the media creation tool that Windows ships with and get the proper version that you need so Okay, now we want to enable the virtual machine platform again another optional feature or component And we're gonna end up running a same command at D ism and then enabling the specific feature Let's copy this guy And again, I will hop over to my PowerShell window and I will use shift insert to paste that in Simply run that slap that in and now that operation has completed successfully and we're done easy enough But we're running Windows so anytime we make a specific unique tweak and change We will have to you simply restart our computer to complete that WSL installation I've done that right. I'm running with WSL 2 already. So if you are doing this for the first time I'll see you in a little bit. Please you restart your computer. Thanks. Okay Now let's get back to what we're working with here set WSL 2 as your default version So because we've installed WSL it could very well be using WSL version 1 or WSL version 2 If you want to specify what version you run as the default you have the capability to interact with this utility WSL as its own command, right as something that you can interface with on the command line You could simply pass an argument. Let's set the default version to number 2. Let's go ahead and do this. I Apparently killed my PowerShell window. So let's fire that back up If I were to simply run WSL set default version So two hyphens to start and then hyphens in between each word. They're set default version 2 It says for information on key differences with WSL 2. Please visit this location. Gotcha. Good enough. I'm pretty sure that's good In our case this guide explains to us you might see this message after running that command WSL requires an update to its kernel component for information. Please visit this link here Okay So if we do get that message and you might while you're setting this up for the very first time We should go ahead and kind of work with that. So let's go to that link Open another tab and it says we need to update our WSL 2 Linux kernel Manually do this. Go ahead and install it. Looks like we have to download the Linux kernel update package This says please download the latest WSL 2 kernel update package for these machines If I click on that it'll simply grab an MSI or a little Microsoft installer file I will click on that as well and you will be prompted with this kind of Linux tux looking Like dialogue box a classic installer where you'll slam next and finish a bunch until you have everything installed And that's really all you need to do. That's all that the Windows kernel or excuse me Linux kernel will need to be set up for WSL 2 because I already have this set up. It's not going to particularly play nice with me. That's totally fine I trust that you can click next through an installer as you've done many times before on Windows. Let's get back to our original guide here and Now we are working with WSL WSL One thing that I should have mentioned when we were looking at this WSL command is that you can use tack tack help and that will Display a little bit more options of what we can really do with this tool with this command line with this command, right? If no command line is provided It will automatically launch the default shell or whatever version of Linux that you happen to have Installed and you're working with on your Windows 10 installation, right? You could check out a specific distribution. You could run as a specific user You could import or list or etc etc etc all the ones that are running and you might have multiple distributions Installed right now. We don't have any so let's go ahead and go get a Linux distribution that we particularly like We can open the Microsoft Store and then go track down our favorite Linux distributions Right now it ships with a decent amount. You can choose whatever you would like personally I'm an Ubuntu guy, so I'm always going for Ubuntu 20.04 and let's do that if I were to open up the Microsoft Store I have a typo there That'll open up here We could simply search for the distribution that we're looking for you could type in Ubuntu Once you search for it. Okay, great. You can see all these apps You'll have maybe Ubuntu without a name or a version number 18.04 20.04 and let's click on him. I Like 20.04 it is free noted and we could simply get that Easy enough, right? Once you have gotten that you can simply install click on that and it'll go ahead and install It takes a little bit of time to download it, but hey, it works just just fine Then it's done great and it says it just got installed my face is in the way See if I can make that go away. We just got installed. Let's go ahead and check it out if I hit launch there It'll say I'm installing this might take a few minutes. Let me amp up that text again, so you can see it Okay, great. This says hey, please create a default UNIX user account It does not need to match your current Windows username. Let me turn my face back on. All right Enter a new UNIX username and this doesn't have to be as it said the one that's actually on your Windows 10 Machine you could have it be whatever you particularly like. I tend to like it to match my name So I'll just type in John and I will need a password So I will use a super secure password just for the sake of demonstration and now We boot it up. We're kind of logged in to Linux, right? All within our Windows 10 system So this is pretty cool because it opens the doors for all of our regular Linux like development and work that we might do Still on Windows so we can get a little bit of the best of both worlds. I had to switch to Windows I didn't have to switch to Windows But I've been doing this because I want a little bit better look in the video, right? So I'm using this new camera and I've got a little bit more Stable video editing and I want to do just some stuff with it So that is why I kind of wanted to get some more Windows and Linux stuff mixed in I'm running WSL 2 and that is how I set it up That is how I got at least a simple command line running and ready for me So if you wanted to let me just hit the start button again type in WSL We'll run that and now you can see that I am Let me zoom in. Sorry Big font. I think that's good enough for you. I hope so I could run specific commands check out the present working director. I'm in check out who I am I ID etc etc and I can move around inside of a Linux file system interesting thing, right? I Am currently in my Linux file system, but over in the slash MNT is where Windows and the Windows file system is mounted, right? So I could hop over to the C drive and Check out. Oh, these are all the Files and folders that will be actually part of my Windows installation that Windows file system And I can kind of move back and forth between Linux and Windows which is handy, right? Or if I need to open up an application, I could run explorer.exe And now I'm gonna open up Windows Explorer in that directory. Let me add a period to note Okay, let's fire that up in home John. You'll note here in the Location bar and the navigation bar. I'm it almost looks like I'm in a network share, right? It's two backslashes WSL on a dollar sign So you could use that to actually get yourself into the Linux file system whenever you're kind of navigating through an File open dialogue or you're working with an explorer So that is handy and you can start up anything else you might like Because you can access that mount C drive. Maybe you can get into program files We get into. Oh, sorry. That's screaming at you. I will mute that We have sublime text. Is that in x64 bit. Okay. No, it's not x86 Wow, that is Not happy with me trying to tab complete some stuff Subtle dot exe and now I've fired up sublime text over in another window I'll show that here for you. Great integration between Windows and Linux all with WSL version 2 and I think it's really nice. I have been using that lately And I hope you guys get a little bit of use out of it So you aren't beating yourself up or you're banging your head against the wall because maybe you are forced to use Windows or you're trapped in Windows. You just have to do it in your working environment But you still need to dev man. You still need to get some work done and you just prefer to be in Linux WSL 2 can help make that happen. I'd like to do a little bit more where I showcase the Windows terminal I'd like to do a little bit more where I showcase Docker in Windows so you can really do some good stuff Maybe you can kind of prepare for some capital flag events or do some pentests and do some ethical hacking crazy crazy cool stuff But that is it everyone. How we doing? Way too long of a video almost 15 minutes. Thank you. Thank you. Thank you so much for tuning in Thank you for watching if you did like this video, please do do those YouTube algorithm things I would love it if you could maybe subscribe to my YouTube channel drop a like leave a comment write some stuff and hit enter I'm grateful for the engagement. So thanks again for watching everybody. I hope you enjoyed this video I will see you in the next one. Take care