0
votes

In order to achieve a RDP connection to an Ubuntu server(AWS EC2) from another Ubuntu Server, I followed the steps of accepted answer in here: How To Set Up GUI On Amazon EC2 Ubuntu server

And I also tried these steps which are quite similar: https://datawookie.netlify.com/blog/2017/08/remote-desktop-on-an-ubuntu-ec2-instance/

But both of them does now answer my problem. When I connect to the server, the "login to xrdp" screen shows up and I wrote my username and password. Problem is that even it successfully connected to the server, it kicks me out of server after showing a yellow like screen for a second:https://i.hizliresim.com/JZBypJ.png

I could not figured out what is going on exactly. How can I solve this? Best regards,

2

2 Answers

0
votes

I applied the steps that is listed at below address.

https://askubuntu.com/questions/592537/can-i-access-ubuntu-from-windows-remotely

The step that is not covered in the addresses which I gave in my questions is the step 3. Content of that step:

Step 3 – Configure xRDP (From the address above)

In this step, we modify two files to make sure xRDP uses Xfce4. First we need to create, or edit, our .xsession file in our home directory. We can either use nano or simply redirect an echo statement (easier):

echo xfce4-session > ~/.xsession

The second file we need to edit is the startup file for xRDP, so it will start Xfce4.

sudo nano /etc/xrdp/startwm.sh

The content should look like this (pay attention to the last line and ignore . /etc/X11/Xsession):

#!/bin/sh

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

startxfce4

Hope that helps someone else with same problem.

0
votes

To remote desktop your Ubuntu machine, Install xrdp and xfce.

sudo apt-get update && sudo apt-get install xrdp && sudo apt-get install xfce4

Configure xrdp:

Create .xsession in home directory.

echo xfce4-session >~/.xsession

Edit startup file for xrdp (notice that the last line is startxfce4)[optional as it worked for me without doing this step]

nano /etc/xrdp/startwm.sh

#!/bin/sh

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

startxfce4

Restart xrdp service

sudo service xrdp restart

Create Ubuntu user password

sudo passwd ubuntuUser

Log in:

RDP to your remote machine and enter your Ubuntu credentials. You will be able to log in