Using Linux on Windows with WSL 2 🐧 – Debian and Arch Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome this video will be a practical guide on running Linux on your Windows operating system using Windows subsystem for Linux or WSL WSL allows you to run a Linux distro on your Windows operating system as a virtual virtual machine with a tiny resource footprint in this video we'll focus on WSL version 2 specifically if you have a Double SL display installed the hyper-v virtual machine will be running constantly in the background on one hand that will use resources when your windows OS is running at all times on the other you can run services like servers on your Linux virtual machine and seeing that the footprint is very tiny in terms of resource usage that works great to use WSL you must be running Windows 10 2004 or higher or Windows 11. in this demo I'll be using Windows 11. we'll do everything in an elevated Windows Powershell we must first check if we have WSL installed to do that run WSL if it's installed you'll see the following text the simplest install of a Windows subsystem for link distro is to just run WSL dash dash install this will install the default Linux distro which is Ubuntu and it's actually not a bad choice if you want to run Linux on Windows hassle free and do the easiest setup possible in this case I want to show you a few options first to do that use the list and online Flags this will show you a list of distributions available in the Microsoft store all of these can be installed as a subsystem for Linux distro with the following command by just saying which district you would like installed as you can see we have Ubuntu Davion Kali Linux so meltius versions of Ubuntu opens use Oracle and those use Enterprise server these are all easy options to install in this case I'll start by installing a Debian but any of these would be very similar just type the resale.install and after the D option I'll type the Debian this true name and run the commands if this is your first time it will take a little bit longer as Windows will have to enable the windows subsystem for Linux but in this case my district is already installed it automatically launched in my windows terminal as this is the first time it's running it's asking me to create a new Unix user account so I don't use the root account I just create a test account and I'm already in my Debian distro I would recommend using the windows terminal to access your windows subsystem for Linux shell as it's already installed on Windows 11 you have the ability to open multiple tabs and your WSL distro will automatically be added as a profile here if you open settings you can set it as the default profile instead of instead of the windows Powershell I usually do that because I develop on Linux and I use the Powershell only to configure some Windows settings which is much more rare than using my Linux distro now what we have here is a full Debian Linux running on a virtual machine so we have the Linux file system we can use apt to update our system and upgrade our OS what's interesting is we can also run Windows executables like the Windows Explorer by using the file extension that way I open the window the Linux file system in the Windows Explorer right here double cell also integrates with Windows Explorer and you get this Linux folder with network drive in this case I can click deviant to open the same file system now WSL 2 has one drawback these network drives use the P9 protocol which is very slow file system access protocol you'll notice that it's considerably slower than native NTFS because of that I would recommend using Linux software when you want to interact with the with the Linux file system Erwin and windows executables when you're using Windows files now the swirl file system access is actually pretty bad for development if you think about it because you would want to use a code editor or IDE on your windows OS and interact with the Linux file system with Linux in general to run executables node.js python whatever so there is a solution to that if you use Visual Studio code for your development there's an extension called WSL which you can install what this extension does is it runs a visual studio code server on your windows subsystem for Linux and allows you to open a remote window which connects to your WSL distro and now you have quick file system access from Visual Studio code in your Linux file system and the integrated terminal opens your Linux shell this eliminates all the drawbacks of the 12 file system access protocol so far we have been working with the Deviant distro I want to show you how to install a distribution that is not available in the Microsoft store in this case I'll do Arch Linux as a popular alternative to do that easily I'll use one of the most popular Community packages for running Arch Linux on WSL this repository will be linked in the video description from here we have to go to releases and download of your file we'll need the latest Apex file you can also download the online version which will download the R2 root FS or you can download this one as you can see at 244 megabytes so it's not a big deal and you need a certificate file to install Arch you first need to install the certificate file you install the certificate choose local machine store and then you have to place the certificate in The Trusted root certificate authorities folder or star after the certificate is imported all you have to do to install Arch is to run the appx file now the installation is complete to start my newly installed Arch I have to search for the executable which is called Arch and run it and now I'm in my new Arch Linux Double SL instance as root now at first start we have to do a few things to make sure our Arch installation is usable some very basic things this archdwsl package also has a documentation for setup it's also linked in the description and we'll follow it we first have to of course set a root password next we have to create a user and make it a sudoer this will create the suders file then we create our user with a desired username and of course set a password for it great now the next step is to set the default user of our Arch WSL instance as the newly created user as right now our wso instance runs US route for that open Powershell and run the following command Arch Excel which is our Double SL instance config default user and then type the username of your newly created Linux user that's done as you can see after the default user change you have to either reboot your computer or restart the wxss manager from an administrative command prompt after that is done we can initialize the packman keyring to make sure we can install packages with pack one I'll start my Arch again this time from Windows terminal and to initialize my pac-1 keyring I just have to run a couple of commands finally run Pokemon SEO and at this stage your arch is set up to a point when you have a user is a sudoer and you can install and update packages using Pacman with that hour of today's video we export how to install Debian and Arch Linux on Windows we also saw some basic functionalities of the Linux distros on Windows and how they integrate window Windows terminal Windows secure and visual studio code don't forget to subscribe to get notified when another video is released take care
Info
Channel: NL Tech
Views: 11,867
Rating: undefined out of 5
Keywords: linux, wsl, wsl 2.0, unix, debian, arch, archlinux, ubuntu, server, windows, subsystem, terminal, windows terminal, integration, file explorer, windows explorer, explorer, network drive, p9 protocol, 9p protocol, p9, 9p, slow, slow file system, slow network, slow network drive, drawbacks, wsl drawbacks, visual studio code, vscode, vscode integration, vscode server, visual studio code server, vscode wsl, visual studio code wsl, arch keyring, pacman, apt, systemd, systemctl, services, development, node
Id: 4RXDbz-EEEo
Channel Id: undefined
Length: 9min 12sec (552 seconds)
Published: Sun Jun 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.