Windows Subsystem for Linux (WSL) runs Linux graphical applications without issues (video, 14 minutes)
Scott Hanselman dives into the new features of Windows 11, focusing on the Windows Subsystem for Linux (WSL) and Windows Terminal in his latest video. Windows 11 users can now run graphical Linux applications seamlessly via WSLg. Scott starts by demonstrating his Windows Terminal setup, which automatically detects installed shells like PowerShell and the DOS command prompt, saving users significant time. He also emphasizes the customization options available, allowing users to edit settings via a graphical interface or directly in the JSON file. This level of control over the terminal's appearance and functionality is impressive.
He illustrates how users can quickly install Linux distributions, such as Ubuntu or Debian, using the command WSL --install. Scott showcases the installation process of Debian, which is subsequently auto-detected by Windows Terminal. Users can run multiple Linux distributions, providing them with great flexibility to work in different development environments. The integration of these platforms within Windows 11 is truly remarkable.
Scott continues by demonstrating how to install Linux applications and their integration with Windows. Users can quickly install applications like “Giggle” or “GIMP” using simple terminal commands and can launch them directly from the Start menu. He comments on how applications launched in Windows 11 maintain the Linux aesthetic rather than looking like native Windows applications. This functionality provides an extraordinary user experience as it allows for efficient multitasking.
The video also covers how editors like Visual Studio Code work effortlessly with Linux applications. Scott shows how these applications can run side by side, making it easy to switch between environments. Developers can enjoy the best of both worlds, which is an exciting moment for programmers.
Finally, Scott summarizes that the capabilities Windows 11 offers create a unique time for developers, who can utilize full-screen terminals and virtual desktops efficiently. As of this writing, Scott's video has garnered 456618 views and 13587 likes, highlighting the community's interest in the new features of WSL and Windows Terminal. He encourages viewers to explore these solutions for maximizing their Windows 11 experience.
Toggle timeline summary
-
Introduction to Windows 11, WSL, and Windows Terminal
-
Running graphical apps with WSLg on Windows 11
-
Demonstrating Windows Terminal features
-
Customization options in Windows Terminal
-
Installing WSL and setting up Linux distributions
-
Installing Debian through WSL
-
Listing installed Linux distributions
-
Demonstrating running multiple Linux distributions
-
Exploring Linux applications available on WSL
-
Installing and accessing Linux GUI applications on Windows 11
-
Seamlessly integrating Linux applications with Windows
-
Running Visual Studio Code within WSL environment
-
Using Linux terminal inside Visual Studio Code
-
Demonstrating sound support for Linux applications on Windows
-
Accessing WSL files through Windows Explorer
-
Encouragement to try Windows 11 and WSL
Transcription
Hey friends, I'm Scott. Let's take a developer's look at Windows 11 specifically WSL and the Windows Terminal Along with WSL G the ability to go and run graphical apps built-in on Windows 11 I'm just gonna flip my camera around so that when I point I'll be pointing up here at the the screen I'm in Windows Terminal Windows Terminal comes with Windows 11 and when you run it it will automatically detect most of your prompts like Windows PowerShell and the original DOS command prompt here. I have PowerShell core now called PowerShell 7 It also detected a bunch of the Linux's that I have installed. I'll talk to you about how I did that as well You can also put on custom Linux's like SigWin or git bash by just editing those settings This is all done very easily. You can just go and say settings You can have these different profiles over here or you can edit the JSON file directly So you have a lot of control over your terminal right now. I've got it a little bit See-through a little bit transparent here. I can make it more transparent more glassy or less transparent I'm holding down ctrl shift and I'm scrolling and then I've also added this PowerShell logo over here You might ask yourself why that's because when I go into other prompts I want to have a graphic there so I can tell the difference and then sometimes I like to go and say Open this chevron I'm going to hold down alt with my thumb and then click and then I've got split screens Then I've got my logo here and then my logo over there and I can hit ctrl W to Close that tab all of these things being set in the settings. I can do it either Graphically in the settings UI or I can go and bind things myself so you can see here I bound close pane to ctrl W things like that So you have a lot of control if you don't like the UI? Well, you can get rid of the UI you can actually just go like this I just hit alt enter and now I'm in a full screen terminal and again I can hit ctrl shift scroll and make that all go away So a lot of control here again built in and included now if you want to you can type WSL dash dash install I'll do another video about my prompt later. You'll notice that I've got a lot of customizations I've also updated my prompt with oh my posh to include the current directory the current git a branch whether or not I've got one or added file or one Modified file as well as the current version of dotnet that I'm running in the visual studio visual studio icon And then a human heart that tells me the current error level because if I type something silly I want the heart to turn red. That's not the point of this video What we're gonna do instead is I'm gonna type WSL dash dash install. I've also got a bit of a history picker here as well That's nice. We'll do a whole prompt video at some point So I've been WSL dash dash install and if you don't have the Windows subsystem for Linux installed It will go and pop up and say cool. I will get you a Linux that will go and install Ubuntu It'll set all the settings reboot your machine and you'll come back into the Windows terminal and you will have a Linux Ubuntu instance automatically set up you'll notice that I did that and I already got these installed now if I want I could say WSL Dash dash install and we'll say Debian Okay Now it's gonna go and actually get that for me. It's downloading Debian right now Installing it and it's easy to install because it's just a tar file and look Setting it up You put in a Unix username and a password Hope I typed it right twice. I don't feel like I did. Yeah, I'm gonna try again But you pick up a do darn it What is my password? Typing it too fast Sweet. Okay, cool. There's Debian now when I close my terminal and Then run it again Pull this down Auto-detected our new Linux Now I can have multiple Linux is installed so I can type WSL dash dash list dash V for verbose And you can see that I have my default one. That is Ubuntu I'm on 1804, but I've also got 2004 installed and then the Debian that we just installed moments ago so I can have n Number of these where n is any number I can click here and I can open up Ubuntu And I've got my nice logo here, and I've also set up a color A Color scheme that I like called Ubuntu legit That I've got it just up on my github if you want and then I can also go and again holding down alt and clicking On Ubuntu I can have split-screen. I can run H top to prove it now. I'm gonna come back over to the left I'm gonna hit ctrl W Here's H top I'll hit Q to quit and you'll notice that I've also modified my prompt here in Ubuntu to look the same But I can prove to you that it is really Ubuntu by saying LSB release dash a and you can see this is in Fact a real version of Ubuntu, and it's running right now on my Windows machine It is using a tiny tiny Utility virtual machine, but you'll notice that these Linux's start very very fast. Oops. That's a cloud shell Start very fast. Let's go and just start a bunch There we go, so I've just started five Linux's they're all different something went wrong. Thank you Alexa go away Don't want to talk to you right now Close it close it close it close it boom. There you go. Isn't that cool now? Here's where things get interesting Let's go and grab some Linux application. Let's look at this list of awesome Linux applications Open-source gaming platform. We've got different clients. Let's try a get client Get I what's this? Now when Windows people typically go and find something That's for Linux. They go and they search the web. They find a Linux thing. Oh shoot. This only works on Linux That's us. That's that's a bummer. I can't figure out how to do that So it looks like Giggle is a thing, how do I get it? Go on Google for Giggle Giggle install Ubuntu There we go, let's try that So Install Ubuntu There we go Let's try that I'm just gonna paste that in directly and you'll notice that Linux Goes and set it up. Now. We hit the Start menu here. I want to point this out. Look what happened right here Let's just pause for a second and drink this in Windows 11 Notice that we installed this Linux GUI app and added a link to it for us here in the Start menu. So now I can go and run this app And here it is Look at this And notice Notice The window is not a Windows looking window. Is it that is painted by Linux. What we've done here is we've done all the work in Linux. It's a real Linux environment. We're handling all of that work Automatically and then we're remote desktoping into a seamless version of this seamless version of this You can actually see how the corners are nice and we can go and open up into an existing repository on the file system Let's go ahead and go into home Scott let's grab my you know, my website and we'll say okay Look at this. I am on Windows 11 and I'm looking at the git repository for my own website In a tool Written for Linux it just works. That's actually C sharp right there. Let's try another let's try another one Let's try something else. What else we got to choose from here. Ah the GIMP Let's do that. Let's go and actually click on all apps and then we'll click on it. Boom. There we go I actually clicked on a boon to rather than the group. I picked on a boon to itself I'm actually going to go and say You and I'm going to open this one up. That's what I wanted to do for you And we see here. We've got an emacs media player. Let's click on the GNU image manipulation program or the GIMP Look at that So here we've got the terminal And I can go and open an image Works just fine and that's like now i'm in a Linux windows a Linux application on Windows You notice that it's wicked fast, but I can also click on file system and go to mnt and click on the mount point And I can also click on the mount point and I can see that I'm in a Linux application You notice that it's wicked fast, but I can also click on file system and go to mnt and click on the mount point And we actually have mount points here To our windows file system so we can go back and forth so my Linux applications can access my windows file system and back and forth And here we've got emacs And we've got giggle, but then I could go and start up for example You know visual studio code Which is a windows application So now i've got these apps all running side by side And then if I wanted to All right, check this out. We could come out to linux. We'll go into my hanselman Folder we're on the linux file system here and i'm going to type code dot In linux, it's installing the vs code server for x64 and it's going to actually unpack that locally Launch the windows version of visual studio All right install the packages that I need For linux And you'll notice here in the corner Visual studio code knows that we're talking to ubuntu even though we are now running the windows version of this I've got full intellisense. I can run it and if I want to check this out Inside of visual studio code I can click on terminal Lsb release-a I'm in visual studio code on windows 11 And then I can run my linux terminal here. You get the best of both worlds. You might say why why not just run linux? I like running windows runs all my games. I like the ui. I like the File explorer. I enjoy the terminal. I have a lot of fun with it but And what this allows me to do is have the best of all worlds. I can move seamlessly between all of these applications I can run my website .net run We're going to go and start up on localhost localhost 5000 I can now hover over that notice how that's underlined I can actually click on That which fires up my website locally Isn't that cool It's a really really really interesting time right now to be a Developer particularly in the windows space because you can do anything you want. You can run docker You can run linux you get this wonderful terminal again. I can go full screen We also have the ability to do of course virtual desktops, which is great All of these things work seamlessly And if you want to read more about wslg Go and search for w wslg architecture And there's a great article here By steve who is on the team and he talks about the philosophy of it How weyland and weston and rep rail works, but what you want to look at specifically is this This is this great diagram that explains the relationship Between your applications that run within your user distribution your debian your ubuntu, whatever and the separate Windows maintained distro that handles everything. Here's the crazy part. Okay, even sound works Think about that sound on linux works on windows Let's see that work. That'll be our that'll be our finale. Don't you think? Sound works. Let's go and jump to our home directory. We'll run mpv, which is a Movie player on linux and we'll go and run it on a video for you. Look at that Sound works on windows on linux Scandalous what a lovely thing that is And I ran it from the command line Last thing I want to point out if I go and start up the explorer the windows explorer We can actually go to Down here Linux appears in the Windows explorer in the windows explorer if I click on that it will actually show the files so I can access all of my Files directly from windows explorer And that video that I just played is sitting right There So again moving seamlessly between windows and linux. It works. Great I would encourage you to check it out. Go get windows 11 type wsl dash dash install Go install visual studio code. You're going to have a blast and And I'll again i'll go and do a how to set up your terminal video soon as well. Thanks y'all