Contents


Using a graphical interface on SoftLayer servers

Concepts and configuration

Comments

The cloud. Everyone uses it. Most of us use SaaS solutions whether we know it or not. You open your browser, enter a URL, log in, and voilà, you are using the cloud. In some areas of the cloud, you use a PaaS. Again, one of the most common ways to access these types of environments—such as IBM Bluemix, IBM Bluemix Continuous Delivery, Heroku, or others—is to use a browser.

But what about accessing an IaaS cloud? Cloud providers such as IBM SoftLayer provide a browser-based approach to provision an infrastructure that you can access to build and run software on. However, after the server is provisioned and started up, how do you access it? Especially if you want to access a graphical desktop interface?

If you search this topic, you can find many related hits, but not a clear explanation, especially as it relates AWS or to SoftLayer.

This article reviews the concepts, the tools, and the process for enabling your IaaS server users to have access to a GUI running on a server on SoftLayer. We cover these key points:

  1. Desktop GUI software: For Linux™ servers on the cloud, if a desktop GUI is needed or wanted, you must add it to the server.
  2. Remote access software: Because a remote desktop connection is required to access the desktop GUI, you must install that software.
  3. Additional consideration: The possible implication of running a graphical user environment from a cloud-based server on your cloud configuration.

You don't need magic to access servers that run on an IaaS cloud. You can use the same tools and technologies in the cloud that you might use with premise data centers; including the old fashioned command-line interface.

Interface through command line

Let's take a quick look at accessing cloud servers by command-line interfaces. Linux and Windows® are two common OS types that run in the cloud. Because many people use and are already familiar with the GUI interface for Windows, we focus on Linux and Telnet, or more specifically, the secure implementation of it: SSH (Secure Shell). SSH is the most common approach to enable command-line access to a Linux server that runs on SoftLayer, or any IaaS provider. Figure 1 illustrates an architectural view of the pieces and how they work together. The key elements of this architecture is a secure key to the cloud, a program that supports SSH and an IP address of the cloud server. That's important: you can't access a server in the cloud without an IP address.

Figure 1. Diagram of Linux command-line interface
An architectural diagram depicting accessing servers by command-line interfaces
An architectural diagram depicting accessing servers by command-line interfaces

Why is command-line access important if your focus is on enabling GUI access? To set up a server in the cloud to support a GUI access, you must use a CLI tool such as SSH.

No GUI? Wait, when you provision a server in the cloud, doesn't it include a GUI interface? You can download an installation image of Ubuntu Desktop and run it locally on your VirtualBox, so why isn't a GUI interface available in the cloud? The simple fact is that most cloud IaaS OS installations start with the basics. You begin with the base server infrastructure and then the user, or configurer, customizes the server OS to suite the needs of the user. This process can be done by using available tools and techniques that are available in the open source community. The process takes two steps:

  1. Configure a server to support a GUI environment
  2. Access that GUI remotely

Set up the server

For Windows servers in the cloud, there is the standard Windows desktop and the GUI is part of the Windows. Things get a little more complex when we look at Linux.

Linux Desktops are typically built on the X Window System environment that provides the basic framework for a GUI environment. X Window System originated at MIT in the 1980's and evolved over the years to be the key windowing environment for UNIX and Linux. The various Linux desktops, such as Gnome and KDE, use the X Window System environment to create a desktop with specific capabilities and a specific look and feel. Typically, when you install these desktops, the underlying X Window System software is also installed onto the server as part of the package.

Installing a Desktop environment on a cloud server is typically done through a command-line interface. Using the previously mentioned SSH tools, you run an installation tool that installs the packages. Each variant of Linux typically provides an installation tool. For example, Ubuntu has the apt-get (short for Advanced Packaging Tool) that automatically retrieves the installation packages from the internet and install the software.

Ubuntu example of installing Gnome: $ sudo apt-get install gnome

This command retrieves and installs the full gnome desktop environment. There are various options to get more or less of the desktop (for example, not the LibreOffice tools), but the process is essentially the same.

Again, this command installs the desktop software and X Window System. You are not done yet. You still must perform some specific configurations. You can find an overview of these steps in the Cookbook section of this article.

The work doesn't stop here. Having a desktop environment that is installed on a cloud server is nice but there is more to set up.

Access a GUI in the cloud

If you accessed a server locally, say on a laptop or local virtual machine you are done.

However, because you want to access the GUI across the internet you need to install a remote connection server. This software enables the display of, and interaction with, a GUI desktop to be routed over a network. (Again this same concept works for public or private clouds in a data center.) For Linux systems, the most common software is Virtual Network Computing, or VNC. There are free and for fee versions of VNC. The choice of which to use depends on your needs and organizational requirements. However, in the end they all generally work the same way.

Figure 2 illustrates the key elements of a VNC environment. Specifically, there is a server and a client. The server software is responsible for working with the client to provide the desktop experience to the user.

Figure 2. Key elements of a VNC environment
An illustration showing the key elements of a VNC environment
An illustration showing the key elements of a VNC environment

