This tutorial shows you how to set up a Ubuntu Desktop on Google Cloud. If you need a graphic interface to your virtual desktop on the cloud, this tutorial will teach you how to set up a desktop environment just like what you can get on your own computer.
We need four steps to set up a machine:
- Create a Ubuntu VM instance on Google Cloud.
- Install and configure the Chrome Remote Desktop service on the VM instance.
- Set up a Ubuntu desktop environment in the VM instance
- Connect from your Chrome web browser to the desktop environment on the VM instance.
Before you begin:
- Make sure that you selected a Google Cloud project for running this VM instance.
- If you don’t have the Google Chrome browser installed, you can install it from the Google Chrome homepage.
1. Create a Ubuntu VM instance
2. Click CREATE INSTANCE.
3. Set the instance name to ubuntu-desktop .
4. Select a region and zone you want to run your instance.
6. In the Boot disk pop-up window, in Operating System, select Ubuntu from the drop-down; in Version, select Ubuntu-20.04-LTS; keep the rest options as default value and click SELECT.
2. Install Chrome Remote Desktop on the VM instance
The next step is to install Chrome Remote Desktop on the VM instance.
1. In the SSH window connected to your VM instance, update the package manager data and install wget and tasksel. Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS, the most widely used Internet protocols. Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated “task” onto your system.
sudo apt update
sudo apt install --assume-yes wget tasksel
2. Download and install the Debian Linux Chrome Remote Desktop installation package:
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
sudo apt-get install --assume-yes ./chrome-remote-desktop_current_amd64.deb
3. In the SSH window connected to your VM instance, install Ubuntu desktop environment:
sudo tasksel install ubuntu-desktop
sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/gnome-session" > /etc/chrome-remote-desktop-session'
sudo reboot
You will lose connection to your VM instance immediately. Don’t panic, close the SSH window, wait a few seconds and you will SSH into it through the Cloud Console again in the next step.
3. Configure the Chrome Remote Desktop service and Connect to your Ubuntu Desktop
1. In the Cloud Console, click the SSH button to connect to your instance.
2. On your local computer, using the Chrome browser, go to the Chrome Remote Desktop command line setup page:
https://remotedesktop.google.com/headless
3. On the Set up another computer page, click Begin.
6. Now you get the command to set up and start the Chrome Remote Desktop service on your VM instance. Copy the command for Debian Linux.
7. Paste the command to the SSH window that connects to your VM instance. Run the command.
8. Enter a 6 digit PIN when prompted. This PIN will be used when you log into the VM instance from your Chrome. If you see errors like Fail to read or No net_fetcher, ignore them.
9. Verify that the Chrome Remote Desktop service is running by using the following command.
sudo systemctl status chrome-remote-desktop@$USER
If the service is running, you will see the status is active:
Active: active (running) since DATE_TIME; ELAPSED_TIME
12. You will see this page, just cancel it or go to SSH terminal, type this command, and enter your new password. Return this page and type your new password
sudo passwd ubuntu
Comments
Post a Comment