Search The Hostwinds Guides Knowledge Base

How to Install Ubuntu Desktop on a VPS

Share This Article

A fairly common use for a VPS is to use it as a remote desktop, essentially acting as a remote computer available for use. For the preset Operating System Images Hostwinds provides, by default only Windows offers remote desktop out of the box. The Linux images are all the server variants, which only offer SSH access by default. However, it is still possible to install the desktop variants of several Linux distributions by installing it via the ISO.

This guide goes over how to install the desktop version of Ubuntu on a VPS using their ISO.

Installation

Step #1: Go to Ubuntu’s download page and click the Download button for the version you want.

The download page will attempt to automatically download the ISO to your local computer.

You do not need to download the ISO to your local computer, and you can cancel this download.

Right-click the download now link, and copy the link’s address. This will be the direct download link to the ISO.

Ubuntu ISO Link

Step #2: Login to your Cloud Portal, and navigate to the Storage -> ISO’s section.

Storage Menu

Step #3: Click the Upload ISO button.

ISOs

Step #4: Give the ISO a name, paste in the URL to the ISO download, and make it bootable. Then click Add ISO.

Upload ISO

Step #5: Wait until the ISO’s status changes to Active.

Active ISO

Step #6: Go to the Servers -> My Servers section of the cloud portal and click on your server.

Step #7: Select Actions -> Reinstall for your server.

Actions Menu

Step #8: Go to the ISO Library tab of the Reinstall menu and select your ISO from the Private section. Click Confirm.

Reinstall ISO Library

Step #9: Wait until your VPS is in an ISO Install status.

Step #10: Click the Get VNC button.

You may need to refresh the page to display the Get VNC button after the server has gone into the ISO Install status.

ISO Install Get VNC

Step #11: Install Ubuntu through the VNC window. Follow the on-screen prompts from the installer.

Ubuntu Installer

Step #12: At the end of the installation, click the Restart Now button.

Ubuntu Install Restart

Step #13: When you reach a screen that says “Please remove the installation medium, then press ENTER:”, from your cloud portal, click the Finalize ISO Installation button.

Finalize ISO Installation

Step #14: Wait for the installation to finalize and the VPS’s status changes back to ‘RUNNING’.

Fix Networking

By default, the desktop environment for most Linux distributions won’t have internet connectivity immediately after installation due to the VPS’s network adapter needing to be configured with a static configuration. The following steps go over how to configure your Hostwinds server to allow internet connectivity.

Step #1: Open the VNC console to your server by selecting Actions -> Get VNC from the cloud portal.

Actions Menu

Step #2: Login to your Ubuntu installation.

Step #3: Open the terminal. You can open it by pressing the keys Ctrl + Alt + T.

Step #4: Run the command sudo nano /etc/netplan/01-network-manager-all.yaml to edit your NetworkManager configuration.

Ubuntu Terminal

Step #5: Add the configuration for the ens3 network device, such that the file should look like this:

Just replace {IP} with the IP address of your VPS, and replace {GATEWAY} with it’s gateway.

The gateway is the same as your IP address, except the last octet of the IP is 1.

Example: If your IP 123.123.123.123, your gateway would be 123.123.123.1.

Step #6: Save the file by hitting the keys Ctrl + O, then pressing Enter to confirm the file location. The close the editor by pressing Ctrl + X.

Step #7: Apply the new network configuration by running the command sudo netplan apply.

The VPS should now have full network connectivity and internet access. You can confirm this by open the web browser (Firefox is installed by default) and attempting to go to any website.

Enable SSH

By default, SSH is not installed/enabled in the desktop version of Ubuntu. You can set it up by doing the following from within the Get VNC window:

Step #1: Open the terminal by hitting the keys Ctrl + Alt + T.

Step #2: Install the openssh-server package by running

Step #3: Enable and start the SSH service by running:

Enable VNC Server

To have remote desktop access to the server, you can install a VNC server and configure it to serve your desktop environment. These steps go over how to install the VNC server, a more lightweight desktop environment, and connect using a VNC client.

Step #1: Install the vnc4server package by running:

Step #2: Set a password for VNC by running:

The password for VNC is truncated to only 8 characters.

Step #3: Install a lightweight desktop environment

Due to both VNC issues and keeping performance in mind, it is recommended to install a secondary, lightweight desktop environment, such as XFCE or KDE Plasma, in place of Ubuntu’s default desktop environment, Gnome.

You can install XFCE by running:

Step #4: Start the VNC server to generate default settings by running:

You may receive an error stating that there is already a VNC server running for screen :1.

If you do, you can simply change the ‘:1’ part of the command to ‘:2’, ‘:3’, etc.

You will just need to reference this screen when you attempt to connect to the server.

The -geometry flag for this command specifies the output resolution. You can change the resolution value from 1920×1080 to whatever resolution suits your needs. The -depth flag specifies the color depth.

Step #5: Kill the VNC server by running:

Make sure the ‘:1’ number matches the screen number you used in step 4.

Step #6: Configure your VNC startup file to load your desktop environment.

Edit the file ~/.vnc/xstartup to look like this:

If you installed a different desktop environment than XFCE, replace the startxfce4 statement with the launch command for your desktop environment.

Step #7: Make sure the startup file is executable by running:

Step #8: Configure VNC as a service.

To have the VNC server run automatically at startup, you can configure it as a service by creating the file /etc/systemd/system/vncserver@.service at edit it to be like this:

Replace {USER} with your username on the server.

Step #9: Reload systemd by running:

Step #10: Enable the service by running:

It is recommended to have the number after the @ symbol matches the screen number you specified in step 6.

Connecting

You should now be able to connect to the server via VNC using any VNC client such as the TightVNC Viewer.

Simply provide the client the hostname or IP of your server, followed by ‘:1’ (or whatever number to match the screen number you set when enabling the service in step 10.

TightVNC Viewer Connection

You will then be prompted for the password you set in step 2.

Then you will be connected and will be able to use the VPS as a remote desktop.

XFCE through VNC

Related Articles