Note: The VNC server runs an instance of the desktop for the user. Multiple clients interact with the same server. Different instances of a VNC server can be started with a unique desktop configuration. The client can connect to different desktops, which are based on a desktop ID, if wanted.

The client can be a specific application that you start, such as the TightVNCViewer on Windows or the VNC enabled capabilities of Safari on the Mac. Either way the client connects with the server, presents the desktop, and routes the interactions from the keyboard and mouse back to the server. As illustrated in Figure 3.

Figure 3. Accessing cloud servers by using Linux GUI
An illustration depicting accessing cloud servers with Linux GUI
An illustration depicting accessing cloud servers with Linux GUI

Install and configure

Installing and configuring the remote connection server environment follows the same approach as that used to install the desktop software. First, you retrieve and install the software. For example, on Ubuntu you might install vnc4server.

$sudo apt-get install vnc4server

After you install the software, you configure the server. VNC runs an instance of the desktop. Therefore, you need to set up the VNC configuration files to tell it what desktop to run and the unique nature of it.

For example, this section of the xstartup file comes with vnc4server to provide the details of how you want the desktop to look and the desktop to run, in this case gnome.

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-session -\\-session=ubuntu-2d &

A SoftLayer IaaS perspective

As mentioned earlier, the OS images that are typically provisioned automatically by IaaS providers such as IBM SoftLayer or AWS do not come already provisioned with a desktop GUI or remote access software. There are some things to consider as you provision your servers on the cloud if you are looking to support a GUI environment. These considerations might increase your monthly or hourly costs for the server on the cloud so you need to plan accordingly.

The first is that running an instance of the GUI does take up compute resources in the form of memory and CPU, just as they do on your laptop. If you do intensive work or have many users who use this interface make sure you provision the server with more RAM and a corresponding CPU with a large cache. The specifics really depend on the number of users that are using the GUI at anyone time.

Second, running a GUI over a remote network does have implications on network bandwidth. Again, not earth-shattering news, but sometimes you start to take this all for granted when you provision to a cloud. Make sure that the network you provision for your server or servers is set up with enough outbound bandwidth to support the graphical screen updates being sent from the cloud server. If enough bandwidth is not provisioned, you might find that performance is unacceptable. Also, cloud providers tend to charge for outbound bandwidth, so having many users who run a GUI from the cloud might mean more monthly charges on your bill.

Finally, another consideration to cover is the need to ensure that your firewalls are properly configured. Using a remote access tool such as VNC does require that certain ports are open. Typically, these ports are in the range of 5900-5910. This limitation is not unique to the cloud, but it is a consideration to weigh. You need to ensure that these ports are open on your cloud firewall.

Unique to SoftLayer

SoftLayer does provide a public and a private network (VLAN) for servers. If you find that only a few admins need to use the GUI, you might want to route them through the private network over a VLAN, which removes the outbound network charge. They might find that performance is reduced since this network is typically an admin-focused network.

The Standard and Flex Image Templates feature of SoftLayer might be helpful in quickly setting up servers with the configuration described earlier. While you might use scripts and Chef Recipes to perform the configuration steps, you might also use Image Templates from SoftLayer. When you successfully configure a server to have the exact working configuration that is required, you might take an Image Template snapshot of it. SoftLayer saves this template and then you can quickly provision a new server from it, using the SoftLayer Portal or APIs. It results in a one-step operation with everything all configured AND running.

Set up and access a GUI environment: a Cookbook

Here is an overview of the steps to perform. Links under Related topics provide the nitty-gritty details.

  1. Select your Linux OS image type, for example, RedHat, Ubuntu; the specific OS impacts the specific commands.
  2. Select the Linux desktop solution to use.
  3. Select the remote desktop server software to use.
  4. Set up the associated users to support the GUI environment. Typically you need to have a user 'vnc' that runs the vncserver.
  5. Install the desktop software, for example sudo apt-get install gnome.
  6. Install the remote desktop server software, $sudo apt-get install vnc4server.
  7. Modify configuration files, specifically xstartup.
  8. Ensure that the firewall on server environment supports the Remote Desktop Software for VNC ports; 5900-5910 must be open.
  9. Restart the remote desktop server $ vncserver.

Conclusion

Using servers in the cloud does not mean that your users or administrators are restricted to learning, or relearning, the Linux shells and command-line interface (CLI). Powerful as a CLI is, there is still an option to use a GUI desktop environment. In some cases, this might also be a requirement.

The Linux images you provision on IaaS providers, such as SoftLayer, typically don't have these components pre-configured. However, the technologies are not unique to the cloud and use tools that are used within in-house data center solutions in the past.

Understanding these technologies and the implications of running them in cloud environment is key to making appropriate IaaS decisions. You might also find that automation tools such as SoftLayer Image Templates and the SoftLayer APIs can be used with other DevOps tools to simplify this process even further.


Downloadable resources


Related topics


Comments

Sign in or register to add and subscribe to comments.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Cloud computing
ArticleID=962215
ArticleTitle=Using a graphical interface on SoftLayer servers
publish-date=07262017