Open GUI apps on Windows Subsystem for Linux (and on Raspberry Pi)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my name's Gary Sims and this is Gary explained so when I made my video about windows subsystem for Linux it dealt with command line programs of course that left the question how do you run graphical user interfaces from WSL through to your Windows desktop and that's the question I want to answer today in this video along the way we're also gonna look at how you can send a program for display from a Raspberry Pi onto another Raspberry Pi and have a graphical user interface program be sent from running on one Raspberry Pi through to your Windows desktop so if you want to find out more please let me explain okay so the foundation of windowing systems on Linux and UNIX type operating systems is this thing called the X windowing system and it's basically a network protocol and a set of libraries and a set of standards that allow a program to do graphical things across a network and that went through various revisions until you finally end up with version 11 which we call x11 and that's been around since the kind of the mid late 1980s now x11 allows you to run a program on one computer and rather having it displayed on the monitor attached to that computer it can be displayed on another workstation another terminal across a network and this comes back from the days when you had kind of mainframe computing or mini computing where what basically the programs would run with lots and lots of users 10 20 30 40 hundreds of users all connected to a big computer and then each person would have their own terminal their own workstation that they could display programs on terminal it didn't have to have very much computing power it didn't have to have a disk didn't have to have much memory it just be aware of being up to display the graphics that are being sent across the network and that still works today when you boot up a Linux machine when you boot up a Raspberry Pi at the very heart is still this x11 protocol and that means we can use that to display different programs across the network and onto a different computer before we get into that though it's worth just having a an interesting to think about the philosophy behind this and I kind of the history of computer science do you remember way back this is kinda like dealing with the 70s and the 80s you've got this idea of kind of client-server so everything happened on a big server and you had a kind of a weaker client that was able to display things from them then we got the ear of the PC the personal computer where everything was local to me and of course that gave me you know gaming as well faster user interfaces because I had access to the local hardware including the GPU and of course now we've gone full cycle again today we're streaming video the streaming 4k films from Netflix and Amazon or whatever service you're using and now of course we're dealing with streaming of gaming so the GPU isn't even in my local device anymore it's over on some big computer and then it's screamed over to me so just as a note for those who are interested in computer science from a historical point of view things do tend to go around in cycles an idea and architecture a system has been used in the past will again come to the forefront of course it will be different it will be improved it will have different ideas but basically here we are again now coming back to this idea of streaming things over a network to display graphics 4k video even games on a weaker Dumber terminal where all you need is an input control keyboard or joystick or keypad whatever you're using and then actually the hard work is done somewhere else so we're going to use that very idea now in actually displaying programs from windows subsystem for linux and also from a Raspberry Pi ok let's go and do it ok so the first thing the choice how to display a window from one Raspberry Pi on another Raspberry Pi and why we're doing that is because well first of all it's useful but also because of course this is running Linux it's got all of that X stuff all there x11 all the libraries all the networking all that all built in you don't have to anything at all it comes all for free so the first thing I do is show you that at the IP address of this Raspberry Pi so you can see that I am connecting to one board so here it is 192 168 dot 1.44 and before we connect to the otherwise with PI we are just going to disabled authentication for what Windows what device are allowed to display windows on this PI it just makes life really easy clients can connect from any host now in a home network in your house this isn't going to be an issue in a workplace it would be more of an issue and obviously anything that's got public access but accessibility to it would be a real issue but here in my private LAN this isn't an issue so it just makes this demo a lot easier so what I'm gonna do now is I'm gonna secure shell over to a different Raspberry Pi that's here on my network one is like the 1.11 okay type in the password no it's not secret or password or one-two-three-four you know that okay so now I'm on a different machine so again if I do IP well you know I've just connected to it but if I do IP address show we can see here that it is in fact 192 168 1 11 as I just said so what I'm gonna do now there's two ways we can do this the first way is being a second what's called the display variables what you do is you say display okay that's a variable that you set is equal to 192.168.1.5 4 that's the Raspberry Pi we have connected from that's the one with this desktop is okay and we have to do : one because I'm running here on VNC so VNC technically not with physical monitor it's a virtual monitor so the physical monitor would be zero and the virtual monitor here is going to be one when we do this later we're gonna see a case where we do it to zero if it doesn't work for you always try zero one maybe two because you'll find out which one it is in the end so we set that very simple and then we just type here export display so that variable is now available to other programs and it's simply this if we now type leaf pattern notepad that you get with gnome now I'm running on eleven here but this desktop here is dot forty-four look at that up comes by a little my little notepad here in fact what we can do is if we go into the background here if we do an LS here are some files now if we do touch this is dot eleven dot text there we go okay so that's on the dot eleven machine if we go over to here now and say open we can see that under really there's that file this is dot eleven okay but if I was to actually log out of here now or open up another window is better to say on the original one that that file isn't there this is PI one that is definitely a thing but this is not the PI there so what I've shown is I'm actually running this program on one PI and having it displayed on the other and I've got I can run web browser I can run development environments I can run another terminal I can do anything I'm now using two PI's one as a display on one actually to power though to actually run the program now I said there's two ways to do is if we disconnect from here we're now back on our original PI if we just to show the address here dot forty-four there it is we're now back on our first by the one here with the desktop now rather than setting all that display stuff another thing you can do is you can say secure shell added in a go but if you include - why pie at 192.168.1.1 what the widest my set y - y sorry says is that you can using secure shell it wants to send any X traffic any of that window traffic over this same connection so then we don't need to setup all that stuff with display and everything it automatically already done so now again here I am on that other machine I've just secured shelling but if I it straight away type leave pad it comes up here so again I'm now connecting to running a program here if we had open we'll see that file there it is PI this is dot eleven okay it's a different different PI and just by connecting to it with the - wire parameter means that any program any GUI program I run will automatically be displayed on the on the other desktop on this other machine so that's a really easy way to connect okay so the next thing we want to try is can we go from the PI back to Windows now to be able to go from the PI to Windows you're going to need an X server a thing understands the X protocol will Ibis and all that for windows because when it doesn't come with it by default and you can use VC X serve Windows server and I'll leave a link in the description below it's on SourceForge and it's a really easy program to install you literally just download it run the program Next Next Next whatever and it just installed and it's really really simple to install not very complicated ok and it's open source ok and it's here available for free from the source forge website once it's then installed you then need to run a program which it which come with it called X launch so what we're gonna do there is we're gonna type X launch and it basically says how do you want to run your X server we'll have multiple windows that's the easiest one let the display be set automatically ok don't start any actual particular programs and I'm just gonna tick here disabled access control again just makes the demo easier rather than worrying about who and who can't connect and that's it so now it's actually running and you don't see anything actually it's down here in if you go down to your the clock you can see there'll be an icon running down there ok so now let's go back to our Raspberry Pi now to connect to our Raspberry Pi I'm going to use the putty program which is a secure shell program you can get for Windows and I'll leave a link into the description below if you've not used it before how to install it very very simple to install again a standard Windows program and what we're gonna do is we're gonna connect to our Raspberry Pi remember 192 168 dot 1.11 ok so we put the address in there but we have to do one thing if you're out here in this left-hand menu to SSH and then 2 X 11 want to say enable that X forwarded which means I want all that traffic that allows you to send the x11 protocols over this secure shell and so we click on open and then a window pops up which allows us to login to PI and type in that password so here we are I've just connected through now to a PI and if I now type in leafpad that notebook program look what happens it comes up on windows so there we go there's a terminal and this here is a a linux program running under that linor that Raspberry Pi and it's come through here to my Windows desktop and if I look here under the PI desktop this is dot 11 so I'm actually running now a program on my rod with PI but rather having to use VNC to connect through to the desktop I'm actually getting it over x11 this is working oh it is in big capital letters to shout x11 forwarding look at that so you could do this for anything you can start Chrome you can start whatever you want and you can actually have Raspberry Pi in fact this works for any Linux server it not just Raspberry Pi any Linux server coming up on your desktop which means you can have multiple windows open some are open on the actual native machine your Windows machine and some are open on other devices fact this is how I've been doing my computing ever since you know I was working at dec Digital Equipment Corporation with boxes and ultrix and Unix many many many moons ago this is how we did it all because it was all distributed computing in the sense it was client-server computing all the different nodes that you were using all the different computers we lose we're all over the place on the network so there we go so we can exit out of that and so now the next thing that we want to do is to see how we can actually get windows subsystem for Linux to display programs like that okay so here is my windows subsystem for linux running this is the terminal that gives me access to Ubuntu here and if we do for example a cat of size et cetera slash OS release it says with his Ubuntu 18 point Oh for long term support now previously before I didn't I've actually installed leafpad and you do that using apt-get install leafpad very very standard command for for unix for linux sorry for Ubuntu and what we do is we do as we did on that very first Raspberry Pi board we set the display so we don't need to use secure shell because we're already this is on this Windows machine so we say so display is equal to 1 to 7.0 to 0.1 that's the local IP address and now on 0 : 0 knock : one we used : one before because it was that VNC this is the physical monitor which connected now by the way if you want a video on these addresses 127.0.0.1 and 192.168.1.1 ever let me know in the comments Carl make a video about these special IP addresses that we often use in our homes and our home networks okay so we set the display and then we'll just do that export display exactly as we did on the Raspberry Pi but now we're using Ubuntu as part of the windows subsystem for Linux and that's it we now type leafpad and there alias up it comes I am now running leafpad on my Windows machine and there you go there's a txt file already created this is WSL dot txt and if we just put back into the background there and do an LS they go this is this is w SL dot tex so using my ubuntu windows subsystem for linux I've got leaf pad and it's now running here and of course again you can run any GUI program that you can get for Linux for Ubuntu runs under WS l you can get it displaying here on your Windows desktop all because of that VC X serve that I showed you and you just download it and install it and it's very very simple as that okay that's it okay so there you have it I really hope you enjoyed the power there the x11 gives you for displaying programs all over the place now there is another step that could be taken with a wsl map to run a full desktop over this kind of x11 protocol I didn't show you that because act I don't think there's any point in bootable Windows machine and then using and then having a second desktop it's much more powerful to have individual apps pop-up integrated into your existing desktop ok that's it my name is Gary Sims this is Gary explained already hope you enjoyed this video if you did please do give it a thumbs up don't forget to subscribe please don't forget to check out the news speed test G channel which also has a Twitter account speed test underbar g and i suppose that's about it I'll see you the next one
Info
Channel: Gary Explains
Views: 125,711
Rating: undefined out of 5
Keywords: Gary Explains, Tech, Explanation, Tutorial, X11, Linux, Raspberry Pi, X11 Forwarding, SSH, Putty, Windows Subsystem for Linux, WSL, xeyes, Ubuntu, Raspbian, export DISPLAY, GUI apps on WSL, VcXsrv, X11 server, X11 server for Windows, WSL GUI apps, Linux apps, Windows desktop
Id: ymV7j003ETA
Channel Id: undefined
Length: 15min 36sec (936 seconds)
Published: Mon Sep 30 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.