Skip to content

Updating Software Installed on a Virtual Machine

Simon Støvring edited this page Aug 30, 2023 · 4 revisions

Most often it's faster and easier to log into host machines one by one to update installed software than following the instructions outlined in Copying a Virtual Machine.

When updating the software installed on a virtual machine, we will need to stop the runners. Therefore we should take care not to update all virtual machines at once in order to ensure that we have at least one runner operating so developers can continue relying on the CI/CD infrastructure. Generally speaking, we can update all runners but one at once and update the remaining one when all others are back up.

Assuming we have the three host machines HM1, HM2, and HM3, we can update the installed software using the following workflow:

  1. Log into HM1 and HM2 using macOS' built-in Screen Sharing app.
  2. Stop the runners by selecting "Stop" in Tartelet on both HM1 and HM2.
  3. Edit the virtual machine on both HM1 and HM2 by selecting "Edit Virtual Machine" in Tartelet.
  4. Make the needed changes in the virtual machines on both HM1 and HM2.
  5. Shutdown the virtual machines on HM1 and HM2.
  6. Start the runners on HM1 and HM2 by selecting "Start" in Tartelet. The virtual machines on HM1 and HM2 have now been updated and are running again.
  7. Perform the same steps for HM3.

The sections below contain detailed instructions on updating specific software.

Updating Software Installed with Homebrew

Any software installed with Homebrew can be updated by editing a virtual machine and running the following two commands.

brew update
brew upgrade

Installing a New Version of Xcode

It is recommended to rely on xcodes to manage Xcode versions installed on the virtual machines.

A new version of Xcode can be installed by editing a virtual machine and performing the following steps.

  1. Open the Terminal.
  2. If needed, uninstall an existing version of Xcode by running xcodes uninstall and supplying a version number, e.g. xcodes uninstall "15.0 Beta 7".
  3. Install the new version of Xcode by running xcodes install and supplying a version number, e.g. xcodes install "15.0 Beta 8".
  4. During the installation, you may be prompted to authenticate with two-factor authentication. Select your phone number when prompted and enter the corresponding two-factor authentication code. At Shape we use a phone number that forwards incoming messages in Slack to ensure that the account logged into a virtual machine is not tied to a specific employee.
  5. Launch Xcode to install any relevant runtimes and remove any unneeded runtimes.

Updating Node

Update node by editing a virtual machine and performing the following steps.

  1. Install the new version of node by running nvm install and supplying a version number, e.g. nvm install 18.17.1.
  2. Make sure the new version is in use by running nvm use and supplying a version number, e.g. nvm use 18.17.1.
  3. If needed, uninstall the old version by running nvm uninstall and supplying a version number, e.g. nvm uninstall 17.9.0.