Skip to content

Setting Up a Host Machine

Simon B. Støvring edited this page Mar 9, 2024 · 13 revisions

The following document describes in detail how we are configuring our host machines at Shape.

These details are provided as guidance both for ourselves so we can remember how to replicate ourselves and for people who want to be taken through the entire process of configuring a host machine. That said, these steps are not stricly needed for configuring Tartelet as your setup may vary.

Renting a Machine

We rent our machines from MacStadium.

Example configuration of a machine

1. Choose the location

The location of the machine does not matter much but out of the options offered by MacStadium, we have the lowest latency from Copenhagen to Dublin. However, it may be that your preferred machine is not available in Dublin. In this case Atlanta is the next best choice.

2. Choose the hardware

Make sure to choose a machine with an Apple Silicon chip.

Note

We have found the M2 machines to be up to 30% slower than the machines with an M1 chip. This decrease in performance is likely due to the slower read/write speed of the SSD in the M2 machines.

3. Choose a version of macOS

When renting a machine, make sure to choose a machine with an Apple Silicon chip and have the latest version of macOS pre-installed on the machine.

4. Rename the machine

Make sure to rename the machine so it is distinguishable from other machines. We name our machines after characters in the Frozen Disney movie.

MacStadium's dialog for renaming a machine

5. Take note of the credentials

You should have received an e-mail with the details of the new machine, including it's static IP address and the username and password used to connect to the machine in the following steps.

We store these credentials in a vault in 1Password. It is important that the password of the administrator account on the new machine is changed. We will do this later in this guide.

💡 Tip

Add the IP address to your /etc/hosts file with the name chosen in step 4 to avoid remembering the IP address and using the name of the machine when connecting to it going forward.

127.0.0.1        localhost
123.456.123.456  olaf

Configuring the Machine

The following section describes the nitty gritty details of configuring the machine. We follow these steps closely so all of our machines are configured in the same way.

Configuring the Administrator Account

All changes in the following section are made while logged onto the administrator account on the host machine.

1. Connect to the Machine using the administrator account

Use Finder to connect to the machine using VNC. Open Finder and select Go -> Connect to Server (⌘K) in the menu bar. Enter vnc://administrator@{YOUR IP ADDRESS} in the address field. You will be asked to enter the password of the administrator account.

You should now se the screen of the rented machine and it will ask you to login using the administrator account. Enter the password to login.

Dialog for connecting using VNC

2. Change the password of the administrator account

It is important to change the password of the administrator account as you have just received it in plain text in an e-mail. Do this through the Users & Groups pane in the System Settings app.

3. Change the name of the machine

Change the name of the machine by following the steps below.

  1. Select the General pane in the System Settings app.
  2. Select About.
  3. Click the name of the machine.
  4. Enter the new name. This should be the same as the name assigned to the machine on MacStadium.

Changing the name of the machine makes it easier to identify the machine, for example when connecting to it through VNC.

4. Create a new account named "runner"

Create an account named "runner" through the Users & Groups pane in System Settings. This can be a standard account; that is, it does not need to be an administrator account. We will use this account to run the Tartelet application.

The account details are listed below.

Field Value
New Account Standard
Full Name runner
Account Name runner
Password Create a secure password using 1Password and make sure the credentials are stored in 1Password.
Verify Re-enter the password
Password Hint Leave blank

We will not configure this account just yet. First we finalize all configuration that needs to be done while logged into the administrator account and then we make the configurations needed on the runner account.

5. Change the avatars

Change the avatars of both the administrator and the runner accounts. We use the following avatars for the two accounts.

Account Avatar
administrator 👑 Crown emoji on a red background
runner 🤖 Robot emoji on a blue background

Both avatars can be created using the emojis and colors in the avatar picker.

Avatars used by the administrator and runner accounts

6. Enable automatically logging in as the runner account

In case the machine is restarted, we want it to automatically log in as the newly created runner account. Follow the steps below to enable that.

  1. Navigate to the Users & Groups pane in the System Settings app.
  2. Select "runner" for the "Automatically log in as" setting.
  3. Enter the password of the administrator and runner accounts when asked to do so.

7. Enable fast user switching

Enable fast user switching to show the account name in the menu bar. This is another way to easily see which account we are logged into. Follow the steps below to add fast user switching.

  1. Navigate to the Control Center pane in the System Settings app.
  2. Scroll down to the Fast User Switching settings.
  3. Select "Account Name" for the "Show in Menu Bar" setting.

8. Disable automatic software updates

Disable automatic software updates by following the steps below.

  1. Navigate to the General pane in the System Settings app.
  2. Select Software Update.
  3. Select the info icon next to "Automatic updates".
  4. Verify that "Check for updates" is enabled.
  5. Verify that "Download new updates when available" is enabled.
  6. Verify that "Install macOS updates" is disabled.
  7. Verify that "Install application updates from the App Store" is disabled.
  8. Verify that "Install Security Responses and system files" is enabled.
Screenshot of the recommended settings

9. Enable Remote Login for all accounts

Ensure Remote Login is enabled for all accounts. This enables us to log into the runner account using SSH. Follow the steps below to enable Remote Login for all accounts.

  1. Navigate to the General pane in the System Settings app.
  2. Select Sharing.
  3. Verify that Remote Login is enabled.
  4. Select the info icon next to Remote Login.
  5. Select "All users" for the "Allow access for" setting.
