Guide: Using GUI on VM with Linux

content:

Using GUI on VM with Linux

If you want to access the GUI of your virtual machine, you can use programs that will allow you to connect to your machine with graphic access.

One of such programs is "x2GO", which is very easy to use.

The x2GO program uses SSH to connect, so remember to open port 22 on the machine you want to access GUI.

First of all, you need to install the graphical environment you are interested in. We recommend one of the two listed below:

  • MATE
  • XFCE

Installing graphical desktop environment

To install the selected graphical desktop environment, you must first connect to the machine via SSH.

You can do it by following the command below:

ssh -i <ssh_private_key> <username>@<ip_host_machine>

  • ssh_private_key - path to the SSH private key for access to the VM
  • username - you can use username per user or per tenant. Remember to choose the configuration key for specific users
  • ip_host_machine - VM public IP address

 

Take a look at demonstrative command:

ssh -i user user@185.213.75.143

MATE

 

If you want to install MATE for Ubuntu, please run the following commands:

sudo apt update
sudo tasksel install ubuntu-mate-desktop

 

If you want to install MATE for CentOS, please run following commands:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum groupinstall mate-desktop -y

 

XFCE

 

If you want to install XFCE for Ubuntu, do the following commands:

sudo apt update
sudo apt install xfce4

If you want to install XFCE for CentOS, do the following commands:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum groupinstall "Xfce" -y

 

Installing X2GO server

Install a SSH-tunneling Remote Desktop solution.

On Ubuntu, run the following commands:

sudo apt install software-properties-common
sudo add-apt-repository ppa:x2go/stable
sudo apt update
sudo apt install x2goserver x2goserver-xsession

 

On CentOS, run the following commands:

sudo yum install x2goserver-xsession -y
 

X2GO client installation

To install X2GO client, run the following command:

For Ubuntu:

sudo apt install x2goclient

For CentOS:

sudo yum install x2goclient -y

To run x2go, please execute this command in the terminal: x2goclient

After executing the command, the following window will appear:

To create a new session, click on the "Session" option in the top bar.

After pressing the "Session" button, a form with session settings will appear.

 

 

Fields that you must complete:

  • Session name - name of your session,
  • Host - floating IP of the virtual machine,
  • Login - your username,
  • SSH port: 22 - leave unchanged to connect via SSH,
  • Use RSA/DSA key for ssh connection - put your SSH private key (path to the private key),
  • Session type - choose a pre-installed graphic theme.

Configuration example:

 

You can change display mode in "Input/Output"tab:

 

Click "OK", if all fields have been completed correctly you should see a tile with information about the newly created session.

 

Click on the tile to connect to the machine with GUI.

  • GUI MATE

 

  • GUI XFCE