Sometimes, just sometimes, I need to work on a machine that isn’t running macOS. Previously, I’ve done this by installing either a local Docker image, or by running a VM. Neither of these approaches was terribly satisfactory, and both became less viable when I switched to an M1 MacBook Air (which, let it be known, is an absolutely lovely piece of kit) Today, I explored a new approach: using a cloud-based workstation.
The downside of this approach is that the workstation costs actual money to use, but the advantage is that I now have a machine that I can use whenever I need it, from wherever I happen to be. Because I’m only using this occasionally, as long as I remember to shutdown the image, the costs are pretty reasonable.
Setting up my first one was ridiculously easy using GCP!
Since I’m not the sort of person who’s great at reading docs, I just followed the steps from a YouTube video. Summarised, this is:
Create a new VM instance in GCP. I picked an instance with 8 CPU cores and 32GB of RAM. That may be a little much, but the CPU is important for me, since I want my compile and test runs to be as fast as possible.
Set the OS to Ubuntu, and choose which version you want to use.
Make sure you pick the right kind of disk. For development work, using an SSD is a really good idea, and making sure that there’s enough disk space is vital.
Once that’s done, you can start up the VM and use
gcloud to SSH on
to it. Once you’ve done that, just go ahead and install everything you
need to get your development done. We can use pinned browsers running
headless in the Selenium
build, so there’s less need for an X Windows environment, but setting
one of those up seems easy enough.
Of course, I had no idea how much disk I actually needed, and had seleted a “balanced” disk that was waaaay too small. Fixing that was pretty simple:
- Stop the VM.
- Create a snapshot of the disk.
- Create a new disk from the snapshot, choosing both SSD and a reasonable amount of disk space.
- Edit the VM instance that you’re using as a workstation, and scroll down to “boot disk”.
- Nuke the existing disk, and then select to use the newly created
disk image using
After this, restart the VM, give it a chance to reboot, and then you’re all good to go!