Linux serverlinux web serverNETWORK ADMINISTRATIONS

Windows Subsystem for Linux setup WSL2 Systemd, Ansible, and Kubernetes

Windows Subsystem for Linux is a great way to easily get your hands on a Linux environment with a native Bash shell and interacting with native Linux tools. In this video, we take a look at the ultimate Windows Subsystem for Linux tweaks and tips for setting up your WSL environment for DevOps, automation, Kubernetes learning and testing, and more.

Subscribe to the channel: https://www.youtube.com/channel/UCrxcWtpd1IGHG9RbD_9380A?sub_confirmation=1

My blog:

Home


_____________________________________________________

Social Media:

LinkedIn:
https://www.linkedin.com/in/brandon-lee-vht/

Github:
https://github.com/brandonleegit

Introduction to Windows Subsystem for Linux – 0:00
New Windows Subsystem for Linux WSL2 install process from Microsoft Store – 1:10
Looking at installing it from Microsoft Store 2:09
How can you tell if you have the latest version installed? 2:40
Overwriting installed version with the Store version – 3:14
Supressing the sudo password prompt – 3:54
Adding the command to suppress the sudo prompt – 4:35
Enabling systemd functionality in WSL 2 – 5:10
Editing the file to add systemd to WSL 2 – 5:45
Shutting down WSL after adding systemd – 6:15
Verifying systemd is installed – 6:30
Introducing Ansible – 6:47
Viewing the commands to install Ansible in WSL 2 – 7:10
Entering Kerberos realm – 8:07
Viewing Ansible version command – 8:18
Adding persistent aliases and why you want to do this – 8:32
Creating the file needed for persistent alias in WSL 2 – 8:53
Pasting in the command needed for the alias – 9:20
Testing the alias created – 10:14
Introducing PowerShell and why you can use it – 10:38
Looking at the commands in WSL for installing PowerShell – 11:02
Executing PowerShell in WSL – 12:08
Adding the VMware PowerCLI module – 12:35
Verifying the VMware PowerCLI installation – 13:13
Working with files between WSL and your Windows WSL host – 13:30
Looking at file navigation, browsing, copying, editing between WSL and Windows host – 14:20
Looking at changing to a mounted Windows host directory in WSL – 14:49
Opening a location in WSL 2 in Windows Explorer – 15:27
Installing Kubernetes inside Windows Subsystem for Linux – 16:23
Viewing the command to install Microk8s – 17:05
Issuing microk8s status command – 17:22
Issuing microk8s kubectl commands – 17:38
Installing Minikube in WSL 2 – 18:02
After prerequisites, beginning Minkube installatio – 18:54
Starting the Minkube cluster – 19:36
Viewing Minkube cluster with kubectl – 19:51
Conclueding thoughts on Windows Subsystem for Linux tweaks – 20:00

Windows Subsystem for Linux now GA and how to install it:

Windows Subsystem for Linux Microsoft Store GA and now default WSL

Windows Server 2022 WSL 2 support with KB5014021 Windows Update:

Windows 2022 WSL2 support with new Windows Update KB5014021


source

by VirtualizationHowto

linux web server

