Linux Terminal & GUI Inside of Windows 10 (WSL)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what is going on guys welcome back in today's video i'm going to guide you through the full installation of the windows subsystem for linux so let's get right into it so for those of you who don't know what the windows subsystem for linux is also called wsl it is basically a linux system running inside of windows so you have a linux terminal on windows but at the same time it's not a virtual machine and it's also not just a terminal emulation it's not just a clone of the linux terminal you have an actual linux system running inside of windows uh in the form of a command line basically but you don't have only the command line you can also run graphical user interface applications with a little bit of additional work but what it can look like in the end when you have installed it and set it up is somewhat like that you can open up a terminal you can do all the linux commands i can also call something like neofetch for example and you can see that i have ubuntu installed here in the terminal and you can also see that if i run htop we can see all the processes running here and i can even run some graphical user interface applications here so for example nautilus which is a file explorer and you can see that i have this linux style graphical user interface on windows so we have an actual linux system running on windows and you don't need to worry about compatibility or anything because we're not radically modding our system the windows subsystem for linux is developed by microsoft so it's not just uh some i don't know uh fancy modification of some guy in the internet it's actually produced by microsoft and well integrated into the system um the first thing we need to do in order to install the linux subsystem or the windows subsystem for linux here is we need to go to the features so we're going to go to the start menu and we're going to type features and you can see here turn windows features on or off because what you need to turn on uh what you need turned on here in order to be able to do this you need to turn on the virtual machine platform feature so if you don't have a check here in this check box you need to click it and press ok in addition to that this is something that i cannot guide you through because it's specific to your machine to your laptop computer uh you need to go into your bios and also turn on the virtualization uh functionality so if your bias is blocking the virtualization you're not going to have any success here so you need to make sure that your system uh is able to virtualize and you need to turn on that feature once you have that you go to the start menu once more and you type store or microsoft store just click on a microsoft store and now you can just search for the distribution that you're interested in so you can go for ubuntu if you want to you can also by the way just type linux and see all the different distributions here you can go with ubuntu which is what i have installed on my machine here you can go with debian if you want to adjust debian and you can also install debian you can go with opensuse you can go with kali linux and all that um in this video i'm going to go with debian because i don't have debian installed i have ubuntu installed and i don't want to remove all the settings and all the things that i've set up the process is kind of similar so what i'm going to do is i'm going to install debian to show you the basic installation process it's a very simple process i just have to pick a username and a password basically and that's it and then once we are we are at a certain level i'm just going to show you the steps in ubuntu or if it doesn't make a lot of difference i'm just going to proceed on debian so what you do is you go to the app and you install it in this case it's loading uh so in this case i'm going to go with debian and what you do is you go to debian here and you click on install so it's going to take a while it's going to download it i think it's about 800 megabytes or something or 700 megabytes i'm not sure uh however we're going to skip that download part and i'm going to get back to you once it's done so once the download is finished you're going to see this terminal here pop up it's going to install for a couple of minutes and then it's going to ask you for a username in this case i'm just going to go with neural nine and then we're going to enter a password one two three four five of course please pick a secure one we're going to retype it and once this is done we are already inside of the linux system here so this is the debian linux system that we have here and the first thing i would like to do at least for this video you can do whatever you want i like to increase the font size because otherwise you guys won't be able to read anything so i'm going to increase it to 28 and i'm going to also change the layout a little bit so let's go with a height of 25 and a width of i don't know 110 maybe there you go that's fine so now we can already go with some basic things here you can do ls you can do pwd we can navigate through the system now one thing that you need to keep in mind here is that if you just remain in that directory here that you are right now you are inside of the linux system so of course i'm in the user directory here and i can create documents and downloads and desktop whatever but i'm not on my windows system if i want to go to my windows system if i want to access the files on the windows system i need to go back two times and here you can see the individual directories we need to go to the mount directory so to the mnt directory and we're going to just say cdm and t and here you can see okay we have c [Music] then we have users we have my case flory and then we have desktop and now we are at the desktop so now we are navigating navigating through the windows files so if you are in your linux subsystem and you want to go to the windows files uh you want to go to slash mount c and then you know you navigate and of course if you have different partitions you should also be able to see those here so that is a very basic thing that we have here now what we also need is or what we don't need but what we want to do as a first step is in my opinion it's very annoying that when you do certain things you're going to get a lot of error sound so if i i don't know type some file name here and then i press tab you can hear that right i hope you can hear that in the video i get these annoying sounds whenever i try to do some auto completion uh that doesn't work whenever i try to delete something that's not there you can hear the error sounds if you want to get rid of those you can do that in three ways or you have to take three steps to get rid of this annoying bell sound the first thing is you want to get rid of the bell sound inside of the bash the second thing is you want to get rid of the bell sound inside of the vim the vim editor and you want to get rid of the bad of the bell sound inside of less with top with double s so the first thing is we go to the input rc file so we can just use vim to do that uh i think vim is installed by default right so if i just type vi yes we have vim i think we should also have nano right okay so you can pick the editor that you prefer i'm going to go with bim and we want to edit the input rc file it's located at e t c and then input rc this is the file we want to change in order to change it we have to go with vi and in order to be able to overwrite that file so to make actual changes we're going to need sudo so the super user do command here let me just check one more time my camera is not blocking anything i'm going to move it to the upright here to the to the upper right here um there you go so we're going to go to the input rc file and we're going to enter the password here and here we can see individual settings that we can set and you can just do it manually here as you can see here in bim you also hear these error sounds if you want to remove the bell sound you need to uncomment this set bell style none here so we're just going to delete come on oh man let me just do it with nano then so sudo nano etc input rc add some difficulties right now uh so you want to uncomment this set bell style none we're going to save that there you go exit and now if i if i close the terminal and then open it up again so if i close it and then open debian again now if i write some nonsense and press tab as you can see or asking here there's no bell sound if you want to do the same thing in vim you need to manipulate or you need to change the vim rc file however of course if you're using neovim because you already installed it you have to do the same thing in the init.vim file but those of you who are using bim probably know how to setup them so what we're going to do is we're going to go to the vim file which is dot vim rc from the user directory and here we don't have anything so we're basically creating it um and what we want to do here is we want to say set visual bell now if i do this again oh come on if i do some nonsense here you can see there's no bell sound all right the last thing is that we also want to remove the bell sound from the less type of applications or whenever we are in a less mode which is written like that we want to also remove the bell sound and for that we have to uh to change the dot profile file which is basically located at userdirectoryslash.profile and what we do here is we basically [Music] let me just go to the end of a file here uh we basically just add the line which is a little bit more complicated so let me just take a look at it it's export less equals and then dollar less r q and that's basically it so we also get of the get rid of the bell sound there so this is how you remove the annoying bell sound if you want to if you like it for some reason if you need it for some reason if it doesn't bother you you can just ignore this but with these three steps you can remove the annoying bell sounds from the from the wsl terminal so we're now going to switch to the ubuntu terminal because i don't want to use debian i just installed debian because i didn't want to uninstall ubuntu the steps are the same so you can choose whatever distribution you like of course you're different opensuse is going to be a little bit different than debian and ubuntu ubuntu is going to be a little bit different than debian but since i use ubuntu mainly and i would also recommend you to use ubuntu if you're a beginner i'm going to proceed with ubuntu here so we're going to go with ubuntu and now we're going to talk about tools interesting and useful tools that we that i recommend you to install on the windows subsystem for linux and the first one is vim or neovim but as we already know vim is installed already so what do i mean by that i mean configure vim or neovim to be a good editor i would recommend you personally to just start using vim in the command line you don't have to use it as your main editor to replace visual studio code or pycharm uh use it whenever you're in the terminal don't use nano or actually i don't want to say don't use nano use whatever you want but i recommend you to use vim because vim can make you very efficient i like them i'm a big big fan of them and i would recommend you to just take the time and learn to use them and also set up a nice looking vim because the basic vim is pretty boring if i just go with vi and then you know test dot py for example it's a very basic editor here as you can see i didn't even uh didn't even disable the bell because i don't use the ordinary ordinary vim however if you choose to install something like neovim you can set it up in a very very nice way so let me show you what you can do with neovim let's navigate to neural gear and let's go to object recognition for example if i open up neovim here you can see first of all i have a file explorer i can open the main.py file it has nice syntax syntax highlighting and autocompletion i can open the file explorer here to the left i can open uh a tag bar to the right here and you can see information here i also have uh this airline down here so vim doesn't have to be a boring limited editor it can have a lot of plugins so what i would recommend you is to take a look at my video uh where i show you my neovim setup i think it's even called my neovim setup and i would recommend you to get a nice editor for your terminal choose vim choose emacs choose nano if you like to but you should be able to use a terminal editor if you'll if you're working on a linux terminal in general not just for the for the windows subsystem here um so the next tool that i would recommend you to install is h-top h-stop is basically just a very basic task manager in the terminal and you install it by saying sudo apt install and then h-top and once you have that you're going to have this very simple tool where you see all the processes you can terminate them you can kill them you can filter you can search you can see the usage up here you can see the memory usage the cpu usage and all that so a very basic tool that i like to use or that i have to use oftentimes when something is stuck and i need to kill a process or something highly recommend you to get h top here besides that by default you're not going to be able to use commands like if config so if you try to do it actually i can show it to you if we go to debian here because i didn't install it there yet if i type f if config you're not going to see or you're going to see that this command is not found so if you want to install it what you do is type sudo apt install and then net dash tools this is what you're going to need in order to be able to run ifconfig so also something that i would recommend you to get uh and besides that what do we have here yeah you can get neofetch if you want to just to get some information about the system so you can say let me just press enter until i'm not hiding anything from the camera here um you can just type sudo apt install neofetch and once you have that you can run neofetch and you're going to get some information about the system first of all ubuntu logo here uh the os the kernel the uptime the packages the theme the icons terminal whatever cpu memory so just a basic tool to get some information about your system and besides that i would just recommend you to get all sorts of developer tools depending on what you're going to use this windows subsystem for linux for because you know you you don't install this just because you're cool you need this to compile certain things maybe you want to compile for linux uh maybe you want to compile for android when you have some python ki app for example you want to compile it to android install the necessary tools that you need here install a compiler for c for c plus plus install python uh install whatever you need basically because we don't use this just for fun we use this linux system here because it's useful because oftentimes when we develop something when we use a framework when we need to compile something we want to have a powerful terminal which is not the cmd and maybe you don't want to use powershell maybe you're inexperienced with powershell and you like to use linux then this is what you want to do here you want to install all the developer tools that you need so last but not least we want to be able to display graphical user interface content by default if we try to call a graphical user interface app or if we try to plot something for example with a python script and matplotlib it's not going to be able to display anything because we're limited to the terminal we don't have any display to export this to and in order to change that we need to install the x-ming server the x-min x server which you can find on sourceforge.net project x-ming you can just download it install it and run it's not too complicated but it always needs to be running if you want it to be able to show graphical user interface content uh so install it run it and you can just uh add it to the startup so it's always running in the background you can see down here it's running and once it's running you just need to set it up correctly you need to go to the bash rc file which is located at the user directory and then slash dot rc you can edit it with bim or with nano whatever i'm going to edit it with neovim and once we're inside it we just have to add the line export display equals localhost then colon 0.0 now i think there are also other commands that we can use i'm not sure uh i thought i think i saw a command that's a little bit more concise but if you just say export display localhost 0 0 that should work out well you need to do it in the bashrc file because otherwise you would have to do it every time you run the terminal manually so if you just want to test it you can just enter the command and then call a graphical user interface app but if you want uh want it to always be set up correctly you need to add it to the bash rc file once you have that line here you need to restart of course the terminal so close it open it up again and now you can try to open a graphical user interface app now you can call g added you can open up nautilus but of course you need to install these because they're not installed correctly uh they're not installed at all in fact if you want to try it if you just want to make uh make a test if it works you can install the x11 app so you can just say sudo app sudo apt install x11 dash apps like that and in my case i already have them and then you can just call x eyes for example and you can see that there you go graphical user interface we can close it we can also call x edit i think then we have a basic editor here and you can do the same thing of course with actual graphical user interface apps for example nautilus as i showed you in the beginning opens up this file explorer here it's a little bit buggy don't be confused but it also works with matplotlib whatever you try to display will be displayed using the server now if we exit from here if we close this we're not going to be able to do this anymore so i try to open nautilus doesn't work doesn't know where to display it so i need to make sure that xming is constantly running so i can start it again and i can give it a try and there you go it works again so that's it for today's video hope you enjoyed hope you'll learn something if so let me know by hitting the like button leaving a comment in the comment section down below and of course don't forget to subscribe to this channel and hit the notification bell to not miss a single future video for free other than that thank you much for watching see you next video and bye [Music] you
Info
Channel: NeuralNine
Views: 7,439
Rating: 4.9151516 out of 5
Keywords: wsl, linux, linux subsystem, windows subsystem for linux, windows subsystem linux, linux subsystem for windows, wsl2, gui, wsl gui, wsl graphical user interface, linux subsystem gui, wsl guide, installation tutorial, installation guide, wsl installation, wsl installation guide, linux terminal, linux terminal on windows
Id: qYlgUDKKK5A
Channel Id: undefined
Length: 19min 31sec (1171 seconds)
Published: Wed Sep 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.