Thursday, December 27, 2018

Install GNOME desktop and enabling RDP access to an Azure Ubuntu Linux VM


Ubuntu Linux VM



Microsoft Azure and Ubuntu Linux VM


In previous posts already we have been walking through about the Cloud Computing and Microsoft Azure in addition how to setup an Ubuntu Linux VM on Azure using Azure Portal as well as PowerShell.

We came to know that the Cloud Computing is a trending buzzword in the recent IT industry and gives the facility and feasibility accessing a massive pool of computing resources provided by the diverse Cloud Providers such as Microsoft, Amazon or Google on the basis of something Pay-As-You-Go model.

In this sequence the Microsoft Azure is one of leading cloud computing platfroms which provide a wide range of cloud services counting with Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) to develop and scale applications as well deploy and manage through a global network of data centers.

If we talk about the VM, an Azure Virtual Machine (VM) is an on-demand, high-scale, secure computing resource deployed on Azure through different methods, gives more control over the computing environment. In addition the Ubuntu Server is a part of the larger set of Ubuntu products and operating system developed by Canonical and open source programmers around the world.

You can visit some previous posts to know a bit more about the following topics – 


GNOME Desktop


GNOME Desktop


GNOME is the Windows-like desktop environment a graphical interface that works on Unix and Unix-like systems and composed entirely of free and open source software. It is the default version which runs on major Linux distributions like Ubuntu, Red Hat Enterprise Linux, Oracle Linux, SUSE Linux Enterprises etc. 

GNOME stands as GNU Network Object Model Environment, a part of the GNU project, but the acronym was dropped because no longer reflected the vision of the GNOME projetc. The main objective of GNOME is to provide a user friendly suite of applications and easy to use desktop on top of Linux environment somewhat very similar to the Windows operating system.

Visit to know more about the GNOME - https://www.gnome.org/.

xRDP Server


xRDP Server


In fact, Windows to Linux based remote desktop connectivity is often bandwidth exhaustive, insecure and difficult to configure. Now consider a scenario where a remote Windows user required to connect a Linux system as simple as connecting to a Windows system.

xRDP is an open source remote desktop protocol server, which uses RDP that enables operating systems other than Microsoft Windows (like Ubuntu Linux) to deliver a fully functional RDP compatible remote desktop experience. The xrdp package provides RDP functionality, along with an X server capable of accepting connections from rdesktop, freerdp and Windows Terminal Server clients.

Visit to know more about the xRDP - http://www.xrdp.org/.

Pre-requisites


We are aware that SSH is the default method when connecting to an Ubuntu server deployed on Azure cloud and how to connect the same we already went through. Here we will see the steps involved in installing the GNOME desktop and xRDP packages on an Ubuntu Linux Virtual Machine (VM) running on top of Azure. It makes available a more familiar and user friendly remote desktop style connection.

Before moving ahead, we need some pre-requisites to go ahead installing GNOME and xRDP on an Ubuntu Linux VM - 
  1. Azure subscription, if you don't have an account then sign up for a free Azure account - https://azure.microsoft.com/en-gb/free/
  2. A running Ubuntu Linux VM
  3. PuTTY client to be used as the SSH client
  4. Some Hands on with Linux commands


STEP – 1: Validate the existence of an Ubuntu VM


It is essential to exist an Ubuntu Linux Azure Virtual Machine (VM) to accomplish this demo task, login to the Azure portal https://portal.azure.com/.

On the left Hub menu, click All resources and select the existing Ubuntu virtual machine, verify the VM is either running or stopped, if it is in stop mode, i.e. deallocated then start the same.

VM Status

STEP – 2: Fetch the connection details of Ubuntu VM


Next, required to connect the VM, you can go with either SSH key or PuTTY client depends on the configuration and setup done with Ubuntu VM. 

I am moving ahead with PuTTY client, click the Connect button from the menu bar to launch the connection details.

Connection details

Here you can see a new blade as Connect to virtual machine appeared, copy the account details which exist under the Login using the VM local account, in my case - ssh demoadmin@40.117.37.79.

STEP – 3: Connect the VM using PuTTY client


Since the Ubuntu Linux VM is configured in such a way to connect using the PuTTY client, so open up PuTTY, and in the Session page, submit the host name into the Host Name box, the same we copied earlier.

For example, in my case, it was - ssh demoadmin@40.117.37.79, but need to submit only demoadmin@40.117.37.79, exclude the ssh prefix and then, under Connection type, select SSH and click Open.

