Skip to content

Install GUI (graphical desktop) on Amazon EC2 instances running SUSE Linux Enterprise Server 15 (SLES 15)

6 minute read
Content level: Intermediate
2

Steps to install desktop environment, desktop manager and and Amazon DCV high performance remote display protocol server on SUSE Linux Enterprise Server 15 (SLES 15)

Overview

This article suggests how you can install GUI (Graphical User Interface) on Amazon EC2 instances running SUSE Linux Enterprise Server (SLES), and access it using Amazon DCV remote display protocol.

This article applies to SLES 15 on AWS only. Similar articles are available for AL2, AL2023, Ubuntu Linux and RHEL/Rocky Linux

Notice

Your use of Amazon DCV is subject to DCV end user license agreement

Requirements

Supported OS versions

The following version is supported by Amazon DCV server

  • SUSE Linux Enterprise Server 15 with SP6 or later (x86_64)

64-bit ARM (arm64) architecture is not supported

EC2 instance prerequisites

  • EC2 instance with 2 GiB or more memory
  • Attached security group allows inbound TCP and UDP port 8443 from your IP
  • More than 3 GB free disk space to install graphical desktop components and DCV server
  • Attached EC2 IAM role with the below policy for license validation. Replace REGION with your instance AWS Region code. Alternatively, attach AmazonS3ReadOnlyAccess managed policy.
{
    "Version": "2012-10-17",
    "Statement": [
       {
           "Effect": "Allow",
           "Action": "s3:GetObject",
           "Resource": "arn:aws:s3:::dcv-license.REGION/*"
       }
    ]
}

Installing DCV

Install desktop environment and desktop manager

Install GNOME desktop and set gdm as the default desktop manager

sudo zypper install -y -t pattern gnome_basic
sudo update-alternatives --set default-displaymanager /usr/lib/X11/displaymanagers/gdm
sudo sed -i "s/DEFAULT_WM=\"\"/DEFAULT_WM=\"gnome\"/" /etc/sysconfig/windowmanager
sudo systemctl set-default graphical.target

Install DCV server

Install DCV server, web client and virtual session support, and enable server daemon

cd /tmp
sudo rpm --import https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY
curl -L -O https://d1uj6qtbmh3dt5.cloudfront.net/nice-dcv-sles15-x86_64.tgz
tar -xzf nice-dcv-sles15-x86_64.tgz && cd nice-dcv-*-sles15-x86_64
sudo zypper install -y ./nice-dcv-server-*.rpm
sudo zypper install -y ./nice-dcv-web-viewer-*.rpm
sudo zypper install -y ./nice-xdcv-*.rpm
sudo usermod -a -G video dcv
sudo systemctl enable dcvserver

Console session XDummy driver

Install and configure XDummy driver

sudo zypper install -y xf86-video-dummy
sudo tee /etc/X11/xorg.conf > /dev/null << EOF
Section "Device"
    Identifier "DummyDevice"
    Driver "dummy"
    Option "UseEDID" "false"
    VideoRam 512000
EndSection

Section "Monitor"
    Identifier "DummyMonitor"
    HorizSync   5.0 - 1000.0
    VertRefresh 5.0 - 200.0
    Option "ReducedBlanking"
EndSection

Section "Screen"
    Identifier "DummyScreen"
    Device "DummyDevice"
    Monitor "DummyMonitor"
    DefaultDepth 24
    SubSection "Display"
        Viewport 0 0
        Depth 24
        Virtual 4096 2160
    EndSubSection
EndSection
EOF

Configure DCV server

Configure console session and enable session storage for file transfer support.

sudo sed -i "/^\[session-management\/automatic-console-session/a owner=\"ec2-user\"\nstorage-root=\"%home%\"" /etc/dcv/dcv.conf
sudo sed -i "s/^#create-session/create-session/g" /etc/dcv/dcv.conf

GPU instance

If you are using a GPU instance, you can install and configure GPU driver

Open firewall ports

Open firewall ports

sudo firewall-offline-cmd --add-port 8443/tcp
sudo firewall-offline-cmd --add-port 8443/udp

Restart X server and DCV server

sudo systemctl isolate multi-user.target && sudo systemctl isolate graphical.target
sudo systemctl stop dcvserver && sudo systemctl start dcvserver

Set user password

Specify a strong password for login user

sudo passwd ec2-user

Access graphical desktop environment

Clients

DCV offers Windows, Linux, macOS and web browser clients.

