Search code examples
amazon-web-servicesubuntuamazon-ec2rdpxrdp

RDP Connection To Ubuntu Server from Ubuntu


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,


Solution

  • 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.