Install Desktop GUI in Ubuntu Server on Oracle Cloud and configure Free RDP connection
Vložit
- čas přidán 12. 02. 2022
- How to install xfce desktop environment in Ubuntu server 20.05 on Oracle cloud, install xrdp and configure iptables and OCI VCI to allow Free RDP connection to the server.
🔔 SUBSCRIBE: If you find my videos helpful, you can support me by subscribing and leaving a comment. / @techtute
Commands executed in the video (make sure to retype every occurrence of < and > simply copy and paste would not work:
- Connect to the server
ssh -i /path/to/key ubuntu@server_ip
- Switch to root and set password for root
sudo su
passwd
-Install desktop env. and xrdp
apt install tasksel (technically not needed, I have times when xubuntu-deskto would fail to install without tasksell)
apt update
apt upgrade
apt install xubuntu-desktop
apt install xrdp
-Enable set xrdp to suto start on reboot
systemctl enable --now xrdp
systemctl status xrdp
-Add ingress rule in iptables for port 339 and reload the config (see video)
nano /etc/iptables/rules.v4
iptables-restore < /etc/iptables/rules.v4
-Set xfce in the .xsession file
echo xfce4-session >> ~/.xsession - Věda a technologie
Thank you very much, you are a life saver. I have tried many tutorials, only this one has worked.🤟🤟
Glad to hear that
You got straight to the point and every step was easy to follow. Thanks.
Thanks, I'am glad you like it!
Cool! Non have given complete steps like you that solves all potentials issues with the connection.
Glad it helped
This was extremely helpful, thank you!
Glad it was helpful!
Great tutorial. Works like a charm. Big thanks
Thanks I’m glad you liked it!
Thank you very much! You might be bored reading this, but you saved my day ;-)
Glad to hear that!
Very helpful, thank you.
Glad it was helpful!
You are the man. Thank you ❤️
I am glad you liked it!
really helpful! thank you!
Glad it was helpful!
It's work. Thank you
You're welcome!
Thanks for sharing
I had issues connecting throught Remote Desktop, but I fixed my problem reading Market Chaos here in comments
One question: Which OS/GUI would I choose to perform some testing with python selenium? Any recommendation?
Hi Manner, I don't have experience with Selenium as far as I know it runs on Windows Mac and Linux so I would say choose the OS you are most familiar with.
@@TechTute thank you.
thanks for sharing, i have successfully create rdp
Thank you for choosing to watch my content!
Hello. Indeed a very good tutorial, thanks for putting it together!
I know you posted it quite some time ago, but if you don’t mind, I have a question. After all the steps, I’m able to RDP into the server but it doesn’t show the desktop - it shows an auth window “xrdp Just Connecting” that asks for session (Xorg, Xvnc, etc), username, and password. Do you know what credentials go there? Thanks a bunch!
so that would be the credentials fro any user that you aould like to connect with that has .xsession file created. In the video you can see that I was logged in as root and I created .xsession file in ~/.xsession whihc is root's home directory, so I rdp connected with root and roots password. You cna do that with any user on your system just create .xsession file for any existing user you want to rdp with and make sure the user has password set and you should be able to rdp.
@@TechTute Thanks, that helped! I was also logged in as root but hadn't set a password. So I set a password and I was able to get past the auth window (good news!), but after some seconds I get the error "A problem has occurred and the system can't recover. Please log out and try again" 😞
I don't expect you to debug this with me, just letting you know it helped. Thanks again!
this is a very generic error so it will be har to tell whats going on. did you try rebooting your server or/and restarting the xrdp service? Also look the /var/log/syslog see if you can get more detailed information from there.
thanks! worked on 1st try
Thank you!
thank you sir, i tried 4 hours for vnc and failed, but this worked with one try!, thank you again
You are welcome!
Hey I think your tutorials are great. I followed the one on setting up an Oracle virtual machine and it worked perfectly. This one was great too except that the setup of the remote desktop was not really covered. Could you provide more detail on that part. Thanks,
Hi Hector, thank you for the feedback, I am glad you find my videos helpful. Would you please clarify, are you talking about Microsoft Remote Desktop for Mac or the xrdp? Thanks!
@@TechTute I'm talking about the Microsoft Remote Desktop for Mac. I've downloaded it but don't know how to set it up. It's the part in your video at around 7:20. Thank a lot for the quick reply!
Oh I see what you are talking about, I totally breezed through it around 4:25. So basically all you have to do is click on the "Add PC" button and then on the next screen PC Name enter the public IP of your oracle server. You can leave everything else the way it is, or if you want you can customize it. Then click "Add" button on the bottom right and you will see you new connection. Double click on it, it will prompt you for user name and password and that should do it. Let me know how it goes if you cant figure it out, I can try to make another video that expands on it. Thanks!
@@TechTute I finally figured what the problem was. I put the .xsesson file in the wrong directory. It's working now! Thanks!
Hi, great tutorial! Xfce seems too heavy for Oracle Cloud Free Tier. I followed your instruction and everything worked but it was very slow and easily hung on me, had to reboot from control panel. Wondering if LQXt would be better? I replaced it with Xfce but when I remote desktop to it, it requires me to choose Window Manager, while there is nothing to choose from! Wondering if you can create a similar tutorial for LQXt. Thank you
Hi, I have never tried LQXt but I have video with LXDE and KDE in witch I am showing how to speed up remote session by disabling compositing. czcams.com/video/YNutlZreJgo/video.html
If you still have your Xfce server try doing it by going to the applications menu and clicking settings -> window manager tweaks. This will open a new window. Open the Compositor tab, and uncheck the option Enable display compositing make sure youbreboot. I will all look in to LQXt when I get a chance.
@@TechTute Thank you so very much for reply. I absolutely appreciate your time and passion to teach others! Unfortunately I terminated my xfce session because it was very slow and was freezing as soon as I was trying to work with it by opening a couple of apps. I checked the video you mentioned. Really nice! I heard that LXQt is replacing LXDE and it is much lighter and functional. (I know almost nothing about Linux! I'm just following instructions here) So I hope you check it and if you find it the best desktop to be used in Oracle Cloud, one day you have a video about installing Ubuntu and LXQt from scratch. Otherwise I'll do my best to install Xfce and then use your second video to add LXQt, and search about how to remove Xfce at the end. Thank you again!
UPDATE:
Successfully installed LXQt but when I log in in xrdp, it is just blank screen with mouse pointer moving. I used different desktop managers like gdm3, sddm or lightdm but same result.
@@AlirezaYami I just did LXQt with sddm on Ubuntu OCI and it is working fine. What does you .xsession file looks like?
@@TechTute I think I put lqxt-session instead of xfce4-session
Note sure, Already deleted it and doing it all over again.
If you find it much faster than xfce, I and probably others will appreciate if you create a quick video for it too 🙏🙏🙏
@@AlirezaYami I think you are right, it does feel like it runs faster than xfce. I’ll make a video on it when I get a chance , in the meantime try with “startlxqt” in the .xsession
Also make sure to disable compositing under Settings-Window manager tweaks - Compositor tab, uncheck enable compositing. Make sure to reboot after.
Thanks for the tutorial. What about installing chrome or firefox browser to this virtual machine? I can't find a functional browser installed. Is there an app market or depot like environment?
Try Chromium it is opens source browser that Google Chrome is based on. In your terminal type "apt install chromium"
@@TechTute I tried but cannot run after install, then I turn back to humble Firefox...
@@hayrettinyildiz8018 what do you meant "cannot run after install", cant you open terminal and run the command in there?
@@TechTute Nothing happens, not starting when you try to run. Probably It has some dependencies. I try to run with clicking program icon.
@@hayrettinyildiz8018 Yeah I assume it's due to a problem with sandbox and root.
I have another question for you. I setup an webserver on oracle cloud vm. I setup self signed ssl but it gives me an error on chrome since it is not registered to an authority. Do you have any idea how can I solve the issue.
The only way to have your browser trust your self-signed certificate would be to add the certificate to you local trusted certificate store. If you want your website to be trusted by everyone on the internet then you will need to obtain 3rd party signed cert. You can get a free one from lets encrypt I have a video on how to do so with apache2. Let me know if you have more questions or need some help. czcams.com/video/SO11Og_WgSs/video.html
I am having a problem. I'm on Windows to be clear, but when I use the Remote Desktop Connection app, I enter the hostname (IPv4 address), and root as the username, it returns with an error that says something like:
"Remote Desktop can't connect to the remote computer for one of these reasons:
1) Remote access on 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."
I followed your tutorial perfectly, barring my substituting xubuntu-desktop for ubuntu-desktop. I was trying to login as root as well. I tried this twice on two separate instances. No luck.
Hi Justin, it sounds like either xrdp isn't running, or port 3389 is not open. Can you confirm xrdp is running on, your server and listening on 3389. Then from your PC try to telnet to your server on port 3389. "If you get Could not open connection to the hoston port 3389"that means your port is not open and you will want to check your iptable rules and OCI security list ingress rules to make sure 3389 is allowing connection from the internet or your public IP. Let me know how it goes.
If I want to try a different desktop environment (e.g., MATE or Lubuntu), do I need to change the .xsession file?
I also see that a screensaver is running after I reconnect, what's the best way to disable that, and are there any other unnecessary services we should be disabling for this setup?
Hi Michael, yes you will need to call the desktop environment from the .xsession file. So for example if you want to try mate, you will first need to install mate via apt or the tasksel app, and then you need to add mate-session in the .xsession file for the user you are planing to use to remote in to the server. I have never tried libuntu but it definitely works on mate.
To disable/manage ScreenSaver in xface go to Applicattions -> Settings -> Power Management -> Display tab. As far as disabling services, I cant really make a recommendation, I personally disable any service I know I don't need.
I'm having the black screen issue after the xrdp login, how do you guys deals with that? running windows. peace
That usually happens if you are already logged in locally with the user you are trying to xrdp with. Try logging out and then try to xrdp.
Hi great video. Really helpful. I’m stuck at the edit iptables to add 3389 as nano /etc/iptables… command I get command not found and if I run without nano I get permission denied. Any advice or help would be wonderful.
I wonder if you installed Ubuntu minimal O think it ships without nano. Anyway try running "apt install nano" and then try to edit iptables config.
@@TechTute Thanks a bunch. Will feedback ASAP.
@@robkage np
@@TechTute still no luck now I see the bottom of the page with the options
@@TechTute I have a frozen screen with no information very confused
this is the only tutorial that works
Thanks!
You did an amazing job. Can you setup an oracle linux 8 on oracle cloud. I tried but not failed enough.
I am assuming you are asking if I have successfully setup GUI on Oracle 8 on OCI. The answer will be I have not tried. I will give it a try tonight and I will let you know how it goes.
Hi Mustafa, I wasnt able to get xrdp working on Oracle Linux 8, but I got it to work with VNC server. Here is a link to my latest video czcams.com/video/Uokf-4mSGMY/video.html let me know what you think about it. Hope you find it helpful.
@@TechTute Yes. I did it on centos 7 but could not on oracle.
Just ❤
Thanks!
Hi nice tutorial. However when I try to edit the rules.v4 I get that the file is unwritable and permission denied. Any reason why and how to change it?
If you are editing the file while logged in with user other than root, make sure you run “sudo” before the command you run to open the file (e.g. sudo nano /etc/iptables/rules.v4)
@@TechTute Hi thanks a lot.. it worked. I'm having another problem. When I try to login the rdp suddenly crashes. Any issue with xrdp?
@@emudavid4655 I would start by checking the xrdp logs to see if there is any clues there. Do “tail -f /var/log/xrdp.log” and try to connect to see what the log says.
can i access over internet WAN rather than localhost?
Yes you can. In the video I am connecting from my Mac Book to a remote server on Oracle cloud via the internet.
Now the main issue is Firefox will not allow keyboard entry any idea on how fix this issue. None of the other browsers will even launch, Chromium, Vivaldi, Falkon 🤦♂️
If you look in the older comments @Nahidnp had the same issue, and he was able to resolve it but I am not sure what he did. Hopefully he sees this post and reply.
@@TechTute I’ll have a root around for his comments thanks.
i use default account
username ubuntu
connection log
connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to session manager, please wait
login failed for display 0
Sorry for the delayed response, never got notification for the post. Make sure you are entering the correct password for your user, if you are using the default ubuntu user make sure you have password set.
I did everything but my system is very very slow. What do I do?
Hi Pedro, when you say “my system” is slow so you mean that the instance is slow or just the Remote Desktop session?
can you help to install browser with ubunto 20 , its come without browser and give me this error "E: Invalid record in the preferences file /etc/apt/preferences.d/mozillateamppa, no Package header" everytime try to install any broswer
how do you try to install a browser? Did you try "apt install firefox" for example to get firefox installed?
@@TechTute i did try via terminal, yes i try installing firefox but i fail, try with other browsers got sam error massage
@@karimragab416 what do you get if you run "apt update" ?
Some how I missed the actual error in your first message. What is in "/etc/apt/preferences.d/mozillateamppa" ? I would say go ahead remove then run "apt update" and then try to install firefox.
when i try to remote into it it says a problem has occurred and the system can't recover
this is a very generic error, have you looked in the logs to see if you can get more information from there?
@@TechTute i fixed it but now i can't type in the browsers
@@flash_15
How did you fix it?
for some reason for me the user interface after remote connecting is SO SLOW, could you help me out please?
I don't know if there is much you can do about it, big part of it has to do with your network speed and proximity to OCI datacenter. Have you tried LXQt instead of xfce, It works much smoother for me, and I have heard others saying the same?
If you installed and setup xfce by following my tutorial, all you need to do to install lxqt is run "apt install lxqt sdm" once installed successfully open the ~/.xsession file and replace "xfce4-session" with "startlxqt" save the fire and try connecting again. Check out the link of the video I have listed below for detailed instructions. Also make sure you disable "compositing" on LXQt this will definitely make it run faster, its' towards the end of the video
czcams.com/video/onjz8AYMqwo/video.html
@@TechTute alright mate i will give a try, i was using remote desktop connection (RDP) from windows to connect and i didnt use xfce or lxqt
@@kaidouz7756 what desktop envare you connecting to?
@@TechTute im using arm64 processor and ubuntu 20.04
Hello, I’m a beginner please can you send me the command line from the beginning to the ending.. thanks in advance sir😊
Hello!I just put them in the description of the video. Thanks for choosing to watch my video and please subscribe for my channel for more videos like this.
when i try to login it says a problem has occured and system cant recover. and show a logout button below
please help
Did you get any errors during installation? Maybe try reinstalling xubuntu-desktop environment?
@@TechTute ah idk what was the issue but i deleted the xubuntu and installed ubuntu-desktop. it works fine now. Thanks
@@TechTute i was just exploring how a ubuntu gui works in a server with 24gb ram and 4 cores
its slow, dk why
@@axl0709 not sure either, its generally caused by slow network connection.
@@TechTute idk, the network connection on my end should not be a problem. i did tested the download speed through installing the Firefox Browser first and then downloaded a test bin of 1 gb. it was weird that the max speed was just 800kb/s though the instance bandwidth speed oracle claim is 4 gbps
hey there I got login failed for display 0 error how to fix it
Can you double check your username and password? This usually indicated the username or password are wrong.
@@TechTute do you know how to check my password
@@TechTute i also did not give any passwords as well
@@TechTute oh yeah i found my password thanks dud
Great tut. U owned a sub. but i cant type anything in firefox in that server. weird issue only in firefox.
That's weird. Did you ever get it figured out?
@@TechTute Not yet!! Gonna try a fresh installalation.
@@Nahidnp that sounds like a good idea :)
@@TechTute fixed it. The issue most probably persist on root user. No t sure. But thanks for a great tutorial.
@@Nahidnp Hi @TechTutelage pointed me your way. How did you manage to sort out the keyboard entry fail as I’m having the same issue? Though my workaround has been copy and paste 🤷♂️ so far as I’m not using a browser heavily but to add apps etc onto the build
is this faster than vnc???
Yes, RDP is faster than VNC.
i need ultra fast ubuntu 20 with gui and rdp you can help me with this
What do you mean by “ultra fast” what r u trying to accomplish?
@@TechTute ultra fast, ubunmtu 20 with only gui, rdp and terminal
I don't think I can help you with this.
@@TechTute ok man very thank you
💙Thanks so lot for your video! All works well! 𝗜'𝘃𝗲 𝗼𝗻𝗹𝘆 𝗮 𝗹𝗶𝘁𝘁𝗹𝗲 𝗯𝗶𝗴 𝗽𝗿𝗼𝗯𝗹𝗲𝗺?! I cannot open tcp ports I've needed to run an application. I've created an instance with Ubuntu 22.04 and Arm-based processor (standing in free tier). I've followed your steps, adding also the tcp ports I need like 80, 25, 465 and 7050:7099 within «nano /etc/iptables/rules.v4.» Next, I checked the list open ports with command "netstat -lntu" or "ss -lntu" but the same ports I've also opened in OCI on "Default Security List" they're not in Listen State (so app doesn't start). How can I solve that? Thanks for all your help. It's very precious for me. PS: Happy new year! 🎉🥳
What r u trying to run? I see you are opening ports 25, 465 I am assuming it something that will be sending emails. Just so you are aware I you can't send emails from OCI instance unless you are using their Email Delivery Service which is not available in free tier. Per OCI
"Due to the risk of abuse, outbound SMTP(port 25) from OCI tenancies created after June 25, 2021 will be blocked by default. OCI will not block outbound access on SMTPS(tcp port 465 or 587)"
Hey@@TechTute! Thanks for your reply! At this time, I'm assume that in Free Tier I cannot open ports... Isn't it? Specifically, I'm trying to run Strategy Quant. Here is the firewall rules: 25,465,587 - SMTP server; 443 - Web; 80 - Web; 8080-8099 - User interface; 5050-5059 - User interface. So, have I no hope?... If I'd upgrade plan can I solve that or don't need to?... I've been struggling with it for several days. 😔 Thanks as always. Bless you.
@@albertoparodi1046 Thanks for following up, I totally missed the other message. Not familiar Strategy Quant, but you should still be able to open all the ports you have listed above and have your application running except the email functionality of it. Even though it mai appear that you have port 25 open OCI will drop ll the traffic on it.
Thanks to you@@TechTute! I'm thinking about that Arm-based processor maybe are not compatible with SQX. Could be? Maybe because of that I cannot open tcp ports...
@@albertoparodi1046 Can you start the Strategy Quant program and see it running and listening on the ports you have listed? If cpu compatibility is the issue you won't be able to start it. Opening the ports should not be impacted by the CPU architecture.
this mnethod works only with root user ???
you should be able to RDP with user other than root. What error do you get?
@@TechTute i can connect by rdp but after 2 second disconnects
@@captaincomando8107 So you authenticate successfully and connect and and get to the xfce desktop and then it disconnects? Or before that during authentication process? Does it throw any error? Thanks
@@TechTute i connect with sucess put username ubunto and my password and after 2 or 4 seconds closed session rdp
@@captaincomando8107 can you tail the xrdp.log "tail -f /var/log/xrdp" and then try to connect and reply with what errors you see.
this video really stinks. it uses password to login. suddenly. but use ssh-key to ssh into it.
Thank you for watching my video, and for taking the time to provide a feedback. If you don't mind sharing, how would you have done it?