How To Run Linux Code on Windows with WSL 2 & VS Code

Поділитися
Вставка
  • Опубліковано 5 січ 2025

КОМЕНТАРІ • 139

  • @TypeScriptTV
    @TypeScriptTV  Рік тому +4

    If you have problems activating hardware-assisted virtualization (required for WSL2), this guide will help you: typescript.tv/hands-on/docker-desktop-hardware-assisted-virtualization/ 📖

  • @thomasfsr
    @thomasfsr 11 місяців тому +20

    You promised nothing and delivered everything! Thank you bro

    • @TypeScriptTV
      @TypeScriptTV  11 місяців тому

      Thank you!! I really like working with WSL2. 🙂

  • @kevincrowe7832
    @kevincrowe7832 10 місяців тому +5

    Really appreciate this video. the "rm -rf" command was specifically the problem I was having and I'm happy you brought it up within the first minute or so of the video.

  • @domnicdodeva3290
    @domnicdodeva3290 Рік тому +3

    This video helped a lot to understand how visual studio code, wsl works. Thank you for helping out

  • @kingkiller4630
    @kingkiller4630 11 місяців тому +2

    almost lost em at the free halo infinite im glad you pulled through and kept on with the tutorial

  • @srinivasmekala1189
    @srinivasmekala1189 3 роки тому +6

    Thank U for posting this video.... I installed WSL recently and stopped using coz I can't see the files I created through ubuntu in my file explorer. You helped me a lot. Thank you very much.

    • @TypeScriptTV
      @TypeScriptTV  3 роки тому +3

      My pleasure. On Windows 11 the WSL 2 even supports Linux GUI apps. Wishing you lots of fun using it! Benny

  • @abraund
    @abraund Рік тому +2

    Win+v, well that one has evaded me for a long time. Great guide, cannot believe how easy it is.

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Happy that it helped you! 👍 Please share my channel if you would like to support it. 😃

    • @abraund
      @abraund Рік тому

      @@TypeScriptTV and yet does anyone messing around with Linux on a Saturday afternoon have a social media following 🤔 good luck either way!

  • @pkn8707
    @pkn8707 2 роки тому +11

    Thanks Benny! The way you have structured the topics , it is really easy for a beginner to grasp it in one go. If a beginner can understand then anyone can do it.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      It's very nice of you to tell me that. Wishing you a lot of fun using the Windows Subsystem for Linux! 👍 Best, Benny

  • @BlancheNuit
    @BlancheNuit Рік тому +1

    thank you this is very useful. I was getting depressed (big word) writing code on virtualbox(because needed linux environment) because the lagg was getting to my nerves.
    This is going to make my life so much happier

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      VirtualBox lag getting you down? No worries, my friend... armed with WSL, you're about to get lightning-fast speeds! 🚀 Best, Benny

    • @BlancheNuit
      @BlancheNuit Рік тому

      @@TypeScriptTV I just got WSL (+ ubuntu) and its extension on VSCode and it's amazing !!

  • @gregmasters7420
    @gregmasters7420 Рік тому +6

    What a great video. Thank you for taking the time to help a novice like me to get this running!

    • @TypeScriptTV
      @TypeScriptTV  Рік тому +1

      You are very welcome! We were all beginners and will be beginners again with the next evolution of software. 💫 Best, Benny

  • @borisdorofeev5602
    @borisdorofeev5602 Місяць тому +2

    Man VSCode has gotten so cool. Yoo dont have to click the green button to load a Linux Terminal. You actually have a drop down menu on the terminal in VSCode and you can switch between different terminals within the working session.

  • @matiasrisso5917
    @matiasrisso5917 2 роки тому +4

    Amazing, detailed but easy to follow and understand!

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Thank you! What a great feedback. ⭐ Best, Benny

  • @Jay2Ops
    @Jay2Ops Рік тому +1

    Thanks for the video. I had toiled for hours.

    • @TypeScriptTV
      @TypeScriptTV  Рік тому +1

      Thank you for your comment. Producing this video becomes totally worth it when we can save precious hours in a developer's life. 😀 Best, Benny

  • @앤드류-d7c
    @앤드류-d7c Рік тому +1

    Thanks Benny! Great Video!

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Happy to help! All the best from Berlin. 🙌

  • @_indrid_cold_
    @_indrid_cold_ Рік тому +1

    Brilliant explanations!

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Thank you very much! ☺ Comments like yours are the currency I crave. 😁

  • @DanielSchmidt-le4og
    @DanielSchmidt-le4og 3 роки тому +5

    Great video, thanks Benny! Your tutorial video helped me a lot 🙌

    • @TypeScriptTV
      @TypeScriptTV  3 роки тому +3

      Happy to help! Windows 11 Build 22000 or higher even supports running Linux GUI apps: docs.microsoft.com/windows/wsl/tutorials/gui-apps

    • @AnasthassiaMurillo
      @AnasthassiaMurillo Рік тому +1

      @@TypeScriptTV do you recommend to update to Windows 11?
      I recently bought a Huawei laptop with Ryzen 5 5600 CPU and I've heard Windows 11 doesn't work so well with Ryzen processors and that makes me hesitant about updating to Windows 11.

    • @TypeScriptTV
      @TypeScriptTV  Рік тому +1

      @@AnasthassiaMurillo I have upgraded to Windows 11 a while ago and it's working well for me. 🙂 My desktop PC has an AMD Ryzen 7 3700X processor.

    • @AnasthassiaMurillo
      @AnasthassiaMurillo Рік тому

      @@TypeScriptTV thank you for your quick reply!}

  • @SreesaSarma
    @SreesaSarma Рік тому +1

    Amazing video !!
    Thanks a lot!

  • @LibraryOfTheOligarchs
    @LibraryOfTheOligarchs 11 місяців тому +1

    extremely helpful! Appreciate you!

  • @mohamedmagdy2816
    @mohamedmagdy2816 2 роки тому +1

    Good explanation, i really needed this video since i would start in kubernates project.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Happy to hear! Are you working on an Open Source project? :)

  • @aomo5293
    @aomo5293 Рік тому +1

    Thank you Bro, you helped me fixing one issue; may ALLAH gives you the best;

  • @vitaminsee
    @vitaminsee Рік тому +1

    thank you, this was very informative and easy to follow.

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Thank you so much for your kind words. All the best for your coding journey!

  • @dianaawino
    @dianaawino 2 роки тому +2

    Thanks alot....some really insightful info for beginners like myself👏👏👏👏👏

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Happy to hear that this was helpful for you. Are you also programming with TypeScript?

    • @dianaawino
      @dianaawino 2 роки тому

      @@TypeScriptTV yes...i'm quite new to the whole typescript experience.... and so excited🤓🤓 about this programming journey

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      @@dianaawino that's nice to hear! I am currently releasing one tutorial per week. Tomorrow I will upload a video which explains generic functions. If you like, you can subscribe to this channel to be informed about it. Best, Benny

    • @dianaawino
      @dianaawino 2 роки тому

      @@TypeScriptTV sure thing..thanks

  • @quachbinh0503
    @quachbinh0503 2 роки тому +1

    Exactly what I needed. Thank you so much.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Happy to help and thanks for leaving a comment. 👍 Best, Benny

  • @brunosoltoo
    @brunosoltoo Рік тому +1

    that's awesome! I thought It would be necessary to install vscode in the wsl distro too.

  • @forexmeter3900
    @forexmeter3900 Рік тому +1

    Very well explained, thank you!

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Thank you! Always happy to help. ☺ Best, Benny

  • @adefrawy
    @adefrawy 2 роки тому +1

    Great video, exactly what I needed. Thanks

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      Happy to help! Let's rock Linux together! 🚀

  • @lucareneambos3438
    @lucareneambos3438 3 роки тому +1

    Great Video!!! 🔥🔥🔥 Love the German accent! ♥

    • @TypeScriptTV
      @TypeScriptTV  3 роки тому +1

      I cannot hide my roots. 😂 Happy that you liked the video. 😊 Benny

  • @chacquito1862
    @chacquito1862 2 роки тому +4

    This was super helpful and clear! Very appreciated, thank you!

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      Thank you for your kind words. 🙇 Best, Benny

  • @johnkrumpotick8659
    @johnkrumpotick8659 2 роки тому +1

    You answered my questions, thank you.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Cool. Thanks for letting me know. 😊

  • @Александр-й8ы6и
    @Александр-й8ы6и 3 місяці тому

    Great tutorial, thank you!

  • @guidoperezmoro8331
    @guidoperezmoro8331 6 місяців тому +1

    You're awesome dude

    • @TypeScriptTV
      @TypeScriptTV  6 місяців тому

      Haha, thank you! But what about my video? 😅

  • @tur8008
    @tur8008 2 роки тому +1

    That's coool! Thank you!

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Glad you like it! Fist bump! 🤜🤛

  • @jinxinglim1855
    @jinxinglim1855 2 роки тому +1

    Really great video. thank you!

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Thanks for taking the time and posting a comment! 😊

  • @stephan19912710
    @stephan19912710 3 місяці тому

    Great video! Thanks a lot

  • @YouAreTheRaidBoss
    @YouAreTheRaidBoss 2 роки тому +2

    Stark Bruder!

  • @kwankunghkg
    @kwankunghkg Місяць тому

    After exiting WSL, found a memory hungry process "vmmem". Then googled for a while and found ...
    To turn off Vmmem, simply go into Powershell or CMD or whatever terminal you like to use under admin rights, enter the command wsl --shutdown .

  • @TechIdeasbd
    @TechIdeasbd 2 роки тому +1

    Good job mate.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Thank you very much! I hope my tutorial saves some people from hours of debugging. :D Best, Benny

  • @joemarcardio525
    @joemarcardio525 Рік тому +1

    Thank you sir!

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      My pleasure! 🙂 Greetings from Berlin.

  • @DheerajGudipati
    @DheerajGudipati 3 місяці тому

    Amazing! Thanks benny

  • @kritikjain3617
    @kritikjain3617 2 роки тому +2

    Thanks man!

  • @es7729
    @es7729 Рік тому +1

    Thank you!!!

  • @hazard9064
    @hazard9064 Рік тому +1

    thank you so much

  • @BrazilianDev
    @BrazilianDev 2 роки тому +1

    Very useful.

  • @aamnakamran6078
    @aamnakamran6078 3 місяці тому +1

    TYSM, it workedddd

  • @lapracity884
    @lapracity884 Рік тому +1

    Super helpful! why are u so close to the camera tho

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      I only had a fixed focal length lens available back at that time. 🫥

  • @rishiaman2
    @rishiaman2 11 місяців тому

    9:58 i dont have an .ssh directory

  • @runforfun8416
    @runforfun8416 6 місяців тому +1

    thanks,appreciate it

  • @sorcererstone3303
    @sorcererstone3303 Рік тому

    @5:14, Benny created a folder within the benny's directory for demonstration purpose.
    Can someone tell me where (which directory/folder) most people likely to place their development project in (and can be access through windows explorer and visual studio code)?
    I can create any new directory under Ubuntu directory (@ 4:37).
    Do I have to place all my project folders within one of the pre-existing folders/directories as shown in 4:37?

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Accessing files with WSL/Ubuntu from your Windows drive (example: /mnt/c) will be very slow. When you wish to access files from WSL in VS Code, then I suggest doing that inside your Ubuntu home directory (example: \\wsl.localhost\Ubuntu\home\bennycode\dev). Best, Benny

    • @sorcererstone3303
      @sorcererstone3303 Рік тому +1

      @@TypeScriptTV Thank you for the tips.
      When I read MS's docker desktop doc, it too emphasis not to use windows drive for development when using WSL2 for performance issues that you just mentioned.
      So, I am going to place all my projects in this dev directory you suggested. There are going to be a lot of such folders inside this dev directories!!

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      @@sorcererstone3303 great! Do you have a link to the Docker docs to share?

  • @dhairyashiil
    @dhairyashiil 2 місяці тому

    Great Video!!, Thank you.

  • @Zydres_Impaler
    @Zydres_Impaler 7 місяців тому +1

    Thanks a lot bro

  • @rishiaman2
    @rishiaman2 11 місяців тому

    11:28 i dont have nph

  • @supernova-4420
    @supernova-4420 10 місяців тому

    anybody know how to make .code-workspace files open a wsl workspace?

  • @bulbousdude
    @bulbousdude 2 роки тому +2

    Excellent video! This is exactly what I was looking for. Thank you!

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +2

      I was looking for a good tutorial on WSL 2 myself for a very long time. Happy I could support you with this one! Best, Benny

  • @M_SHEHU
    @M_SHEHU 7 місяців тому +1

    Thanks man

  • @xyz-123
    @xyz-123 2 роки тому

    after installing it is power limiting the cpu while running the codes on windows when iam unplugged to power in my laptop. For this reason my vs code in windows is running at restricted wattage to the cpu hence slowly. What can I do now? Note that there no problem when Iam plugged in.

  • @devij230
    @devij230 2 роки тому +3

    Great

  • @Calypso694
    @Calypso694 10 місяців тому

    can you use man pages with this and other terminal commands like make,cd,ls, etc etc etc.

    • @TypeScriptTV
      @TypeScriptTV  10 місяців тому

      Yes, you will get a complete Ubuntu terminal environment: apps.microsoft.com/detail/9pdxgncfsczv

  • @garimasingh8530
    @garimasingh8530 8 місяців тому

    Thanks a million

  • @jefersonlima3524
    @jefersonlima3524 2 роки тому +1

    Great video. Helped me a lot configuring my environment. A question for you: How you got that smooth fonts on Windows? They look a lot like Linux font rendering, not ClearType.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      Hey, happy that you like my video. I actually have "ClearType" turned on and I am using a 150% (sometimes 175%) scaling in my "Display" settings. Hope this answers your question! Best, Benny

    • @jefersonlima3524
      @jefersonlima3524 2 роки тому

      @@TypeScriptTV Thanks. It's answered.😁

  • @BilalKas
    @BilalKas 2 роки тому +1

    Danke, brauche fork und pipes für die Uni und mit WSL klappt das mega, wollte keine VPN oder eine richtige VM nutzen..

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      Freut mich, wenn dir das Video helfen konnte! Das WSL ist eine gute Alternative zu Cygwin, MinGW-w64 und anderen Tools. 🙂 Gruß, Benny

  • @dips_07
    @dips_07 Рік тому

    Great video 🤟...one concern is how to auto complete once i type on tab key in wsl terminal..for example want to go to "Home" folder once i type "H" and then click on "tab key" it should be auto complete to "Home"... please help with this

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      I'm afraid that this behavior is only functional in Windows' File Explorer and does not work in a Shell environment. 🤔

    • @dips_07
      @dips_07 Рік тому

      Okay 👍

  • @iangetwitch
    @iangetwitch 2 роки тому

    great! thank you

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      You are welcome. Happy to help. 🙂 Have a great day! Best, Benny

  • @Salah-YT
    @Salah-YT 2 роки тому +2

    thank u so much bro because u did help me a lot I did SUB + LIKE for u thank so much

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      That's great! Happy to hear. 🙂🙂🙂

  • @miture0502
    @miture0502 2 роки тому

    Hi, is it possible to reopen in container when using vscode plus WSL? When reopening in container, vscode automatically returns to the local machine rather in the Linux environment.

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Good question, does this extension matches your use case? marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers

  • @muazulislam398
    @muazulislam398 2 роки тому

    I am getting access denied, check permission when I try to open ubuntu/home/username directory

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      Yikes! On which version of Windows are you running? 🪟

  • @kirteek5334
    @kirteek5334 2 роки тому

    I watched this video just after I was done installing Ubuntu os 🥲 ... Is WSL will fulfill the requirements that one Linux based project requires.. coz setting up an whole environment in Ubuntu as well. For coding and stuf is again an hectic work I see...

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому +1

      WSL is a great option to get up and running with Linux projects on Windows. With Windows 11 you can even run GUI applications. 😲

  • @Arkadiytypical
    @Arkadiytypical Рік тому +1

    👍

  • @cocogoat1029
    @cocogoat1029 10 місяців тому

    I'm trying to learn assembly as a complete beginner to low level programming and every content creator is using some fancy CLI program while using Linux system calls on their program on their tutorials. I would've been more of a nightmare without AI tools.

  • @shiroclown6131
    @shiroclown6131 2 роки тому

    Why is vscode shared, but nodejs is not shared?

    • @TypeScriptTV
      @TypeScriptTV  11 місяців тому

      It’s because VS Code is build by Microsoft and they put effort into sharing it with the WSL. Node.js is separate and only lives within the Ubuntu installation.

    • @shiroclown6131
      @shiroclown6131 11 місяців тому

      @@TypeScriptTV wow that is not an expected answer. Thanks.

  • @bluebull399
    @bluebull399 Рік тому

    I still struggle to understand what docker desktop actually is or why it's needed.
    I use docker compose on WSL Ubuntu which I use to spin up demons of my app in Ubuntu.
    Can docker desktop do this? I run multiple instances of the app and am always spinning up and down those. A point and click interface would be a lot nicer than typing out Linux commands.

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Docker Desktop is just a GUI on top of Docker. It will allow you to manage your volumes and images. If you're already comfortable using Docker Compose in WSL Ubuntu, it might be more efficient to continue using it though.

  • @jimmyolano929
    @jimmyolano929 3 роки тому +4

    2:29 wsl --status

    • @TypeScriptTV
      @TypeScriptTV  3 роки тому +1

      You can use "wsl --status" to check your currently installed WSL version. If no version is found, you can install one using "wsl --install". I added these commands to the description of this tutorial. Best, Benny

  • @xyz-123
    @xyz-123 2 роки тому

    is it WSL 1 or WSL 2

  • @snarevideos
    @snarevideos Рік тому +1

    THANKS A LOT JESUS I LOVE YOU

  • @MJLee-wl6kt
    @MJLee-wl6kt Рік тому

    Is "Remote WSL" now rename to "WSL" ? I can't see "remote WSL" anymore.

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      Probably. Have you tried just using "WSL"?

  • @Capitan_Mega
    @Capitan_Mega 2 роки тому

    OK but I can't even download anything on my Microsoft store for 1 entire month... Nothing can fix it bruh NOTHING I SEEN 20 VIDEOS of how to fix my Microsoft store and NOTHING

    • @TypeScriptTV
      @TypeScriptTV  2 роки тому

      That's sad to hear but I just found a guide on how to install WSL2 and a Linux distribution without using the Microsoft Store: stackoverflow.com/a/64872285/451634 - Hope it works for you! 🍀🍀

  • @ninjanape
    @ninjanape Рік тому

    I would be able to hear better if the camera was a bit closer to your face

    • @ninjanape
      @ninjanape Рік тому +1

      great video though, thanks :D :D

    • @TypeScriptTV
      @TypeScriptTV  Рік тому

      @@ninjanape haha, I hope my close-up didn't startle you. I'm using a Sigma 30mm fixed focal length lens, so zooming is a bit limited. Nevertheless, I'm glad you enjoyed the video! 😀

  • @lator1941
    @lator1941 5 місяців тому

    Thanks man

  • @capthat8901
    @capthat8901 11 місяців тому +1

    Thank you!