How to install and setup WSL2 for Windows 10 and 11

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey austin here today i'm going to go over how to install wsl2 for windows 10 and 11 wsl stands for windows subsystem for linux so what it is is it is an actual fully running linux installation on running within windows you can do a lot with that especially for development so we'll go over how to exactly get that set up for you first thing to know is you need to be able to enable virtualization in your uafi bios on your motherboard this is completely dependent on your specific hardware your motherboard and your processor specifically whether you can even do this and you'll have to do a little bit googling yourself with your motherboard and get into your bios and see if there are options to do this unfortunately it's there's not really a good general way to show you how to do this it totally depends on your manufacturer additionally to be able to run wsl you need to be running windows 10 version 2004 or higher or any version of windows 11 so at least i can show you how to check which windows version you're running you can press the windows key and r and it'll pop up this run window and then just type in winver like i have here press enter and you should be able to see your uh your version details right here so i'm running version 21 h2 of windows 11. okay so the first thing we need to do is to open our powershell and administrator mode so we just press windows key type in our powershell here right run and run as administrator and then we can see that we have wsl at least installed but it's typing in wsl and it will detect and tell me we have no installed linux distributions then we want to do a w l update to make sure that we are all up to date so we have the current features for wsl for our machine and it looks like it is all up to date uh if you did have updates then it would download and install them here for you and then uh we can check which linux distributions uh windows subsystem for linux is supporting so we'll do dash dash list oops dash dash list dash online and it shows us everything that we can download here um the majority of these so ubuntu db and kali linux and then the lts versions of ubuntu down below they're all distributions based off of deviant so they'll all function pretty similarly a lot of the same toolkits out of the box and then open soos and sles are seuss-based distributions and so they'll function a bit different so we'll just work with the uh generally the debian distributions here specifically ubuntu so in order to install uh we're just going to do a wsl dash install and then if we wanted to install cali for instance we would just type in kali linux after this d flag here and press enter but since we're just doing ubuntu which is our default uh or at least windows subsystem for linux's default uh then we just have to do dash dash install and type in ubuntu there we go download ubuntu okay and it'll pop open a new window with ubuntu right here and we'll say installing it'll take a few minutes to get set up okay now it's going to ask you for a unix username this is your root user so you want to make sure this is what your main user account is going to be that you're going to use to interact with the operating system so mine's just going to be austin type in my password okay and now we're in the first thing you typically want to do especially if you're just a standard user is you want to do an update and upgrade for your packages for linux just to make sure you have all the proper security features and other utility features as well so we'll do sudo apt update enter our password now it'll fetch all the updates we'll do sudo apt upgrade and this will install all of the updates press yes here and then you might be able to walk away for a sec this could take a minute depending on how many things ubuntu needs to install two hours later let's go ahead and do a restart of the ubuntu operating system so uh for wsl you have to do wsl.exe shutdown and that will close down the uh the instance of ubuntu and then you will just pull up back here so it'll take another second because it's uh restarting up the instance and if you have windows build 22 000 for windows 11 when in windows build 22 000 later and your wsl is all updated um you should be able to actually run gui applications so um today we're going to do so we'll do studio apt install dash y and it's going to ask for my password a few moments later and now we have installed so we should be able to just run like this it'll give us a few warnings here but after a few seconds it will open a uh it'll open again and then the next thing we're going to do i'm just going to close this window close our powershell here i'm going to show you how to set up the remote extension for vs code in order to interact with uh wsl2 so so accept next uh yes and i'm going to create a desktop icon and check i'm going to check all these just for me the most important one is to add to path it'll require a shall restart this is i believe it's necessary in order to actually uh open a code instance from the terminal next install and go ahead and launch okay so here we are and then we'll go to our extensions um so it's this remote dash wsl actually let's see development uh this full pack here this remote development pack is what microsoft recommends of course um so i'm going to go ahead and install and then okay let me just do control shift key and then remote w sound new wsl window and this is one way to do it uh where you let's see just use the vs code command palette and it will automatically install uh the vs code toolkit onto ubuntu for you and you can see that it's active because of the down here in the bottom left you have the wsl ubuntu it'll show it's running on ubuntu and when you start a terminal you can see it's our ubuntu terminal uh and we can see where uh about the projects directory so we can go into projects touch new file and we should see in our explorer should have this new file right here and there you go you're all set up for uh development on linux in windows i uh appreciate you guys watching the video i ran into a few issues so i'll detail some troubleshooting steps if you run into the same ones but from fresh installation this should be pretty straightforward give it a thumbs up if you liked it give it a subscribe if you want to see my next videos as they come out i really appreciate you sticking around and watching
Info
Channel: A.J. Isakson
Views: 17,957
Rating: undefined out of 5
Keywords: wsl2, linux, windows, ubuntu, windows subsystem for linux, coding, programming, gimp
Id: 7KVdJ43dQmE
Channel Id: undefined
Length: 9min 18sec (558 seconds)
Published: Sat Aug 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.