- In this video I'm gonna
show you a number of things. I'm gonna show you how
to get WSL version two up and running on a Windows 10 computer. In a previous video which
I've linked here and below, I showed you how to do that, but I showed you how to do that using the graphical user interface. So in this video, I'm gonna show you how to
do that using PowerShell. Just allows us to do
things very, very quickly. But I'm also gonna show
you how to get an Ubuntu VM up and running on WSL. In this case Ubuntu 20.04. And I'm gonna show you how to
get a graphical user interface up and running on Ubuntu. I'm gonna show you how
you can remote to desktop, to the Ubuntu VM running
within WSL version two. Okay let's get started. (upbeat music) As mentioned I'm gonna
show you multiple things in this video. First thing is installation
of WSL version two. Then I'm gonna show you how to
get an Ubuntu virtual machine up and running with the WSL version two. Then I'm gonna show you how to set up the graphical user interface. Use this menu and the menu below to jump to a specific topic. So if you're not
interested in for instance, getting WSL version two up and running, because you've already got it working, then jump to the relevant
topic in this video. Now in this example I'm doing everything on this Windows 10 laptop. I'm controlling the laptop
using VNC from my Mac, but I'm doing everything
on this Windows 10 laptop. First thing make sure that
you've got the right of version of Windows 10. You need at least version 2004. If you haven't got that version, go to Windows update and make sure that you
update your Windows computer to that release. Now some people have had issues getting this release of
Windows up and running on their computer. You may have to use a
manual installation process to do that. So once you've got your computer updated run PowerShell as an administrator. So I'm gonna click yes to
run this as administrator, here's PowerShell. First thing you need to do
once you open PowerShell as administrator is to enable the Windows subsystem for Linux. I'm gonna simply copy this command from the Microsoft documentation, but I've put all the
commands below this video. Which will hopefully help you
get the setup very quickly. I've added commands to
set up WSL version two, but I've also added the commands to get the graphical user
interface up and running on Ubuntu. So I'm gonna simply paste
that into PowerShell. You can see that to the
feature has been enabled. Next step and as you can see here, they mentioned that you need version 2004 is to enable the virtual machine platform. So I'm gonna copy that
command from Microsoft and paste it in. Operation has completed successfully. We're told that we need
to restart the machine. So restart your computer. As you can see Windows
updates are being applied and the computer's been rebooted. Once it reboots log back in, you can check whether
your features are enabled by going to turn Windows
features on or off. Scrolling down here. I can see that the virtual
machine platform is enabled as well as the Windows
subsystem for Linux. That's how you enable it through the GUI if you prefer using the GUI. Next step is to set the
version to WSL version two. So PowerShell. Copy this command to set
the version to version two. Now notice WSL requires an
update to its kernel component. You can use this URL to
find out the details. So copy that URL. We need to download the
latest WSL to Linux kernel. So I'm gonna click on that
link to download the software. This is only a small
application 13 meg in size. So I'll show that in folder. Double click on the MSI, click run. And I'm told that this will update the Windows subsystem for Linux. Click next. Click yes to allow it to make changes. That's now completed. Now that that's been done, I'll copy the command once again to set the version to version two. So that's been done now. If I type wsl-l-v, you can see that no Linux
distributions have been installed. So I can install them
from the Microsoft store. So back in the documentation, they basically tell us to do that. We can go to the Microsoft store. So I'll do that. Go to the Microsoft store
and search for Ubuntu. Now they're various releases of Ubuntu. I could run 18.04 LTS. I could run 20.04. I'm simply gonna take this version, which is actually gonna give
me the latest release of Ubuntu at the time of this recording. It's 20.04. Now I've previously installed this. So I've got the install option. If you don't have that click
get and then click install. So I'm gonna click install. Software is downloaded. It's about 430 meg. So that's now completed. And what I can do now is
launch the virtual machine. I'm told that it's installing
and may take a few minutes. I'm asked to create a
default Unix account. This does not need to
match my Windows username. I'm simply gonna use David, specify my password, retype my password. And as you can see, I've now got Ubuntu up and running on my Windows 10 computer. Back in PowerShell using
the command wsl-l-v, shows me that I've got Ubuntu running. The WSL version is version two. So that's how you get and
Ubuntu virtual machine. This is a lightweight virtual machine running within WSL version
two on a Windows 10 computer. In my example here, I'm using Windows Home. I'm not using a professional
version of Windows. This is Windows Home, running on a laptop with an i7 processor, eight gig of RAM. But I've essentially got
Ubuntu up and running on this computer. Lsb_release-a shows me
my version of Ubuntu. Now in other videos, which I've linked here and below, I show you how to use Windows terminal. Windows terminal makes us very easy. So as an example I can select Ubuntu here. PWD shows me my home directory, LSB_release once again shows
me my release of Ubuntu 20.04. You don't have to use the Windows terminal if you don't want to. You can just use the built in terminal that you get with Windows. But in my example I'm gonna
use the Windows terminal just because it's very nice. It has tabs, very nice interface. So now that we've got
Ubuntu up and running, let's get a graphical user
interface up and running on this Ubuntu virtual machine. Now in May, 2020, Microsoft announced that they will bring
graphical user interfaces to WSL version two. At the time of this recording
that's still not available. It's probably scheduled
for the later part of 2020. So in this example I'm gonna show you how to get a graphical user
interface up and running on Ubuntu so that you can RDP directly to your Ubuntu virtual machine running within WSL version two. This is a workaround at the moment while we wait for Microsoft to release. The built in RDP or
remote desktop solution in WSL version two. The first thing to do is
to do a sudo apt update and sudo apt upgrade. I'll put in my password. References are updated. And the software is updated. Now you don't necessarily have to upgrade your virtual machine. Just good practice. So that's what I'm doing here. That's done. I'll clear the screen. I'll now use sudo apt
install XRDP to install RDP. I've once again listed all
the commands below this video. If you just wanna copy those rather than try and get
them from the video. XRDP is installed. I'll clear the screen. Let's install a lightweight
graphical user interface. So XFCE4. Now you have a choice. I'm gonna use GDM3 as my
graphical user interface. That's completed. I'll clear the screen again. I'm gonna install additional software. So XFCE4-goodies. I'll clear the screen again. Now we're going to do some
configuration of XRDP, so I'm gonna backup the
XRDP configuration file so that I have a backup of it. You don't have to do this, but it's a good idea to
backup stuff like this. So if you make a mistake you
can just restore your backup. What I'm gonna do is change the default port of 3389 to 3390. You don't have to do that once again, but I'm doing that so that I
can use a different port number to the default, make sure that there are no conflicts. I'm gonna increase the resolution by increasing the bits per pixel. So those two commands
just allow the quality of the RDP session to be better. I'm basically RDPing
to myself here locally. So make sense to have good quality. I'm gonna save that to X session. And what I'm gonna do is
use nano simple text editor to edit this XRDP startup script. Go right to the end. So just go right to the end and comment out these last two lines. So I'm gonna simply comment
out those two lines, and then I'm gonna add
an additional two lines. So we're gonna start XFCE. Ctrl + X, save the file. And there you go. I've saved that file. And now that I've saved the file, I'm gonna start up XRDP. So the RDP server's now started. So now that that's been done, I can test my connection and I can use a local host port 3390, because that's the port we
changed the RDP server to use. And if I click connect I'm told that the identity of the
server can't be verified, do I wanna connect? Yes I do. I've got an RDP session
to my Ubuntu server. I'll login with my username and password. If you get an error here, it's probably because you've used the wrong username and password. So I'm gonna click okay
to log into my server. And there you go I RDPead or opened a remote desktop
to my Ubuntu computer. So just to prove the point
here is my Ubuntu server. So this is the CLI
lsb_release gives us that. IP address gives us that. This is the IP address of the server. In my RDP session, I'll click on applications, terminal editor, I'll zoom in here. So just make this a bit bigger. Lsb_release-a shows me my release, IP address shows me that
this is the same server. I'm working on the same server. Now the interface is different. I'm using a lightweight GUI interface here rather than the default. Notice what happens though when I try and open up a web browser, I get an error. So what I'm gonna do is type
sudo apt install Firefox. So that I have Firefox
as my default browser. So I'm now installing Firefox
on the Ubuntu virtual machine running within WSL version two, running within my Windows 10 computer. So that's done. I'll click on this icon again and notice I have Firefox
running on my Ubuntu VM, running within WSL version two. I'll type date today
notice there's the date. So there you go. I'm able to connect to the
internet using a web browser, installed within Ubuntu
within WSL version two on my Windows 10 computer. I'll close this because I'm sure people are gonna ask me this question. You don't have to use local host. You could go to 24.105.187 like this. This is using a natted address. So I'm able to connect to the
virtual machine by IP address. Now that's how you get a
graphical user interface up and running on Ubuntu. Have a look at the links below this video. I found a really good article and I've linked to that below this video that really helped me set this up. If you enjoyed this video, please consider subscribing
to my YouTube channel. Please like this video, and please click on the
bell to get notifications. I'm David Bombal. I wanna wish you all the very best. (upbeat music)