I struggled all last week on my own trying to figure this stuff out googling each piece and not getting the clear consistent and concise instructions - Why did I forget - check RUclips first!! Works like a charm.... so far. I unfortunately lost my job in late June and I do not cope well with idleness. So with my son's encouragement, I have turned my turned my QNAP NAS into an unRAID Server and I am now trying to set-up NextCloud, but I needed more memory, so I am looking at running NextCloud in Ubuntu in WSL on my Desktop, but getting it configured and being able to access it remotely was very confusing before now. Baptism of fire for someone who grew up with Mainframes and Minis and first programming languages was Fortran and Cobol in the 1970's. However, your series of videos have made my learning path so much simpler. I just wish I discovered them a couple of weeks ago!
Duuuude, that's awesome, thank you so much. Still, I'll be happy when MS bolts on the "true" Ubuntu GUI later this year. Exciting time for computer programmers!
If you’re reading this comment be advised this video is now out of date. Microsoft has added Wayland support via RDP for windows subsystem for Linux in the windows insider builds, and it will be coming to main stream very soon. Of course the method described in this video does still work, but it is inferior to the Microsoft solution
Yall are gettin this and im still here waiting for microsoft to make an update that was supposed to come out in may work on my computer. Im so jealous lol
Great work and wonderful explanation, thank you! After several experiments I removed xrdp and installed X410 (X server for Windows 10). It works great.
Since windows diagnostic data is required to be fully sent to microsoft, there have surely been penetrative tests done to evaluate the integration between the operating system and the platformed sub-system.
hey hi, hope this was pinned, as you mentioned its pinned in video, had to sort comments and scroll all the way down here to find it great walkthrough, I tried some vnc stuff, but it seems more stable since its using rdp
lol... but I am not running Windows on my Mac. I am using VNC to remotely control the Windows laptop to my left and I'm installing Linux on the Windows PC. But, I can run Linux within Windows within MacOS if that is of interest :)
Believe it or not, Apple’s hardware has always made Windows OS’ shine in comparison to any PC. Their legacy hardware (e.g. 2013-2016) is still more than sufficient today, especially as a VM host. FYI: Not referring to a gaming platform, but as productive administration and computer workstation, they’re excellent.
I've added the Credge (Chromium based Edge) to my main linux box...don't use it much other than to look at OWA email...but it's fast and stable. I'm all for blurring these "Corporate Lines"....
Thanks a lot David, I learned so much from your videos! Btw - Ctrl + L to clear your terminal, saves you having to type 'clear' all the time :) *Bonus - Ctrl+U to delete everything you've typed if you mess up a command
Without question, this is the best tech how-to video I have seen on RUclips. Comprehensive, yet concise. No waffle. Just clear, well presented instructions. Well done and thank you!
Thanks for the wonderful video! :) One thing was that at first the rdp session did not connect and I found that I needed to update this key in the registry: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber This was still set to 3389. After saving and rebooting everything works as a charm :) If people might run into connection issues at first maybe this can help
There are pros and cons to both ways. It is nice to be able to do Linux stuff without rebooting. I mostly just use it because it makes it easy for me to remote into my Linux work computer.
I just wanted to say "thank you", I don't know what I can say more than that. 80 hours of valuable information, in the ccna course.. just for 20$ and with the sale 10$, it's almost free, why is that?.
I am getting the following when I start xrdp. steve432@asus_win8:/mnt/c/Users/Steve_2$ sudo /etc/init.d/xrdp start [sudo] password for steve432: * Starting Remote Desktop Protocol server [ OK ] steve432@asus_win8:/mnt/c/Users/Steve_2$ sleep: cannot read realtime clock: Invalid argument When I run the Remote Desktop Connection I can login but then the Ubuntu desktop turns black. My cursor is still there but nothing else. Anybody have any suggestions?
This appears to be a bug in WSL1. For some reason your Ubuntu probably runs on WSL1 by default. To fix run powershell as admin and enter these commands: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart wsl --set-default-version 2 After you've done this enter: wsl --list --verbose and you'll see that your ubuntu vm still uses wsl1, to fix this enter: wsl --set-version 2 In my case: wsl --set-version Ubuntu-20.04 2 This will start converting your VM to WSL2. After this is done it should work.
@@d_sanu same here, I'm able to connect via remote, I'm able to enter my username and password into the GUI interface and then the GUI screen goes black and shutdown.
Thanks for that. "WSLg" still doesn't appear to work on Win10 because they require a build of Windows that's not generally available, only through the Insiders program.
[Window Title] Remote Desktop Connection [Content] Remote Desktop can't connect to the remote computer for one of these reasons: 1) Remote access to the server is not enabled 2) The remote computer is turned off 3) The remote computer is not available on the network Make sure the remote computer is turned on and connected to the network, and that remote access is enabled. [^] Hide details [OK] [Expanded Information] Error code: 0x204 Extended error code: 0x0 Timestamp (UTC): 12/16/23 01:45:30 AM Press Ctrl+C to copy.
I seem to be experiencing some sort of crash. After I launch the RDP connection and I'm asked to select Xorg and enter my credentials, the window automatically closes after a few seonds.
Thank you very much for this tutorial. I've had a problem after setting everything up and using it for a while. It looks like after starting xrdp 50 times, the MaxSession value is reached and no more sessions are being created. I've made a pull request in your repository with the solution.
Excelent video!! Helps me a lot. I have only two questions, I want to ping to the ubuntu I have a destination host unreachable, How I can connect the Ubuntu with all my network? and If I have the ubuntu in my windows server, how I can connect to the CLI using other computer? Thank you.
Hello, David! This is awesome, thank you! One problem I'm having...the graphics and text in the Ubuntu 20.4 LTS GUI are REALLY really tiny. Unusually so. I have an Intel 620 graphics card, as well as an Nvidia GeForce 920MX, and I've updated the drivers and played with the settings, but to no avail. Do you happen to know what the problem might be and how I might fix it? Please let me know! Thanks.
When i close localhost and then i write the IP with ID and password, i have black mirror on localhost and ubuntu don't start. How i can fix this error?
I did thing for Debian on WSL2 it works great but xrdp does not start automatically. I have to manually enter exactly like this sudo /etc/init.d/xrdp start (if i go in this init.d directory and type xrdp start it does not do anything) Anyone know what I should do to start xrdp automatically?
This was an awsome tutorial Thanks David. Please tell me whether you had any problem of blank screen and window closes automaticaly after you sign in to your remote desktop as showed in 11:04 ?
Great video dude. The rdp session logs in nicely. It foes to sleep after few minutes of inactivity and I have to restart the xrdp server to get going again. Could you tell me how to prevent that from happening?
I've read that there are two methods of getting UI from a linux running on WSL2. One is running a remote desktop server on linux, which you have shown. The other is running an x window server such as xming's xlaunch, cygwin or VcXsrv and telling the WSL2 installation to set the DISPLAY environment variable to use the windows host's X-Server. Could you make a video about the second option and compare the two? Which one is faster? What's the ups and downs of either option?
@@thiagofialhos Se é tiozão é BR... kkkkk EU não estou usando o W11 oficialmente ainda. Nem testei o WSL2 dele. Mas já é bom saber que talvez eu encontre problemas se atualizar. Valeu!
At first this method worked for me, then when my computer went to sleep, it only shows me a black screen. I've tried reconnecting the session. How can I prevent this?
I am facing the same issue. You need to stop the xrdp server and start again. Unfortunately, this happens if there is a few minutes of inactivty as well, I haven't dound a fix for that.
@@Meganano everybody know that is possible to intall Ubuntu ALONGSIDE windows, this is the only realistic option for all the people that are still using windows. Installing ubuntu inside windows is something promoted by M$ because they always take economical advantages by creating big problems to users ( and locking them in a mess completely not needed and completely created my M$ also because their internal engineering problems).
I Managed to get a the original Ubuntu Desktop working using Windows VcXsrv by adding the following to the file ~/.bashrc sudo service dbus start sudo service gdm3 start sudo service alsa-utils start sudo sudo service keyboard-setup.sh start sudo service network-manager start /usr/bin/gnome-shell --mode=ubuntu NOTE: VcXsrv in windowed mode renders a wierd buffer zone around each Ubuntu app that you run but works perfectly in VcXsrv's full screen mode.
It's possible to undo the following commands? Or should I reset everything and just do it again? sudo sed -i 's/max_bpp=32/#max_bpp=32 max_bpp=128/g' /etc/xrdp/xrdp.ini sudo sed -i 's/xserverbpp=24/#xserverbpp=24 xserverbpp=128/g' /etc/xrdp/xrdp.ini they seem to have been too much for my bad pc...
"you may have to use a manual installation process to {install version 2004}" - the ONE THING Microsoft says NOT TO DO, because if 2004 is being withheld on your device it's because of a KNOWN INCOMPATIBILITY. - DO AT YOUR OWN RISK...HAVE BACKUPS!
I REALLY ENJOYED YOUR PRESENTATION, followed along with only one glitch. The WSL version still reports version 1 although I got a installed successfuly comment on the WSL 2 kernel install? Anyway I learned a lot and although no GUI prevents me running the two programs I did this for it was entertaining. Puts me in mind of a dos config.sys file in the 1980's. Book in one hand and one finger typing checking each character at least twice. But at least windows would run when I was done. Well off to see if there is any way to launch an actual program from a terminal window, or just manipulate files. Also might try to find a Linux download with all possible Linux files included. Thanks again for a great video.
You might enjoy this too - lets you run GUI apps individually through X11 using a toolbar or powertoys launcher (full disclosure: I'm maintainer of the project) github.com/cascadium/wsl-windows-toolbar-launcher
Thanks for the excellent tutorial. How to change it to its default desktop instead of xfce4? and what about if don't change the port to 3390 and keep the default 3389 will it work? how can I access it from another computer within my home network?
after login to localhost:3390 successfully and open my terminal from ubuntu to install browser its shows wrong passwd try again .............. could you help me i typed same pass from localhost login
What are the advantages of doing this rather than using a VM directly e.g. virtualbox, vmware, hyper v; where you can use a GUI directly from those apps instead and not have to use RDP?
I have 64GB of RAM, 4K Screens, NVIDIA Graphics Card (enhanced for gaming) and a Samsung m.2 SSD in my laptop and installing Ubuntu in VirtualBox is still slow even though I have a very powerful laptop. I think virtualbox is great for testing purposes but not to do web dev work or use it as a work station. Just my 2cents.
Hi David. I am facing a problem. It says Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable) How can I solve this?
Why would you have to run a VM when you already have Ubuntu installed through WSL just to get a Ubuntu graphical desktop? Does the act of installing Ubuntu through WSL Not really giving you a full Ubuntu distro? - I don't know that I'll need an Ubuntu graphical desktop but it would be nice. I'm trying to integrate a Multi Object Oriented server with my Discord server so I think I really just need the Unix like Terminal.. er.. which I have no clue how to access come to think of it if Ubuntu doesn't have a working graphical desktop.... I'm so confused.... I'm starting to think this project will be the death of me. LOL
xfce4 fails to install because of unmet dependencies (xfce4-settings, xfce4-session & xfce4-pulseaudio-plugin). Installing xfce4-settings shows more unmet dependencies (libxklavier16). After resolving this xfce4-settings installs nicely and apparently it also resolves xfce4-session. Installing xfce4-pulseaudio-plugin shows again more unmet dependencies (libpulse-mainloop-glib0 -> libpulse-mainloop-glib0). libpulse-mainloop-glib0 apparently requires libpulse0 version 1:11.1-1ubuntu7.10 and it fails to install because the newest version (1:13.99.1-1ubuntu3.3) is already installed. And this is where I am stuck.
when i try to connect them, these following errors pop up: 1. that remote access isnt enabled 2. the remote computer is turned off 3. the remote computer is not available on the network. P.S: and also how do i uninstall the GUI if i changed my mind to not have it
David, thanks for your thorough walkthrough, though I wans't able to to the RDP to my EC2 (I'm using Win 10). I followed all the steps in this tutorial, yet I get this error when I type in localhost:3390 : Remote desktop can't connect to the remote computer for one of the reasons: 1) Remote accesss to the server is not enabled Followed all the steps in this tutorial. I've been able to connect to my EC2 instance till last week, through PUTTY. For some reasons, PUTTY is refusing my "server (private) key". That's why I searched for your video. 2) The remote computer is turned off My EC2 instance and personal computer are up & running, with no issues. 3) The remote computer is not available on the network
Command: sudo apt-get purge xrdp This command not working for me. It shows like this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package xrdp I have seen some solution on stackoverflow, askubuntu and other but i can't fix it. please help me,
I've done everything correctly when I try to login to RDP from windows *Remote Desktop Connection* by entering my Ubuntu's username and password, nothing happend. No error, no success. Any suggestion?
David, great presentation with the new version of Windows 11 and the Ubuntu 22.04 I have tried and it just tries to login and disconnects over and over, and sometimes just sits at black screen. Lots of people saying it is multipole users in the Services and tried every fix out there but still no good. Have you seen this or is there a better GUI desktop for new WSL2?
Word of advice.. If you use any other kind of virtualization... Like if you're running Virtualbox vm's etc... WSL2 will take over and none of your other VM's will work anymore. Stick with WSL1.
Question: Attempting to connect via localhost:3390 fails with typical RDP error when no server exists at that address. However, if I attempt to connect to the IP address of ubuntu as reported by ifconfig, eg 192.168.x.x, I am able to connect as expected. How do I get localhost to work?
Can't connect with this message - [ ok ] Starting Remote Desktop Protocol server: sesman already running xrdp already running. Any help ? Update: Nevermind. I installed vcXsrv I did not install xfce4 but lxde I installed nedit and invoking it caused it to appear.
Hello David, thanks for your video. I followed step by step to your video and tried to repeat, but I could see the GUI just few minutes and after I had just black monitor. How I can uninstall everything? I want to try again. In your video you didn't do this command which is in your github: "sudo apt-get purge xrdp", is it important?
Does this statement makes worry while install or upgrading ? "1. Failed to retrieve kernel versions, 2. Failed to check for processor microcode upgrades 3. No VM guests are running outdated hypervisor (qemu) binaries on this host."
Awesome thanks! The only issue I'm having is trying to rdp to the linux. I use the IP:3390 and user I set up. Does not connect, unfortunately. If I have the ubuntu window open on the windows PC will this cause issues with the rdp from another PC? Also got portainer up and running on the local but again cannot access if from my other PC. Thanks
I have an issue with my remote desktop connection. The first time I opened Ubuntu on the remote desktop, everything was fine. I closed the session by clicking on the 'x' button on the bar at the top of the screen. However, on my second try, everything is black. The only available on-screen control is the bar that I spoke of earlier (deep blue, metallic). Any solutions? Thanks for reading!
Today I setup and used WSL for my pdf editing needs. It works as good as booting into linux itself. But how does this differ from VM? It's the same thing but simply without GUI? Passthrough? What is the point of this? I also could use cygwin for my small tasks.
gdm3 and lightdm are basically login display managers - they show the initial login screen and session chooser, they don't work without systemd enabled in wsl2. they don't work with rdp
I successfully installed and used XFCE4 on an HP system but when I did the same thing on an Acer system, I ran into an issue: When connecting to a session, thru Remote Desktop, I get a turquoise (blank NOT black) screen and the connection ends in a little bit. I have gone thru miles and miles of forum threads and tried every patch and solution to no avail. Since this was the first stop for me to get this thing running I thought coming back here I might get some answers, prior thanks
I got an issue. I accidentally pressed Lock Screen in Ubuntu GUI mode, and it's gone completely blank. I pressed Ctrl + Alt + F2, restarted Windows terminal and tried connecting the server again, but nothing helps. Can anyone please help to get rid of this black screen?
Brilliant idea, but I have had no luck in getting any of the scripts to run to update the WSL2 IP after it changes following reboot. This means I have to log onto the host instance each time, look up the IP, run the netsh script etc - it's just not worth it. Shame the IP cannot be fixed on the WSL2 instance, or localhost could be used - neither appear to be an option that works. Had to abandon LAN access, and stick to local. Might come back to this if the solution is improved at a later date. I have to say I enjoyed the tutorial, David, even though I failed in my final objective.
When I try to start xrdp service by command "sudo /etc/init.d/xrdp start" it returns "sleep: cannot read realtime clock: Invalid argument" Any idea to fix this?
I can connect from the same pc with rdp with the IP:3390 but not on another windows PC on the same network. Likely a permission or firewall issue. What do you suggest? I opened up port 3390 on the host pc. Thanks.
Little late to the game but... I didn't see where anyone has tried this on a 4K monitor. Running though the setup it works fine but the scaling is so small I can't read anything. Tried messing with xrandr but can't get it to accept any new modes... Anyone got any ideas??? Also changing Windows RDP display tab to a lower setting only make the screen smaller with scroll bars...Grrr
Ooooh yeahhhhh!! Great job David!
Thanks Chuck!
@@davidbombal
F
@@redacted671 I don't Hate Ubuntu.. it's just that Zorin is So much Better... LOL
@@davidbombal Sorry to ask. What is the name of the model of this chair? Very informative video by the way. :)
Chuck, you brought me here! Many thanks for your taster on Linux!
I struggled all last week on my own trying to figure this stuff out googling each piece and not getting the clear consistent and concise instructions - Why did I forget - check RUclips first!! Works like a charm.... so far. I unfortunately lost my job in late June and I do not cope well with idleness. So with my son's encouragement, I have turned my turned my QNAP NAS into an unRAID Server and I am now trying to set-up NextCloud, but I needed more memory, so I am looking at running NextCloud in Ubuntu in WSL on my Desktop, but getting it configured and being able to access it remotely was very confusing before now. Baptism of fire for someone who grew up with Mainframes and Minis and first programming languages was Fortran and Cobol in the 1970's. However, your series of videos have made my learning path so much simpler. I just wish I discovered them a couple of weeks ago!
Duuuude, that's awesome, thank you so much. Still, I'll be happy when MS bolts on the "true" Ubuntu GUI later this year. Exciting time for computer programmers!
Thank you. Agreed - it's going to be much better when Microsoft update WSL 2 to support a proper GUI
@@davidbombal Thanks and Great job on the video ! Would you know where can I follow up when MS is releasing a GUI for WSL?
@@davidbombal It's almost April 2021, has this happened yet? Are you going to do a video on it and should I wait before completing this tut?
@@HeathBilbrey it's 2022 September. No
If you’re reading this comment be advised this video is now out of date. Microsoft has added Wayland support via RDP for windows subsystem for Linux in the windows insider builds, and it will be coming to main stream very soon. Of course the method described in this video does still work, but it is inferior to the Microsoft solution
I don't think its working for me. When installing the desktop environment i get an error message when i am about to finish
Yall are gettin this and im still here waiting for microsoft to make an update that was supposed to come out in may work on my computer. Im so jealous lol
Awesome, worked flawlessly. I actually added tigervnc server which worked better than the remote desktop. RDP was laggy for me.
Thanks you so much. It's really helpful. Stay healthy David.
Really, helped a lot.
Thanks for making this video.
Great work and wonderful explanation, thank you!
After several experiments I removed xrdp and installed X410 (X server for Windows 10).
It works great.
Worked like a charm, thank you
Thank you David. Just installed it today. (-:
Thank you. It's a very helpful video.
If you could show how to get Gnome working using this method, that would really be something. I tried it but couldn't figure it out.
I don’t rdp works with gnome. You have to use vnc
@@JaskoonerSingh VNC sucks for multi monitor but RDP works great, unfortunately not with gnome.
Perfect David. Thanks.
Fantastic! Thank you sir :)
thank you i no longer have to dual boot
Since windows diagnostic data is required to be fully sent to microsoft,
there have surely been penetrative tests done to evaluate the integration between the operating system and the platformed sub-system.
Thx david, works fine !
Menu:
Overview: 0:00
Prerequisites: 1:20
Install WSL: 1:46
Install Ubuntu 20.04: 4:45
Install Ubuntu GUI: 7:25
Test RDP connection to the Ubuntu VM: 10:35
WSL commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
Ubuntu GUI commands:
sudo apt update && sudo apt -y upgrade
sudo apt-get purge xrdp
sudo apt install -y xrdp
sudo apt install -y xfce4
sudo apt install -y xfce4-goodies
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/max_bpp=32/#max_bpp=32
max_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24
xserverbpp=128/g' /etc/xrdp/xrdp.ini
echo xfce4-session > ~/.xsession
sudo nano /etc/xrdp/startwm.sh
comment these lines to:
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
add these lines:
# xfce
startxfce4
sudo /etc/init.d/xrdp start
Now in Windows, use Remote Desktop Connection
localhost:3390
then login using your Ubuntu username and password
Good links:
Microsoft GUI announcement: devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-build-2020-summary/
Ubuntu WSL2 GUI Install:
dev.to/darksmile92/linux-on-windows-wsl-with-desktop-environment-via-rdp-522g
WSL 2 install: docs.microsoft.com/en-us/windows/wsl/install-win10
Docker for WSL2: docs.docker.com/docker-for-windows/wsl/
What is WSL? docs.microsoft.com/en-us/windows/wsl/about
WSL documentation: docs.microsoft.com/en-us/windows/wsl/
WSL 2 Announcement: devblogs.microsoft.com/commandline/announcing-wsl-2/
Hi could ya please tell what difference in this procedure would be to try out other DEs?
Seems like a good way to experiment xD.
What about cinnamon DE what will change ?
the comment is not pinned
hey hi, hope this was pinned, as you mentioned its pinned in video, had to sort comments and scroll all the way down here to find it
great walkthrough, I tried some vnc stuff, but it seems more stable since its using rdp
Hi, Thanks. Could you make a video about how to install Debian+KDE under WSL2?
Thank you very much. A very good tutorial.
You are welcome!
One of the most blasphemous things to do in the world of OS, by running windows on a Mac, and then installing Ubuntu on the windows 😂😂😂
lol... but I am not running Windows on my Mac. I am using VNC to remotely control the Windows laptop to my left and I'm installing Linux on the Windows PC. But, I can run Linux within Windows within MacOS if that is of interest :)
@@davidbombalDon't get me wrong its very informative, just being sarcastic
Believe it or not, Apple’s hardware has always made Windows OS’ shine in comparison to any PC.
Their legacy hardware (e.g. 2013-2016) is still more than sufficient today, especially as a VM host.
FYI: Not referring to a gaming platform, but as productive administration and computer workstation, they’re excellent.
😂
What have you brought upon this cursed land!
🤣🤦♂️ Now install Powershell in the Ubuntu and it's complete..lol
lol... inception here we come!
I've added the Credge (Chromium based Edge) to my main linux box...don't use it much other than to look at OWA email...but it's fast and stable. I'm all for blurring these "Corporate Lines"....
Thanks a lot David, I learned so much from your videos! Btw - Ctrl + L to clear your terminal, saves you having to type 'clear' all the time :)
*Bonus - Ctrl+U to delete everything you've typed if you mess up a command
Good tips :)
@@davidbombal
Or make an alias for clear like c = clear
Without question, this is the best tech how-to video I have seen on RUclips. Comprehensive, yet concise. No waffle. Just clear, well presented instructions.
Well done and thank you!
Next: Install Chrome OS on a Linux inside Windows that is inside a MacOS.
Dear lord.
Linux, in windows, in mac OS
What have you DONE!!!
The world it’s crazy my friend ! Linux is unique and more powerful than others but humans are stupid
fumseck world Especially those that only swear by Linux...
It's like a turducken for operating systems!
@@ER_aka_RAM yeah you're right, freebsd is better.
Thanks for the wonderful video! :)
One thing was that at first the rdp session did not connect and I found that I needed to update this key in the registry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
This was still set to 3389. After saving and rebooting everything works as a charm :)
If people might run into connection issues at first maybe this can help
thanx this comment was helpfull
lov u thanks a lot
Mom, can we have Linux?
No, we already have Linux at home.
Linux at home:
Holy shiet!!! This is so funny 🤣
I had almost exact this conversation with my sysadmin at work.
There are pros and cons to both ways. It is nice to be able to do Linux stuff without rebooting. I mostly just use it because it makes it easy for me to remote into my Linux work computer.
I just wanted to say "thank you", I don't know what I can say more than that. 80 hours of valuable information, in the ccna course.. just for 20$ and with the sale 10$, it's almost free, why is that?.
Thank you Sam. Education should be affordable - especially for those in the world that have less.
@@davidbombal You are a treasure man. May Jesus Christ bless you!
I am getting the following when I start xrdp.
steve432@asus_win8:/mnt/c/Users/Steve_2$ sudo /etc/init.d/xrdp start
[sudo] password for steve432:
* Starting Remote Desktop Protocol server [ OK ]
steve432@asus_win8:/mnt/c/Users/Steve_2$ sleep: cannot read realtime clock: Invalid argument
When I run the Remote Desktop Connection I can login but then the Ubuntu desktop turns black. My cursor is still there but nothing else.
Anybody have any suggestions?
me also
Same, any idea what's going on?
same here, did any one of you figure it out already?
edit: trying a workaround now, will report back with the results
This appears to be a bug in WSL1. For some reason your Ubuntu probably runs on WSL1 by default. To fix run powershell as admin and enter these commands:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
After you've done this enter:
wsl --list --verbose
and you'll see that your ubuntu vm still uses wsl1, to fix this enter:
wsl --set-version 2
In my case:
wsl --set-version Ubuntu-20.04 2
This will start converting your VM to WSL2. After this is done it should work.
@@HionV IT WORKED! Thanks mate!
not working for me at remote connect
what happened exactly?
Same here
@@d_sanu same here, I'm able to connect via remote, I'm able to enter my username and password into the GUI interface and then the GUI screen goes black and shutdown.
where is the pinned comment??
"Ubuntu GUI commands:
See pinned comment as RUclips doesn't allow all the commands."
It's there. But you can use my GitHub instead: github.com/davidbombal/wsl2/blob/main/ubuntu_gui_youtube
This is now not working anymore
Thanks for that. "WSLg" still doesn't appear to work on Win10 because they require a build of Windows that's not generally available, only through the Insiders program.
I'm jealous of your internet speed 😂 over 200mb/s
u saw it too
200 mb/s is 1 byte per 40 seconds, which is absurdly slow...
You probably mean 200 MB/s.
@Vijay Narala I'm not joking. M stands for "mega", while m stands for "mili". Just as B and b differ, so do M and m.
where is the pinned comment whit the commands???
I was looking for it too. I recently formatted my pc 🤦♂️
It's there. But you can use my GitHub instead: github.com/davidbombal/wsl2/blob/main/ubuntu_gui_youtube
[Window Title]
Remote Desktop Connection
[Content]
Remote Desktop can't connect to the remote computer for one of these reasons:
1) Remote access to the server is not enabled
2) The remote computer is turned off
3) The remote computer is not available on the network
Make sure the remote computer is turned on and connected to the network, and that remote access is enabled.
[^] Hide details [OK]
[Expanded Information]
Error code: 0x204
Extended error code: 0x0
Timestamp (UTC): 12/16/23 01:45:30 AM
Press Ctrl+C to copy.
Thank you for all these awesome videos on Linux Subsystem. However, after a while the screen on the remote localhost goes black. Do you know why?
I had the same problem, you must go to setting -> power menager -> display and set "blanc after - never" .... and so on
I seem to be experiencing some sort of crash. After I launch the RDP connection and I'm asked to select Xorg and enter my credentials, the window automatically closes after a few seonds.
Have the pinned comments been removed? Can someone repost those commands
It's there. But you can use my GitHub instead: github.com/davidbombal/wsl2/blob/main/ubuntu_gui_youtube
Nice work!!
Can make a video about setup the wsl2 sound? (Pulseaudio)
Thank you very much for this tutorial.
I've had a problem after setting everything up and using it for a while.
It looks like after starting xrdp 50 times, the MaxSession value is reached and no more sessions are being created.
I've made a pull request in your repository with the solution.
gdm3 window did not appear for me. I followed all the steps correctly.
it will not appear in RDP, as systemd isn't enabled in wsl2
blank after input user and pass
Excelent video!! Helps me a lot. I have only two questions, I want to ping to the ubuntu I have a destination host unreachable, How I can connect the Ubuntu with all my network? and If I have the ubuntu in my windows server, how I can connect to the CLI using other computer? Thank you.
Seen other tutorials but was not able to RDP to the WSL. But after following the steps that you have shown, worked the very first time. Thank you.
Is anyone facing Black screen problem?
Hello, David! This is awesome, thank you! One problem I'm having...the graphics and text in the Ubuntu 20.4 LTS GUI are REALLY really tiny. Unusually so. I have an Intel 620 graphics card, as well as an Nvidia GeForce 920MX, and I've updated the drivers and played with the settings, but to no avail. Do you happen to know what the problem might be and how I might fix it? Please let me know! Thanks.
When i close localhost and then i write the IP with ID and password, i have black mirror on localhost and ubuntu don't start.
How i can fix this error?
ip adress changes everytime you reboot vm
I'm having the same problem! Have you been able to solve it?
I'm also having the same problem did you find any solution for this?
@@narayanmurthy8978 i don't
@anonymous1234 should we use this before, but closing the remote desktop server or after closing the server?
One of the best videos about this topic. Simple, short, and easy to follow. Well done!
I did thing for Debian on WSL2 it works great but xrdp does not start automatically. I have to manually enter exactly like this sudo /etc/init.d/xrdp start (if i go in this init.d directory and type xrdp start it does not do anything) Anyone know what I should do to start xrdp automatically?
This was an awsome tutorial Thanks David. Please tell me whether you had any problem of blank screen and window closes automaticaly after you sign in to your remote desktop as showed in 11:04 ?
I got the same problem, did you find the fix, thanks?
you can use MobaX instead, I have the same problem.
Great video dude.
The rdp session logs in nicely. It foes to sleep after few minutes of inactivity and I have to restart the xrdp server to get going again. Could you tell me how to prevent that from happening?
Same here! I'm considering alternatives to xrdp, but I would really like to keep it if possible, though. Did you manage to solve it?
I've read that there are two methods of getting UI from a linux running on WSL2. One is running a remote desktop server on linux, which you have shown. The other is running an x window server such as xming's xlaunch, cygwin or VcXsrv and telling the WSL2 installation to set the DISPLAY environment variable to use the windows host's X-Server.
Could you make a video about the second option and compare the two? Which one is faster? What's the ups and downs of either option?
The best tutorial I found on the entire Internet! The one that worked everything 100%!
Thank you for sharing!
Greetings from Brazil!
Didn't work where... But I'm using W11 :/
@@thiagofialhos Se é tiozão é BR... kkkkk
EU não estou usando o W11 oficialmente ainda. Nem testei o WSL2 dele. Mas já é bom saber que talvez eu encontre problemas se atualizar.
Valeu!
At first this method worked for me, then when my computer went to sleep, it only shows me a black screen. I've tried reconnecting the session. How can I prevent this?
I am facing the same issue. You need to stop the xrdp server and start again. Unfortunately, this happens if there is a few minutes of inactivty as well, I haven't dound a fix for that.
I got the same problem.
hello, I have a problem, I don't want to start sudo /etc/init.d/xrdp start, write it Starting xrdp (via systemctl): xrdp.service. what with this ?
same problem
I would recommend skipping rdp entirely and just pass your display to windows using something like x11
Exactly! Having an RDP window defies the very essence of using linux in the first place. A simple x11 forwarding to windows localhost does the job.
Ok maybe an explanation for those of us with a lower knowledge level. I understand rdp, etc but not passing the display
@@AnkitKumar-wq4kc Can you tell us how to do this like we are 5 years old?
@@timfoote6919 Please follow the comment I passed on to @mrmotofy. That will solve your issue.
Its 2021
Is the oficial GUI system promised by Microsoft still not avaliable???
I am also looking for it, still can't find it
Now install iOS in a VM in that Ubuntu WSL and restart the cycle! xD
Opens the remote control I enter id and password, but after a while it closes by itself. Some solutions?
yeah I have the same problem
Thanks can you do a tutorial on how to install Linux without Windows?
@@Meganano everybody know that is possible to intall Ubuntu ALONGSIDE windows, this is the only realistic option for all the people that are still using windows. Installing ubuntu inside windows is something promoted by M$ because they always take economical advantages by creating big problems to users ( and locking them in a mess completely not needed and completely created my M$ also because their internal engineering problems).
I Managed to get a the original Ubuntu Desktop working using
Windows VcXsrv by adding the following to the file ~/.bashrc
sudo service dbus start
sudo service gdm3 start
sudo service alsa-utils start
sudo sudo service keyboard-setup.sh start
sudo service network-manager start
/usr/bin/gnome-shell --mode=ubuntu
NOTE:
VcXsrv in windowed mode renders a wierd buffer zone around each Ubuntu
app that you run but works perfectly in VcXsrv's full screen mode.
Excellent videos! Love your setup and way of teaching.
Keep up the good work!
Thanks so much for the feedback Thomas, I really appreciate it.
It's possible to undo the following commands? Or should I reset everything and just do it again?
sudo sed -i 's/max_bpp=32/#max_bpp=32
max_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24
xserverbpp=128/g' /etc/xrdp/xrdp.ini
they seem to have been too much for my bad pc...
Microsoft should have told people during the infamous refund day "Don't worry guys, you'll be able to run Linux inside Windows ..... in 20 years"
"you may have to use a manual installation process to {install version 2004}" - the ONE THING Microsoft says NOT TO DO, because if 2004 is being withheld on your device it's because of a KNOWN INCOMPATIBILITY. - DO AT YOUR OWN RISK...HAVE BACKUPS!
so sad what ubuntu has fallen into. now its just another software installed on a windows machine
failed to execute default web browser after install firefox
I REALLY ENJOYED YOUR PRESENTATION, followed along with only one glitch. The WSL version still
reports version 1 although I got a installed successfuly comment on the WSL 2 kernel install?
Anyway I learned a lot and although no GUI prevents me running the two programs I did this for it was
entertaining. Puts me in mind of a dos config.sys file in the 1980's. Book in one hand and one finger typing
checking each character at least twice. But at least windows would run when I was done. Well off to see
if there is any way to launch an actual program from a terminal window, or just manipulate files. Also
might try to find a Linux download with all possible Linux files included. Thanks again for a great video.
great video! I followed it all and could remote connect to my ubuntu :) thanks
You might enjoy this too - lets you run GUI apps individually through X11 using a toolbar or powertoys launcher (full disclosure: I'm maintainer of the project) github.com/cascadium/wsl-windows-toolbar-launcher
Thanks for the excellent tutorial. How to change it to its default desktop instead of xfce4? and what about if don't change the port to 3390 and keep the default 3389 will it work? how can I access it from another computer within my home network?
after login to localhost:3390 successfully and open my terminal from ubuntu to install browser its shows wrong passwd try again .............. could you help me i typed same pass from localhost login
What are the advantages of doing this rather than using a VM directly e.g. virtualbox, vmware, hyper v; where you can use a GUI directly from those apps instead and not have to use RDP?
Wsl2 is pretty fast and integrated with windows terminal. 👍
I have 64GB of RAM, 4K Screens, NVIDIA Graphics Card (enhanced for gaming) and a Samsung m.2 SSD in my laptop and installing Ubuntu in VirtualBox is still slow even though I have a very powerful laptop. I think virtualbox is great for testing purposes but not to do web dev work or use it as a work station. Just my 2cents.
Hi David. I am facing a problem. It says
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable)
How can I solve this?
Why would you have to run a VM when you already have Ubuntu installed through WSL just to get a Ubuntu graphical desktop? Does the act of installing Ubuntu through WSL Not really giving you a full Ubuntu distro? - I don't know that I'll need an Ubuntu graphical desktop but it would be nice. I'm trying to integrate a Multi Object Oriented server with my Discord server so I think I really just need the Unix like Terminal.. er.. which I have no clue how to access come to think of it if Ubuntu doesn't have a working graphical desktop.... I'm so confused.... I'm starting to think this project will be the death of me. LOL
xfce4 fails to install because of unmet dependencies (xfce4-settings, xfce4-session & xfce4-pulseaudio-plugin).
Installing xfce4-settings shows more unmet dependencies (libxklavier16). After resolving this xfce4-settings installs nicely and apparently it also resolves xfce4-session.
Installing xfce4-pulseaudio-plugin shows again more unmet dependencies (libpulse-mainloop-glib0 -> libpulse-mainloop-glib0). libpulse-mainloop-glib0 apparently requires libpulse0 version 1:11.1-1ubuntu7.10 and it fails to install because the newest version (1:13.99.1-1ubuntu3.3) is already installed.
And this is where I am stuck.
when i try to connect them, these following errors pop up:
1. that remote access isnt enabled
2. the remote computer is turned off
3. the remote computer is not available on the network.
P.S: and also how do i uninstall the GUI if i changed my mind to not have it
David, thanks for your thorough walkthrough, though I wans't able to to the RDP to my EC2 (I'm using Win 10). I followed all the steps in this tutorial, yet I get this error when I type in localhost:3390 :
Remote desktop can't connect to the remote computer for one of the reasons:
1) Remote accesss to the server is not enabled
Followed all the steps in this tutorial. I've been able to connect to my EC2 instance till last week, through PUTTY. For some reasons, PUTTY is refusing my "server (private) key". That's why I searched for your video.
2) The remote computer is turned off
My EC2 instance and personal computer are up & running, with no issues.
3) The remote computer is not available on the network
Thanks for good excellent tutorial. This works flawlessly. Have to look settings for web browser later. After installing Firefox, it will not start.
very helpful - many thanks David! I look forward to the official Microsoft WSL2 GUI Support solution however in the meantime - this is great :)
Agreed. The official Microsoft solution looks great. Hopefully that will be released soon.
Command: sudo apt-get purge xrdp
This command not working for me. It shows like this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package xrdp
I have seen some solution on stackoverflow, askubuntu and other but i can't fix it. please help me,
I've done everything correctly when I try to login to RDP from windows *Remote Desktop Connection* by entering my Ubuntu's username and password, nothing happend. No error, no success. Any suggestion?
David, great presentation with the new version of Windows 11 and the Ubuntu 22.04 I have tried and it just tries to login and disconnects over and over, and sometimes just sits at black screen. Lots of people saying it is multipole users in the Services and tried every fix out there but still no good. Have you seen this or is there a better GUI desktop for new WSL2?
Word of advice.. If you use any other kind of virtualization... Like if you're running Virtualbox vm's etc... WSL2 will take over and none of your other VM's will work anymore. Stick with WSL1.
Question: Attempting to connect via localhost:3390 fails with typical RDP error when no server exists at that address. However, if I attempt to connect to the IP address of ubuntu as reported by ifconfig, eg 192.168.x.x, I am able to connect as expected. How do I get localhost to work?
Can't connect with this message - [ ok ] Starting Remote Desktop Protocol server: sesman already running xrdp already running.
Any help ?
Update: Nevermind. I installed vcXsrv
I did not install xfce4 but lxde
I installed nedit and invoking it caused it to appear.
Hello David, thanks for your video. I followed step by step to your video and tried to repeat, but I could see the GUI just few minutes and after I had just black monitor. How I can uninstall everything? I want to try again. In your video you didn't do this command which is in your github: "sudo apt-get purge xrdp", is it important?
Does this statement makes worry while install or upgrading ?
"1. Failed to retrieve kernel versions,
2. Failed to check for processor microcode upgrades
3. No VM guests are running outdated hypervisor (qemu) binaries on this host."
Awesome thanks! The only issue I'm having is trying to rdp to the linux. I use the IP:3390 and user I set up. Does not connect, unfortunately. If I have the ubuntu window open on the windows PC will this cause issues with the rdp from another PC? Also got portainer up and running on the local but again cannot access if from my other PC. Thanks
I have an issue with my remote desktop connection. The first time I opened Ubuntu on the remote desktop, everything was fine. I closed the session by clicking on the 'x' button on the bar at the top of the screen. However, on my second try, everything is black. The only available on-screen control is the bar that I spoke of earlier (deep blue, metallic). Any solutions? Thanks for reading!
Today I setup and used WSL for my pdf editing needs. It works as good as booting into linux itself. But how does this differ from VM? It's the same thing but simply without GUI? Passthrough? What is the point of this?
I also could use cygwin for my small tasks.
gdm3 and lightdm are basically login display managers - they show the initial login screen and session chooser, they don't work without systemd enabled in wsl2. they don't work with rdp
I went through all the process. But after connection the linxu display is not appearing and RDP gets disconnected. Pls revert
I successfully installed and used XFCE4 on an HP system but when I did the same thing on an Acer system, I ran into an issue:
When connecting to a session, thru Remote Desktop, I get a turquoise (blank NOT black) screen and the connection ends in a little bit.
I have gone thru miles and miles of forum threads and tried every patch and solution to no avail. Since this was the first stop for me to get this thing running I thought coming back here I might get some answers, prior thanks
I got an issue. I accidentally pressed Lock Screen in Ubuntu GUI mode, and it's gone completely blank. I pressed Ctrl + Alt + F2, restarted Windows terminal and tried connecting the server again, but nothing helps. Can anyone please help to get rid of this black screen?
Brilliant idea, but I have had no luck in getting any of the scripts to run to update the WSL2 IP after it changes following reboot. This means I have to log onto the host instance each time, look up the IP, run the netsh script etc - it's just not worth it.
Shame the IP cannot be fixed on the WSL2 instance, or localhost could be used - neither appear to be an option that works. Had to abandon LAN access, and stick to local.
Might come back to this if the solution is improved at a later date.
I have to say I enjoyed the tutorial, David, even though I failed in my final objective.
When I try to start xrdp service by command "sudo /etc/init.d/xrdp start"
it returns "sleep: cannot read realtime clock: Invalid argument"
Any idea to fix this?
I am facing same issue
same for me
same for me
I can connect from the same pc with rdp with the IP:3390 but not on another windows PC on the same network. Likely a permission or firewall issue. What do you suggest? I opened up port 3390 on the host pc. Thanks.
Little late to the game but... I didn't see where anyone has tried this on a 4K monitor. Running though the setup it works fine but the scaling is so small I can't read anything. Tried messing with xrandr but can't get it to accept any new modes... Anyone got any ideas??? Also changing Windows RDP display tab to a lower setting only make the screen smaller with scroll bars...Grrr