Friday, 21 April 2017

Amazon EC2 Linux instance with desktop functionality from Windows

Amazon EC2 Linux instance with desktop functionality from Windows

This article describes how to connect to an Amazon EC2 Linux instance desktop by using Windows Remote Desktop.

For purposes of this article, make sure that you are running an instance of Ubuntu 14.04 LTS. In addition, this article assumes the user name is 'ubuntu'.

  1. Connect to your Linux instance as described in Connecting to Your Linux Instance from Windows Using PuTTy.
  2. Run the following commands from the terminal to install updates, an upgrade, and install additional packages.
    • sudo apt-get update
    • sudo apt-get upgrade
  3. Because you will be connecting from Windows Remote Desktop, edit the sshd_config file on your Linux instance to allow password authentication.
    • sudo vim /etc/ssh/sshd_config
  4. Change PasswordAuthentication to yes from no, then save and exit.
  5. Restart the SSH daemon to make this change take effect.
    • sudo /etc/init.d/ssh restart
  6. Temporarily gain root privileges and change the password for the ubuntu user to a complex password to enhance security. Press the Enter key after typing the command passwd ubuntu, and you will be prompted to enter the new password twice.
    • sudo –i
    • passwd ubuntu
  7. Switch back to the ubuntu user account and cd to the ubuntu home directory.
    • su ubuntu
    • cd
  8. Install Ubuntu desktop functionality on your Linux instance.
    • export DEBIAN_FRONTEND=noninteractive
    • sudo -E apt-get update
    • sudo -E apt-get install -y ubuntu-desktop
  9. Install XRDP and other xfce4 resources.
    • sudo apt-get install xfce4 xrdp
    • sudo apt-get install xfce4 xfce4-goodies
  10. Make xfce4 the default window manager for RDP connections.
    • echo xfce4-session > ~/.xsession
  11. Copy .xsession to the /etc/skel folder so that xfce4 is set as the default window manager for any new user accounts that are created.
    • sudo cp /home/ubuntu/.xsession /etc/skel
  12. Open the xrdp.ini file to allow changing of the host port you will connect to.
    • sudo vim /etc/xrdp/xrdp.ini
  13. Look for the section [xrdp1] and change the following text (then save and exit [:wq]).
    • port= -1 - to -   port= ask-1
  14. Restart xrdp.
    • sudo service xrdp restart
On Windows, open the Remote Desktop Connection client, paste the fully qualified name of your Amazon EC2 instance for the Computer, and then click Connect.

When prompted to Login to xrdp, ensure that the sesman-Xvnc module is selected, and enter the username ubuntu with the new password that you created in step 7. When you start a session, the port number is -1.

When the system connects, several status messages are displayed on the Connection Log screen. Pay close attention to these status messages and make note of the VNC port number displayed. If you want to return to a session later, specify this number in the port field of the xrdp login dialog box.


22 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. motherboard is a key component of the desktop computer. It connects with other computer accessories like the display screen, keyboard, mouse, speakers, printer, DVD-ROM etc to increase its utility and perform variable duties.
    https://www.desktopcon.org/best-240hz-monitor/

    ReplyDelete
  3. The creator has so delightfully enchanted the thought of group by this brilliant blog.
    Download Alexa app

    ReplyDelete
  4. We are going to check it out and let you know if any questions appear. But I am pretty sure that everything is going to be just all right.

    ReplyDelete
  5. That is really nice to hear. thank you for the update and good luck. 4k monitor

    ReplyDelete
  6. For the purpose of understanding the essence of this article, it is first necessary to make sure that it will bring benefits and benefits during use in this process.

    ReplyDelete

  7. Great article by the great author, it is very massive and informative but still preaches the way to sounds like that it has some beautiful thoughts described so I really appreciate this article. Get for more information Download Alexa App

    ReplyDelete