Set up Fusion360 CAD on Ubuntu Desktop on Google Cloud

Posted on 2023/02/24 by Dirk van der Laarse

Original Articleopen in new window

Create a Ubuntu VM instance

In this step, we will launch a VM instance in Google Cloud.

  1. In the Google Cloud Console, go to the VM Instances page:
  2. Click CREATE INSTANCE.
  3. Set the instance name to ubuntu-desktop .
  4. Select a region and zone you want to run your instance.
  5. Scroll down to the Boot disk options and click Change
  6. In the Boot disk pop-up window, in Operating System, select Ubuntu Pro from the drop-down; in Version, select Ubuntu-22.04-LTS; keep the rest options as default value and click SELECT.
  7. Click CREATE to create the instance.
  8. In less than one minute, you will be able to see your Ubuntu instance in RUNNING status. You can click the SSH button in the instance list to connect to your new instance.

I've also turned on a maximum VM run time of 6 hours. The VM will then shut down after 6 hours (if I forgot to shut it down after use)

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
  1. 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

Set up a Ubuntu desktop environment in the VM instance

Now we need to install a desktop environment and window manager for Chrome Remote Desktop to communicate with the VM instance.

  1. In the SSH window connected to your VM instance, install Ubuntu desktop environment:
sudo tasksel install ubuntu-desktop
  1. Set your Chrome Remote Desktop session to use Gnome, which is the default desktop environment for Ubuntu:
sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/gnome-session" > /etc/chrome-remote-desktop-session'
  1. You just need to reboot your Ubuntu VM instance.
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.

Configure the Chrome Remote Desktop service and Connect to your Ubuntu Desktop

To start the remote desktop connection, you need to have an authorization key for your Google account.

  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.

  4. Click Next. You already installed the Chrome Remote Desktop on the remote computer in STEP2(Install and configure the Chrome Remote Desktop service on the VM instance)

  5. Click Authorize.

  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

Now you are ready to connect to the VM instance through Chrome Remote Desktop web application.

  1. On your local computer, go to the Chrome Remote Desktop web site. You will find your Ubuntu Desktop shows up in the portal.

  2. Click the remote desktop instance. In this case, it is ubuntu-desktop. And you will be prompted to input the 6 digit PIN you set in step-8.

  3. You will see this page, just cancel it.

authentication is required to create a color managed device

Ubuntu uses a software component called Polkit, which is an application authorization framework that captures actions performed by a user to check if the user is authorized to perform certain actions. When you connect to Ubuntu remotely using RDP / Windows Remote Desktop, you will see the above errors because the Polkit Policy file cannot be accessed without superuser authentication.

If you don’t want to see it again, you can create a new configuration file in /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf in your VM instance. In your SSH window, input the following:

sudo nano /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf

Paste the following:

polkit.addRule(function(action, subject) {
 if ((action.id == "org.freedesktop.color-manager.create-device" ||
 action.id == "org.freedesktop.color-manager.create-profile" ||
 action.id == "org.freedesktop.color-manager.delete-device" ||
 action.id == "org.freedesktop.color-manager.delete-profile" ||
 action.id == "org.freedesktop.color-manager.modify-device" ||
 action.id == "org.freedesktop.color-manager.modify-profile") &&
 subject.isInGroup("{users}")) {
 return polkit.Result.YES;
 }
});

Save (press CTRL+X, and Y) and exit (press Enter).

This tells Polkit to continue without requiring the RDP authentication.

Troubleshooting

When logging in with Chrome Remote Desktop, if you get the following error:

xsession: unable to launch /usr/bin/gnome-session not found  falling back to default session

This SU answer helpedopen in new window:

sudo apt-get remove ubuntu-desktop
sudo apt-get remove ubuntu-gnome-desktop

Do not restart. This could effectively leave your system without GUI.

sudo apt-get install ubuntu-gnome-desktop
sudo apt-get autoremove

Set screen resolution

Initially, the Display settings didn't have an option for 1920x1080. These instructionsopen in new window fixed it:

  1. Open a Terminal by CTRL+ALT+T
  2. Type xrandr and ENTER
  3. Note the display name usually VGA-1 or HDMI-1 or DP-1 or screen
  4. Type cvt 1920 1080 (to get the --newmode args for the next step) and ENTER
  5. Type sudo xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync and ENTER
  6. Type sudo xrandr --addmode VGA-1 "1920x1080_60.00" and ENTER (replace VGA-1 with your display type (step 3) like HDMI-1 or DP-1 or screen)
  7. Now close the terminal and go to Settings >> Display settings and change it to 1920x1080
  8. Enjoy FHD.

To make the above settings stick when you restart your computer, do the following.

goto your terminal and type nano ~/.profile ENTER Paste in the shell command from step 5 and 6, then save.

E.g.:

nano ~/.profile
# 2023-02-24
# dvanderlaarse
# Set display resolution option for 1920x1080
# https://askubuntu.com/a/1075168
xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode screen "1920x1080_60.00"
xrandr --output screen --mode "1920x1080_60.00"

Install Fusion360

Install Fusion360open in new window:

sudo snap install fusion360 --beta
Contributors: Dirk van der Laarse