44 thoughts on “Windows Subsystem for Linux setup WSL2 Systemd, Ansible, and Kubernetes

  • your video helped me to setup wsl2 with all the necessary tweaks. Just one question : are you using the insider build of wsl2 ? there are some major updates on networking and memory reclaim

  • The store (and your wsl –version) seems to show WSL version 1. If not interested in file-system performance wouldn't WSL-2 be better as it can run Rancher or "Docker Desktop For Windows" with the WSL2 backend?

    How does Hyper-V fit in?

  • Happy that most of the setup works with WSL 1, as I had some problems with WSL 2 not being able to reach the internet when on a VPN.

  • you don't explain properly. after pasting the command to suppress the password, you don't say the function applied used to save and someone new to this won't even know why the command appears that way. you have to tell people to put in their linux usernames

  • Good morning. I am experiencing the hardest time installing Ansible. Can you assist?

  • Where I can find those commands which you are firing in video…… is there any page in your website where you have listed them all ?

  • hi. can you please do a video on how to properly expose the wsl network to the LAN of the host machine (with metallb or something) ? there are options like ngrok or windows virtual switch etc. but i dont know whats the best and how to set up. would be nice to know how to thanks

  • Whats the point, I will just run linux.. That way I dont have all the bloat and telemetry on my system.

  • Hi All,

    When i do sudo apt-get update or try yo install anything i get error as temporary failure resolving.. Any hints how to fix this?

    Thanks

  • The multiple lines for installing required packages around the 7:30 mark:

    sudo apt-get install -y gcc python3-dev libkrb5-dev &&

    sudo apt-get install python3-pip -y &&

    pip3 install –upgrade pip &&

    pip3 install –upgrade virtualenv &&

    sudo apt install krb5-user -y &&

    pip3 install pywinrm &&

    sudo apt install ansible -y

    I imagine most know this already if you're working with Linux shell commands, but this is basically all one command "line"; it's split up for easier reading but the "&& " portion at the end of each line tells the shell to include the next line of text as part of the previous line's commands.

    I.E. This will execute multiple commands sequentially.

  • Where to find genuine Windows 11 lightweight version with crack or patch or serial keys 🔑 🤔 I need this to host kali linux in the wsl on my system. Thanks in advance for your help and support 👍

  • Thanks for the systems tip. One question regarding to ssh remote connection. What would be the best practice for allowing wsl ssh connection from a remote client? Is it still through a port forwarding via the Windows?

  • Would be awesome if you would provide the powershell/ansible install commands

  • Only a TRUE DIE HARD Windows user would build all this into a Windows environment when you can run Windows as a VM in Linux if you need it SO BAD.

  • Whenever I open ubuntu its showing like this only
    "root@ZED_AIR_CX3:~#"
    and its not opening through any user
    can you plz help me with this?

  • I'm curious about the relations of Power Automate, Power Shell, Python and the M$/Knowledge graph….
    and the costs involved …. I would prefer Python and the Eclipse enviornment.

  • It would be cool to have an ansible (?PowserShell) spin up a virtual stack with options to use differing vm mgrs….maybe one to convert existing system to virtual image and save/restore as one of many.
    Very info dense and amazing concepts….I want to create a home ceph storage net with varying numbers of hosts both real and virtual.

  • Another thing I find myself doing every time I set up WSL from scratch is to have my SSH key/s loaded automatically using keychain. Something I did not manage to do is to bridge the network interface with the host… don't think this is possible yet (?).

  • Just subscribed, as I may be your spooky action at a distance. Also maybe because I am home lab nerding.

  • Really awesome, thanks for this Informative video. I have a question though, I wonder if we could install all of WSL2, Vmware Workstation, Virtualbox and Micorsoft Hyper-v all in one machine?!!! Thank you

  • Interesting video, is there an associated blob with the steps and command listed?

  • Is network mode “host” available on wsl2?

  • I been waiting for them to release a static IP for their linux subsystem. Seems after every reboot of windows the subsystem gets assigned a different IP. Not good if you are running say a server in that subsystem.

  • Wow. Now I have a ❓ for the gurus.

    Can Ansible suck out (clone, I suppose) from a manually-configured system or environment, i.e., existing setup / configuration, that information and write an Ansible script that one can take to put on another vanilla machine to make it be set up the same way as the first one that was manually configured? And, if not, why not?

  • Excellent video. Everything is running on my side except "kubectl get nodes" I get the command not found. kubectl is in my home directory but not with -x privileges. Maybe I missed something?

  • Actually, it doesn't install a Windows subsystem on Linux.
    It's the other way around. 🙂

  • Great video, what are your thoughts on pros & cons between Microk8s & KinD?

  • Hi,
    If I were to override my old installation of WSL with the one from Microsoft Store, would I lose all my files?

  • Really liked the video and the pace from "beginner" to installing Kubernetes for more advanced workflows.
    Maybe a good follow-up video (if not already done) would be to speak about the GPU and Kernel building, for the even more advanced needs.

    One little remark/question: could insert some of the references you're basing yourself? specially anything about installations as it may help reading further.

    Keep the excellent work.

  • Great video thank you sir. I have not use WSL in a while, now I need to take another look at it. Thanks all the best in 2023 looking forward to what you have for us in 2023..

  • Excellent video. Everything is running on my side except "kubectl get nodes" I get the command not found. kubectl is in my home directory but not with -x privileges. Maybe I missed something?

  • Video is quite good. I am not using WSL for such functionalities as I am limited with resource. what I did is spun up a ubuntu server in Vmware, and installed all the tweaks there to play around.

  • Amazing— the quality and substance of your videos has gone “up there” with the best. Well done!

  • One small note about using a .local TLD, use something else. .local is reserved for mDNS and you may run into issues. I understand people use it for labs, but it still important to understand the issue.
    https://en.wikipedia.org/wiki/.local

Comments are closed.