Screenshot of the recommended settings

10. Change the wallpaper

Change the wallpaper of the administrator account. We use the following wallpapers for the accounts.

Account Wallpaper
administrator Red wallpaper with the name of the machine and the account name written on it.
runner Blue wallpaper with the name of the machine and the account name written on it.

Writing the name of the machine on the wallpaper and the account name on the wallpaper makes it easy to identify a VNC session when multiple are active at the same time and reduces errors when managing multiple machines.

We use this Sketch template to create the wallpapers for both accounts. Once a wallpaper is created, it can be exported and dragged onto the VNC session to transfer it to the host machine. Then right-click the image to set it as wallpaper.

We will change the wallpaper of the runner account later.

11. Rearrange the Dock

Remove all applications from the Dock except Finder. Then add System Settings and Terminal to the Dock. This reduces the clutter in the Dock and ensures we have the applications we need at hand.

The dock of the administrator account

12. Remove recent applications from the Dock

Keep the Dock clean by removing recent applications. Follow the steps below to remove recent applications from the Dock.

  1. Navigate to the Desktop & Dock pane in the System Settings app.
  2. Disable the "Show recent applications in Dock" setting.

13. Disable sleep

Ensure that the computer does not go to sleep by running the following command in the Terminal app.

sudo pmset -b sleep 0; sudo pmset -b disablesleep 1

We also need to ensure that the computer does not sleep when connected over VNC by following this guide. The necessary steps in the guide are listed below.

Start by finding the UID of the file located at the path /Library/Preferences/com.apple.PowerManagement.{UID}.plist. You can do this by autocompleting the path in the terminal.

Then run the following command to disable System Sleep Timer altogether.

sudo defaults write /Library/Preferences/com.apple.PowerManagement.{UID}.plist "AC Power" -dict-add "System Sleep Timer" 0

And run the following command to disable Display Sleep Timer altogether.

sudo defaults write /Library/Preferences/com.apple.PowerManagement.{UID}.plist "AC Power" -dict-add "Display Sleep Timer" 0

12. Add runner account to sudoers file

Before we start configuring the runner account we will need to add it to the sudoers file as we will install software that requires sudo permissions.

Open the Terminal app and run the following command.

sudo visudo

Scroll down until you see the following three lines.

# root and users in group wheel can run anything on any machine as any user
root            ALL = (ALL) ALL
%admin          ALL = (ALL) ALL

Edit the lines to look as below.

# root and users in group wheel can run anything on any machine as any user
root            ALL = (ALL) ALL
runner          ALL=(ALL:ALL) ALL
%admin          ALL = (ALL) ALL

13. Reduce DHCP lease time

As recommended in Tart's FAQ we will reduce the DHCP lease time from 86,400 seconds (one day) to avoid exhausting the DHCP server's pool of IP Addresses. We reduce it to 7200 seconds (two hours).

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.InternetSharing.default.plist bootpd -dict DHCPLeaseTimeSecs -int 7200

Configuring the Runner account

We are done making changes on the administrator account and will not configure the runner account which is responsible for running the Tartelet app.

1. Log into the runner account

Log out of the administrator account and into the runner account on the host machine.

2. Go through macOS' account setup

The first thing you will be presented with after logging into the runner account is macOS' flow for setting up an account. Go through the flow by selecting the following options.

  1. "Not Now" when asked about Accessibility settings.
  2. "Continue" when informed about Data & Privacy.
  3. "Set Up Later" when asked to log in with an Apple ID.
  4. "Skip" when asked if you are sure that you want to skip signing in with an Apple ID.
  5. "Set Up Later" when asked to setup Screen Time.
  6. "Light" and then "Continue" when asked to choose the look of macOS.

3. Change the wallpaper

Change the wallpaper of the runner account. The wallpaper should have been created when setting up the administrator account. Refer to "Change the wallpaper" step of "Configuring the Administrator Account" for details.

4. Disable the screen saver

Follow the steps below to disable the screen saver.

  1. Navigate to the Lock Screen pane in the System Settings app.
  2. Select "Never" for the "Start Screen Saver when inactive" setting.

6. Enable fast user switching

Enable fast user switching to show the account name in the menu bar. Refer to "Enable fast user switching" step of "Configuring the Administrator Account" for the steps.

8. Install Homebrew

Install Homebrew by following the official instructions. The instructions will ask you to run the following command in the Terminal app.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Make sure to follow the instructions printed in the Terminal app after installing Hoembrew.

8. Install Tart

Use Homebrew to install Tart by running the following command in the Terminal app.

brew install cirruslabs/cli/tart

9. Install Tartelet

Install Tartelet on the host machine by following the steps in the Installing Tartelet guide.

7. Rearrange the Dock

Remove all applications from the Dock except Finder. Then add System Settings, Terminal, and Tartelet to the Dock. This reduces the clutter in the Dock and ensures we have the applications we need at hand.

The dock of the runner account

8. Remove recent applications from the Dock

Keep the Dock clean by removing recent applications. Refer to "Remove recent applications from the Dock" step of "Configuring the Administrator Account" for the steps.

Next Steps

The host machine is now ready to run Tartelet. Please refer to Configuring Tartelet for more information on setting up Tartelet.

Clone this wiki locally