Install ubuntu desktop on AWS instance with Chrome Remote Desktop
Tags: awsinstance, cloud, aws, ubuntu
Published: 2021-02-12 14:13:31

---
title: Install ubuntu desktop on AWS instance with Chrome Remote Desktop
published: true
date: 2020-12-02 15:05:34 UTC
tags: awsinstance,cloud,aws,ubuntu
canonical_url: https://medium.com/@victorleungtw/install-ubuntu-desktop-on-aws-instance-with-chrome-remote-desktop-3beb30755379
---

Nowadays, we have moved many things to the cloud, including your photos, your files and your servers, what about your desktop environment? Imagine you don’t need to carry your heavy laptop any more, and you can access to the computing power of your laptop from any thin clients, such as a tablet with keyboards at anywhere. It’s possible to achieve using AWS instance with ubuntu desktop and Chrome Remote Desktop. I tried other solutions, such as AWS Workspace or VNC connection, but still, find the Chrome Remote Desktop with the lowest latency and close to native desktop performance. Here is how to do so:

1. Logon to AWS console and launch an instance using the ubuntu server AMI.

![](https://cdn-images-1.medium.com/max/630/0*buVKSQw-mH-YXt4o.png)

2. Once the instance is launched, SSH to your ubuntu server. Update package manager and install wget:

```
$ sudo apt update
$ sudo apt-get install --assume-yes wget
```

3. Download Chrome remote desktop package and install:

```
$ wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
$ sudo dpkg --install chrome-remote-desktop_current_amd64.deb
$ sudo apt install --assume-yes --fix-broken
```

4. Next, we install the desktop GUI environment. I have tested out different distro and found that Xfce performs the best without fancy animations over a slow network.

```
$ sudo DEBIAN_FRONTEND=noninteractive apt install --assume-yes xfce4 desktop-base
```

5. Configure Chrome Remote Desktop to use Xfce by default:

```
$ sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/xfce4-session" > /etc/chrome-remote-desktop-session'
```

6. Install xscreensaver as an alternative to the default Xfce locker, which doesn’t work with remote desktop:

```
$ sudo apt install --assume-yes xscreensaver
```

7. Disable display manager as there is no display connected:

```
$ sudo systemctl disable lightdm.service
```

8. Add your user account to the Linux group then logout:

```
$ sudo usermod -a -G chrome-remote-desktop $USER
$ logout
```

9. On your local laptop browser, open [https://remotedesktop.google.com/headless](https://remotedesktop.google.com/headless) Then follow the steps to set up another computer. You would probably copy command to your AWS command, similar to this:

```
DISPLAY= /opt/google/chrome-remote-desktop/start-host \
    --code="4/xxxxxxxxxxxxxxxxxxxxxxxx" \
    --redirect-url="https://remotedesktop.google.com/_/oauthredirect" \
    --name=
```

10. Finally, you can remote connect to your ubuntu desktop and have fun!

![](https://cdn-images-1.medium.com/max/630/0*uIQ5SB5LdglP1fP7.png)

One extra tip is that you can display your screensaver, which is not necessary:

![](https://cdn-images-1.medium.com/max/630/0*juDwcrXrm1_Ud-cX.png)

You can now access your desktop environment from anywhere with any device. It’s especially useful as a software engineer who wants to code with a full set of tools as a development environment at any time.

Written by **Victor Leung** who is a keen traveller to see every country in the world, passionate about cutting edge technologies. [Follow me on Twitter](https://twitter.com/victorleungtw)

_Originally published at_ [_https://victorleungtw.com_](https://victorleungtw.com/install-ubuntu-desktop-aws-instance)_._