You can connect to DCV server using web browser client at https://<EC2-IP>:8443 (where <EC2-IP> is your EC2 instance IP address). Native clients provide better user experience and additional features, and can be downloaded from Amazon DCV site.

Login as ec2-user with your configured password

Do ensure that EC2 instance security group allow inbound TCP and UDP 8443 from your IP

Web browser client

Enter image description here

EC2 Install Script

You can use the below as install script (or user data) on a new SLES EC2 instance.

#!/bin/bash
sudo zypper install -y -t pattern gnome_basic
sudo update-alternatives --set default-displaymanager /usr/lib/X11/displaymanagers/gdm
sudo sed -i "s/DEFAULT_WM=\"\"/DEFAULT_WM=\"gnome\"/" /etc/sysconfig/windowmanager
sudo systemctl set-default graphical.target

cd /tmp
sudo rpm --import https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY
curl -L -O https://d1uj6qtbmh3dt5.cloudfront.net/nice-dcv-sles15-x86_64.tgz
tar -xzf nice-dcv-sles15-x86_64.tgz && cd nice-dcv-*-sles15-x86_64
sudo zypper install -y ./nice-dcv-server-*.rpm
sudo zypper install -y ./nice-dcv-web-viewer-*.rpm
sudo zypper install -y ./nice-xdcv-*.rpm
sudo usermod -a -G video dcv
sudo systemctl enable dcvserver

sudo sed -i "/^\[session-management\/automatic-console-session/a owner=\"ec2-user\"\nstorage-root=\"%home%\"" /etc/dcv/dcv.conf
sudo sed -i "s/^#create-session/create-session/g" /etc/dcv/dcv.conf

sudo zypper install -y xf86-video-dummy
sudo tee /etc/X11/xorg.conf > /dev/null << EOF
Section "Device"
    Identifier "DummyDevice"
    Driver "dummy"
    Option "UseEDID" "false"
    VideoRam 512000
EndSection

Section "Monitor"
    Identifier "DummyMonitor"
    HorizSync   5.0 - 1000.0
    VertRefresh 5.0 - 200.0
    Option "ReducedBlanking"
EndSection

Section "Screen"
    Identifier "DummyScreen"
    Device "DummyDevice"
    Monitor "DummyMonitor"
    DefaultDepth 24
    SubSection "Display"
        Viewport 0 0
        Depth 24
        Virtual 4096 2160
    EndSubSection
EndSection
EOF

sudo firewall-offline-cmd --add-port 8443/tcp
sudo firewall-offline-cmd --add-port 8443/udp

sudo systemctl isolate multi-user.target && sudo systemctl isolate graphical.target
sudo systemctl stop dcvserver && sudo systemctl start dcvserver

Do set ec2-user user password

Additional information

For help with DCV, refer to DCV Administrator Guide and User Guide

For help navigating graphical desktop, refer to Learn GNOME

DCV sessions

Amazon DCV on Linux offers two types of sessions: console sessions and virtual sessions. This article use console sessions, which has resolution limits especially on non GPU instances. Virtual sessions support custom resolution and multiple displays.

To switch to virtual session, connect to EC2 instance as ec2-user, disable console session, configure multi-user.target (optional) and reboot

sudo sed -i "s/^create-session/#create-session/g" /etc/dcv/dcv.conf
sudo systemctl restart dcvserver
sudo systemctl set-default multi-user.target
sudo systemctl isolate multi-user.target
sudo reboot

You will need to create a virtual session manually

USER=ec2-user
dcv create-session $USER --owner $USER --storage-root %home% --type virtual

To verify that virtual session has been created

sudo dcv list-sessions

Output should be similar to below

 Session: 'ec2-user' (owner:ec2-user type:virtual)

Refer to Using the command line on a Linux Amazon DCV Server for more information

Other options

Consider managed EUC (End User Computing) services such as Amazon WorkSpaces

Install prerequisites including desktop environment and Amazon DCV Server from Amazon DCV Administrator Guide

To quickly get up and running with DCV for internal testing, you can use CloudFormation template at DCV CloudFormation page.

You can also explore amazon-ec2-nice-dcv-samples CloudFormation templates to provision your own EC2 instances with graphical desktop environment, DCV server and other features such as multiple virtual sessions support and GPU driver installation.

AMIs preconfigured with graphical desktop environment are available from AWS Marketplace.

AWS
EXPERT

published 2 years ago2.7K views