PuTTY


Once the SSH session has been established, promptly, it will ask password for the connecting server, enter the administrator password you specified during provisioning the Ubuntu VM.

Connecting Ubuntu


Post authorization, you will be connected with the Ubuntu Linux 18.04.1 LTS Virtual Machine (VM).

Ubuntu Connected


STEP – 4: Update the package


Next, before looking the installation the desktop, required to update the package list to make sure we have all essentials newest versions of the packages and their dependencies.

Execute the following command to accomplish this.

sudo apt-get update
  
Execute Update package command


It will start the updating, the time you execute the command and sooner updating list will be complete.

Package Updating done


STEP – 5: Install the GNOME desktop


Time to begin the desktop installation, execute the following command to install GNOME desktop from within the terminal session.

sudo apt-get install ubuntu-gnome-desktop

Install Gnome Server


Quickly the installation will be proceeding as soon you execute the above listed command, follow up with one confirmation.

Gnome desktop Installed


Proceed with submitting the yes as Y and the system will continue to install and align the required files and libraries etc.

Gnome desktop installation completed


It will take a couple of moments the installation process, depending on the configuration of VM, etc. but preferably you will get the successful completion acknowledgement.

Installation process done


Congratulations, the GNOME desktop has been installed!! 😊

STEP – 6: Install the xRDP Server


Now the GNOME server has been installed successfully, time to install xRDP, an open source remote desktop protocol (RDP) server which allows you to RDP to your Ubuntu Linux server from a Windows machine.

Execute the following command to install the xRDP package.

sudo apt-get install –y xrdp

Install xRDP package


Sooner it will process and finish the installation the xRDP server.

xRDP installed

STEP – 7: Configure Console Access


GNOME and xRDP has been installed, but yet we have to configure a couple of settings. In this series by default the console access is restricted to root that means connections by anyone else will be dropped.

Execute the following command to change access to the console from the root only to all users, simply edit the Xwrapper.config file.

sudo nano /etc/X11/Xwrapper.config

Configure console access

It will launch the configuration file under the nano editor, essential to manually change the line allowed_users=console to allowed_users=anybody.

Edit the Xwrapper config file


XWrapper config file configured

Apart from the above listed way, you can also execute the following command to make the changes.

sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config

Alternative way

STEP – 8: Adding NSG rule for RDP traffic


In fact, we are dealing with an Ubuntu Linux VM where the machine has been deployed with a Network Security Group (NSG) that allows port 22 inbound for SSH communication by default, not 3389 which is essential for an RDP connection.

Move to the Azure Portal, select the Ubuntu Linux virtual machine and click the Networking under the Settings section, will launch the Inbound as well Outbound Port Rules blade.

NSG rules


Do validate if you already allowed RDP via 3389 Port during the provisioning of Ubuntu VM or not, if not then add an inbound security rule for the same.

Inbound rule


STEP – 9: Connecting the Ubuntu VM via RDP


Next, time to verify the RDP connection, move to Ubuntu VM Overview blade and copy the Public IP address which will be used to connect he server using RDP.

VM Overview blade

Subsequently, I am connecting from a Windows machine, hereafter will use the mstsc utility to connect the server remotely.
  
mstsc

Remote Desktop Connection


As soon you connect the server the xRDP login screen will be appeared.

xRDP login screen


Go ahead and provide the user credentials and proceed by clicking the OK button. Post submission of the correct username and password you will get an Authentication Required popup, since the first time you remotely logged on the Ubuntu desktop.

Gnome Authentication Pop Up

Either you can cancel the authentication or go ahead passing the password, sooner the GNOME desktop will be available.

Gnome Desktop


You can notice that the Ubuntu Dock is not visible, but if you click the Activities menu under the top will get a couple of options.

Gnome Ubuntu Dock


Congratulations, Ubuntu Linux VM connected remotely !! 😊

In the short-term, here in this article, we walked through the outline of GNOME desktop and xRDP package as well their installation besides connecting to the Ubuntu server. 

Keep visiting for further posts.

2 comments:

  1. Great job for publishing such a nice article. Your article isn’t only useful but it is additionally really informative. Thank you because you have been willing to share information with us. oracle fusion financials

    ReplyDelete
  2. Awesome Rajendra...This is Ankush (We worked at ELI if you remember). I found this article as a first result during my search.

    ReplyDelete