Google Cloud workstation
- Netbook set up with SSH key pair
We need a Google Cloud project to own workstation VM instances. It's helpful to make it independent of other projects.
In Google Cloud console:
- Nav to Compute Engine and create new micro instance
- Name "ubuntu"
- Region "us-west"
- Size "custom (1 vCPU, 4 GB memory)", so we have enough memory to install things like Ruby and IntelliJ
- OS ubuntu LTS
- Start instance
- Copy external IP address
Enable laptop to connect to cloud instance. In Google Cloud console:
- Search for "SSH key" and select "metadata" result
- Copy public key contents from local machine using Text and paste into Cloud console https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#project-wide
- Open Secure Shell on local machine, select key, paste IP address and connect
The Chrome Remote Desktop (CRD) docs are pretty good, but assume you already have a desktop with Chrome running. For a cloud VM, we need a way to bootstrap without a desktop. A couple (1, 2) Chrome support threads were helpful. Steps:
Install lightweight window manager
sudo apt install -y xubuntu-desktop
sudo dpkg -i chrome-remote-desktop_current_amd64.deb
exec /usr/sbin/lightdm-session "startxfce4"
Note: misconfiguration of this file (including misnaming) results in "… Session process terminated … " errors.
Restart CRD to load the config:
sudo /etc/init.d/chrome-remote-desktop restart
Note: we used to have to edit the Compute Engine instance firewall to enable udp:all and tcp:443,5222 open for ingress and egress, but this no longer seems required
On the netbook, launch CRD app, select the host created above and enter the access pin you defined
Define an SSH key pair to enable communication with Github:
Define SSH key pair, per github SSH key generation docs:
ssh-keygen -t rsa -b 4096 -C '<project>.<instance>@<cloud provider>'
Copy public key contents into github settings