Self-hosted Runner as MacOS VM Image
Self-hosted runner installation is explained at Appcircle docs in detail. You can install runner in your self-hosted environment by yourself, following instructions on there.
We're also providing ready-to-use runner VM image that you can download from Appcircle CDN. Especially for enterprise installation, it might be more practical than installing from scratch.
Here are some reasons for choosing VM image for self-hosted runner;
- It's more quick and easy way of deploying runner. Just download VM image and make some minor configurations for your environment.
- While installing runner, we need several packages from various sources on internet and runner installation requires to be online. Since all iOS and android build pipeline tools are included in VM image, you don't need complex firewall rules while deploying runner.
- It minimizes effects of strict macOS policies applied to host, especially at enterprise environments. Your runner environment will be same as used in Appcircle cloud.
- Since we use virtual machine for runner, it provides a clean, isolated instance for every build job. It means, known and more stable runner environment. Your runner won't persist any macOS changes done in build pipeline which can make runner unstable in time.
- You can install and run only one instance of self-hosted runner on a physical machine. On the other hand, using virtualization infrastructure brings us concurrency. We can run multiple instances of runner on the same host.
Requirements
In order to use macOS VM, we need to install some dependencies on macOS host.
1. Install Homebrew
Script explains what it will do, follow instructions on there.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
When installation complete, test:
brew doctor
brew --version
2. Install Tart
Tap Appcircle repository and install tart (Tart is a registered trademark of Cirrus Labs, Inc.).
brew tap appcircleio/cli
brew install appcircleio/cli/tart
When installation complete, test:
tart --version
Run tart to touch initial folders.
tart list
Create VMs root folder in tart home.
mkdir $HOME/.tart/vms
3. Install Pigz
Pigz is an acronym for Parallel Implementation of GZip, which is a fully functional replacement for gzip that helps us compress and extract files faster and more stably.
brew install pigz
When installation complete, test:
pigz --version
4. Configure Power Settings
Configuring power settings on macOS to prevent the system from entering sleep mode is vital when deploying it as an Appcircle runner.
By keeping the system awake, you ensure uninterrupted accessibility to your Appcircle runners, preventing any potential offline cases caused by the system going to sleep.
This continuous availability is critical for running builds, as it guarantees that your builds can find runners online.
We suggest disabling those power settings to make it behave like a server station.
sudo pmset -a sleep 0
sudo pmset -a powernap 0
sudo pmset -a disksleep 0
sudo pmset -a displaysleep 0
5. Configure Power Failure Settings
Power failure settings allow a Mac to restart automatically after a power outage or failure. Activating this on a Mac ensures the host comes back online automatically if power is lost, avoiding downtime.
For now, Appcircle runners don't support auto-start when the macOS host restarts.
You should connect to host with SSH and start the VMs manually.
To configure power failure settings, you can run the command below.
sudo /usr/sbin/systemsetup -setrestartpowerfailure on
You should see "setrestartpowerfailure: On" in the command output after successful execution.
If your host doesn't support this feature, you will get the message below.
Restart After Power Failure: Not supported on this machine.
You can ignore power failure settings if they are not supported.
Download MacOS VM
You have two options to obtain the Appcircle runner images: manual or automated.
To perform these tasks manually, you can follow our step-by-step guide on downloading the macOS VM image manually.
Alternatively, you can automate this process in the background by following our instructions on downloading the macOS VM and Xcode images automatically.
Download the macOS VM Image Manually
MacOS VM image has a versioning convention based on release date instead of arbitrary numbers. This date-based approach is called calendar versioning, or CalVer for short.
Our calendar versioning scheme for the macOS image is YY0M0D. For example, a macOS image that's released on March 6, 2024, should have version 240306.
The versions are listed in chronological order, from the earliest to the most recent, in the tabs below.
Download macOS VM from Appcircle bucket.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_240306.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_240514.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_240918.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_241227.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_250512.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_250603.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/macOS_251015.tar.gz
If you encounter network interruption, just run the same command again. It should continue download for remaining part. It will result in saving both time and bandwidth.
Host macOS Requirements
We're constantly bumping the VM macOS version according to Xcode requirements.
Below is the table of required host versions for currently supported macOS VMs:
| Version | Guest macOS | Host macOS |
|---|---|---|
251015 | Sequoia 15.6.1 | Sequoia or later |
250603 | Sequoia 15.4.1 | Sequoia or later |
250512 | Sequoia 15.4.1 | Sequoia or later |
241227 | Sonoma 14.5 | Ventura or later |
240918 | Sonoma 14.5 | Ventura or later |
240514 | Sonoma 14.1 | Ventura or later |
240306 | Sonoma 14.1 | Ventura or later |
If you don't need the latest Xcode and you want to run an older version of the macOS VM image that supports running on an older host, contact us through our support channels.
Disk Space Requirements
The recommended disk space for the macOS VM installation is 1TB.
If your host machine has a total storage capacity of 512GB, be aware that this will not be sufficient to download and extract the Appcircle runner macOS VM and the Xcode images compressed file directly on the host machine, especially with version 240918 or later. Although the extracted macOS VM and Xcode image files will fit within the 512GB capacity, the download and extraction process requires additional temporary space to process.
We recommend the following solutions for a possible workaround:
- Use an external disk formatted in
ExFATorAPFS. Please note thatFAT32is not a suitable option because it has a maximum file size limit of 4GB. - Use a network-based file system such as
SMBorNFS.SMBis recommended as it is a more compatible option with macOS thanNFS.
You can use the following commands in macOS Terminal to verify your total disk space.
df -h
system_profiler SPNVMeDataType
Please don't forget to change the working directory to the externally attached or network-based disk and run the macOS VM installation commands in that directory.
cd /path/where/the/external/disk/mounted
Note: You can check the integrity of downloaded file by comparing the MD5 checksum.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
md5 macOS_240306.tar.gz
md5 macOS_240514.tar.gz
md5 macOS_240918.tar.gz
md5 macOS_241227.tar.gz
md5 macOS_250512.tar.gz
md5 macOS_250603.tar.gz
md5 macOS_251015.tar.gz
After a couple of minutes later you should see the output below.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
MD5 (macOS_240306.tar.gz) = 084a9221075ed5453aceba6a3438b134
MD5 (macOS_240514.tar.gz) = 8524abc65668a084589e79f214a9b281
MD5 (macOS_240918.tar.gz) = aeb6ff4b655b04fa47fb45e2caf09792
MD5 (macOS_241227.tar.gz) = 505d3bd11088c193fd9b828cbcf95df0
MD5 (macOS_250512.tar.gz) = 896f7bb2f46d7091ef0125948749ee8a
MD5 (macOS_250603.tar.gz) = fec1fb675be9ff50754a894f56096f6f
MD5 (macOS_251015.tar.gz) = cad8bcb22c5f7207fcbb25e5b78a6a88
Create folder for VM.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
mkdir -p $HOME/.tart/vms/macOS_240306
mkdir -p $HOME/.tart/vms/macOS_240514
mkdir -p $HOME/.tart/vms/macOS_240918
mkdir -p $HOME/.tart/vms/macOS_241227
mkdir -p $HOME/.tart/vms/macOS_250512
mkdir -p $HOME/.tart/vms/macOS_250603
mkdir -p $HOME/.tart/vms/macOS_251015
Extract archive into VMs folder.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
tar -zxf macOS_240306.tar.gz --directory $HOME/.tart/vms/macOS_240306
tar -zxf macOS_240514.tar.gz --directory $HOME/.tart/vms/macOS_240514
tar -zxf macOS_240918.tar.gz --directory $HOME/.tart/vms/macOS_240918
pigz -cvdp 4 macOS_241227.tar.gz | tar xvf - --directory $HOME/.tart/vms/macOS_241227
pigz -cvdp 4 macOS_250512.tar.gz | tar xvf - --directory $HOME/.tart/vms/macOS_250512
pigz -cvdp 4 macOS_250603.tar.gz | tar xvf - --directory $HOME/.tart/vms/macOS_250603
pigz -cvdp 4 macOS_251015.tar.gz | tar xvf - --directory $HOME/.tart/vms/macOS_251015
It may take a little to complete. Be patient and wait return of command.
You can track progress of extraction by monitoring VM folder size.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
du -sh $HOME/.tart/vms/macOS_240306
du -sh $HOME/.tart/vms/macOS_240514
du -sh $HOME/.tart/vms/macOS_240918
du -sh $HOME/.tart/vms/macOS_241227
du -sh $HOME/.tart/vms/macOS_250512
du -sh $HOME/.tart/vms/macOS_250603
du -sh $HOME/.tart/vms/macOS_251015
Download Xcode Images Manually
Download Xcode images from the Appcircle bucket. They are disk images for each Xcode version archived in a package.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_240306.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_240514.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_240918.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_241227.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_250512.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_250603.tar.gz
curl -L -O -C - https://storage.googleapis.com/appcircle-dev-common/self-hosted/xcodes_251015.tar.gz
If you encounter network interruption, just run the same command again. It should continue download for remaining part. It will result in saving both time and bandwidth.
Note: You can check the integrity of downloaded file by comparing the MD5 checksum.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
md5 xcodes_240306.tar.gz
md5 xcodes_240514.tar.gz
md5 xcodes_240918.tar.gz
md5 xcodes_241227.tar.gz
md5 xcodes_250512.tar.gz
md5 xcodes_250603.tar.gz
md5 xcodes_251015.tar.gz
After a couple of minutes later you should see the output below.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
MD5 (xcodes_240306.tar.gz) = 4df051e11b6c0b8670cd9b82928dfab2
MD5 (xcodes_240514.tar.gz) = e3edc40c9b6dda91530d8a1f8cf456bc
MD5 (xcodes_240918.tar.gz) = bb26c0070bbd1a8ed23fe59b87f0a144
MD5 (xcodes_241227.tar.gz) = ee312f6077b9a09a5563d57e50bf53f8
MD5 (xcodes_250512.tar.gz) = 8c66b7f20c64fc3e8f987d95aa31c50d
MD5 (xcodes_250603.tar.gz) = 1d65383129a0bcc650be506c4c1b827a
MD5 (xcodes_251015.tar.gz) = ee09cc713cbfaf276dbc9008fad403c0
Create folder for the Xcode disk images.
mkdir -p $HOME/images
Extract archive into the folder.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
tar -zxf xcodes_240306.tar.gz --directory $HOME/images
tar -zxf xcodes_240514.tar.gz --directory $HOME/images
tar -zxf xcodes_240918.tar.gz --directory $HOME/images
pigz -cvdp 4 xcodes_241227.tar.gz | tar xvf - --directory $HOME/images
pigz -cvdp 4 xcodes_250512.tar.gz | tar xvf - --directory $HOME/images
pigz -cvdp 4 xcodes_250603.tar.gz | tar xvf - --directory $HOME/images
pigz -cvdp 4 xcodes_251015.tar.gz | tar xvf - --directory $HOME/images
It may take a little to complete. Be patient and wait return of command.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
Note: This macOS VM image is the Sonoma (14.1) stack and comes with the Xcode versions below:
15.3.x15.2.x15.1.x15.0.x14.3.x
Note: This macOS VM image is the Sonoma (14.1) stack and comes with the Xcode versions below:
15.4.x15.3.x15.2.x15.1.x15.0.x14.3.x
Note: This macOS VM image is the Sonoma (14.5) stack and comes with the Xcode versions below:
16.1.x16.0.x15.4.x15.3.x15.2.x15.1.x15.0.x14.3.x
This stack has the beta version of Xcode that was included at the time the macOS image was built.
So, if you need to publish iOS apps to the App Store, you should upgrade to the next stack that has the latest GA versions of Xcode 16.x.x.
Otherwise, you might get the error below when you try to publish iOS apps to App Store.
... Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn't supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. ...
If you're currently not ready for Xcode 16.x.x migration, you can go on using the previous stack until you migrate your iOS apps to newer Xcode versions.
Note: This macOS VM image is the Sonoma (14.5) stack and comes with the Xcode versions below:
| Version | Build |
|---|---|
| 16.2 | 16C5032a |
| 16.1 | 16B40 |
| 16.0 | 16A242d |
Note: This macOS VM image is the Sequoia (15.4.1) stack and comes with the Xcode versions below:
| Version | Build |
|---|---|
| 16.3 | 16E140 |
| 16.2 | 16C5032a |
| 16.1 | 16B40 |
| 16.0 | 16A242d |
Note: This macOS VM image is the Sequoia (15.4.1) stack and comes with the Xcode versions below:
| Version | Build |
|---|---|
| 16.4 | 16F6 |
| 16.3 | 16E140 |
| 16.2 | 16C5032a |
| 16.1 | 16B40 |
| 16.0 | 16A242d |
Note: This macOS VM image is the Sequoia (15.6.1) stack and comes with the Xcode versions below:
| Version | Build |
|---|---|
| 26.0.1 | 17A400 |
| 16.4 | 16F6 |
| 16.3 | 16E140 |
| 16.2 | 16C5032a |
| 16.1 | 16B40 |
| 16.0 | 16A242d |
In order to keep free disk space sufficient for build pipelines, we're packaging the latest and most frequently used Xcode versions. But you can also install other Xcode versions yourself if required.
You can find more information about the build infrastructure in the documents below:
Download the macOS VM and Xcode Images Automatically
To download and extract the Appcircle runner VM and Xcode images in the background automatically, you can run the command below.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
curl -fsSL -O https://cdn.appcircle.io/self-hosted/download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "240306" &
curl -fsSL -O https://cdn.appcircle.io/self-hosted/download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "240514" &
curl -fsSL -O https://cdn.appcircle.io/self-hosted/download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "240918" &
curl -fsSL https://cdn.appcircle.io/self-hosted/download-runner-beta.sh -o download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "241227" &
curl -fsSL https://cdn.appcircle.io/self-hosted/download-runner-beta.sh -o download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "250512" &
curl -fsSL https://cdn.appcircle.io/self-hosted/download-runner-beta.sh -o download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "250603" &
curl -fsSL https://cdn.appcircle.io/self-hosted/download-runner-beta.sh -o download-runner.sh && \
chmod +x download-runner.sh && \
nohup ./download-runner.sh "251015" &
If you face any errors while downloading the files, please delete the corrupted file and re-run the command block above.
Host macOS Requirements
We're constantly bumping the VM macOS version according to Xcode requirements.
Below is the table of required host versions for currently supported macOS VMs:
| Version | Guest macOS | Host macOS |
|---|---|---|
251015 | Sequoia 15.6.1 | Sequoia or later |
250603 | Sequoia 15.4.1 | Sequoia or later |
250512 | Sequoia 15.4.1 | Sequoia or later |
241227 | Sonoma 14.5 | Ventura or later |
240918 | Sonoma 14.5 | Ventura or later |
240514 | Sonoma 14.1 | Ventura or later |
240306 | Sonoma 14.1 | Ventura or later |
If you don't need the latest Xcode and you want to run an older version of the macOS VM image that supports running on an older host, contact us through our support channels.
Disk Space Requirements
The recommended disk space for the macOS VM installation is 1TB.
If your host machine has a total storage capacity of 512GB, be aware that this will not be sufficient to download and extract the Appcircle runner macOS VM and the Xcode images compressed file directly on the host machine, especially with version 240918 or later. Although the extracted macOS VM and Xcode image files will fit within the 512GB capacity, the download and extraction process requires additional temporary space to process.
We recommend the following solutions for a possible workaround:
- Use an external disk formatted in
ExFATorAPFS. Please note thatFAT32is not a suitable option because it has a maximum file size limit of 4GB. - Use a network-based file system such as
SMBorNFS.SMBis recommended as it is a more compatible option with macOS thanNFS.
You can use the following commands in macOS Terminal to verify your total disk space.
df -h
system_profiler SPNVMeDataType
Please don't forget to change the working directory to the externally attached or network-based disk and run the macOS VM installation commands in that directory.
cd /path/where/the/external/disk/mounted
It may take some time to complete with respect to your network speed. You can see and follow the logs with the command below.
tail -f nohup.out
You can close the SSH or terminal session while the tool is running. The download and extract process will go on in the background.
But be aware that there might be some errors while downloading and extracting the VM image, such as network or disk errors. Please keep an eye on the logs.
If no specific image identifier is provided when executing the download-runner.sh tool, it will automatically attempt to download the most recent runner images.
Create Base Images
Create Base Runner VMs
Apple's virtualization framework allows us to run up to two macOS VMs on host.
If you have installed the macOS VM image previously and you're currently trying to upgrade your self-hosted runner environment to another release, first stop the runners if they're online.
Since the below steps will create new vm01 and vm02 from the base image, you should also cleanup the current ones using tart delete command.
tart delete vm01
tart delete vm02
Each runner must register to the self-hosted Appcircle server with a unique name and configuration. So we will need two VM base images.
When you list VMs with tart list command, you should see our extracted VM image in list.
In the steps below, we will create 2 base images named vm01 and vm02.
The vm01 base image is derived from our base image, and subsequently, the vm02 base image will be created from the vm01 base image.
This approach eliminates the need to redo all the configurations applied to vm01 when setting up vm02, ensuring efficiency and consistency across both virtual machines.
Create VM image for runner1.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
tart clone macOS_240306 vm01
tart clone macOS_240514 vm01
tart clone macOS_240918 vm01
tart clone macOS_241227 vm01
tart clone macOS_250512 vm01
tart clone macOS_250603 vm01
tart clone macOS_251015 vm01
It's not recommended to delete the base image (macOS_YY0M0D) as it won't save disk space due to copy-on-write file system on macOS. You can safely re-create vm01 from the same base image macOS_YY0M0D without downloading and extracting again from network if needed.
In docker terminology, vm01 and vm02 will be our docker images. We will configure them separately, persist our changes and then create containers to execute build pipelines. On every build, fresh containers will be used for both runners.
Configure Runner VM Resources
You can adjust the resource limits for runner VMs based on your needs.
By default, our runner images are configured with an 8GB memory limit and 4 CPU cores.
Total allocated resources (memory, CPU) for all VMs combined, should not exceed host machine's physical capacity for optimal performance.
Set Memory Limits
To configure the memory limit for a VM, run the following command:
tart set <vm_name> --memory <size_in_mb>
Replace vm_name with your VM's name and size_in_mb with the desired memory size in MB. E.g.,
tart set vm01 --memory 8192(8GB)
tart set vm01 --memory 16384(16GB)
Example configurations:
| Host Memory Size | Runner Memory Config. |
|---|---|
| 8GB | 1 x VM with 8GB |
| 16GB | 2 x VM with 8GB |
| 16GB | 1 x VM with 16GB |
| 32GB | 2 x VM with 16GB |
Set CPU Limits
To configure the number of CPU cores for a VM, run the following command:
tart set <vm_name> --cpu <count>
Replace vm_name with your VM's name and count with the desired number of CPU cores. E.g.,
tart set vm01 --cpu 4
tart set vm01 --cpu 8
To check the total number of CPU cores on your system, use the following command:
sysctl -n hw.ncpu
If you have an 8 core CPU according to the command output, you can run 2 VMs and allocate half of the cores to each one, which means 4 cores per VM. Or you can run a single VM using all 8 cores.
Example configurations:
| Host CPU Cores | Runner CPU Config. |
|---|---|
| 8 | 2 x VM with 4 Cores |
| 8 | 1 x VM with 8 Cores |
Mac devices that have M-series chips (Apple silicon) have two types of CPU cores that you should take into consideration when you configure CPU for the VMs. See the FAQ below for details.
Backing Up and Restoring VM Configuration
When recreating VMs or upgrading to a new image, it's important to preserve your custom settings.
-
Before making changes, backup your base VM's configuration file at
~/.tart/vms/<vm_name>/config.json. -
After recreating or upgrading the VM, you can either:
- Restore the entire configuration:
cp /path/to/your/backup/config.json ~/.tart/vms/<vm_name>/config.json - Or, manually set the values again using the
tart setcommands.
- Restore the entire configuration:
Configure Base Runner VMs
Be cautious when updating the base VMs (vm01 and vm02). Any changes made on these base VMs are persisted and may affect disk usage, keychain, and cache files on the runner VMs created from them.
If you're freshly creating the base VMs, you can ignore this warning. However, if you've already registered runners to your Appcircle server and want to make updates to the base VMs, it's highly recommended to disable the runner from the Appcircle dashboard to prevent builds from running on the base VMs.
Configure Runner 1
Start runner1 VM image for configuration.
- 240306
- 240514
- 240918
- 241227
- 250512
- 250603
- 251015
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.14.3.dmg:ro \
--disk=$HOME/images/xcode.15.0.dmg:ro \
--disk=$HOME/images/xcode.15.1.dmg:ro \
--disk=$HOME/images/xcode.15.2.dmg:ro \
--disk=$HOME/images/xcode.15.3.dmg:ro
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.14.3.dmg:ro \
--disk=$HOME/images/xcode.15.0.dmg:ro \
--disk=$HOME/images/xcode.15.1.dmg:ro \
--disk=$HOME/images/xcode.15.2.dmg:ro \
--disk=$HOME/images/xcode.15.3.dmg:ro \
--disk=$HOME/images/xcode.15.4.dmg:ro
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.14.3.dmg:ro \
--disk=$HOME/images/xcode.15.0.dmg:ro \
--disk=$HOME/images/xcode.15.1.dmg:ro \
--disk=$HOME/images/xcode.15.2.dmg:ro \
--disk=$HOME/images/xcode.15.3.dmg:ro \
--disk=$HOME/images/xcode.15.4.dmg:ro \
--disk=$HOME/images/xcode.16.0.dmg:ro \
--disk=$HOME/images/xcode.16.1.dmg:ro
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.16.0.dmg:ro \
--disk=$HOME/images/xcode.16.1.dmg:ro \
--disk=$HOME/images/xcode.16.2.dmg:ro
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.16.0.dmg:ro \
--disk=$HOME/images/xcode.16.1.dmg:ro \
--disk=$HOME/images/xcode.16.2.dmg:ro \
--disk=$HOME/images/xcode.16.3.dmg:ro
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.16.0.dmg:ro \
--disk=$HOME/images/xcode.16.1.dmg:ro \
--disk=$HOME/images/xcode.16.2.dmg:ro \
--disk=$HOME/images/xcode.16.3.dmg:ro \
--disk=$HOME/images/xcode.16.4.dmg:ro
screen -d -m tart run vm01 --no-graphics \
--disk=$HOME/images/xcode.16.0.dmg:ro \
--disk=$HOME/images/xcode.16.1.dmg:ro \
--disk=$HOME/images/xcode.16.2.dmg:ro \
--disk=$HOME/images/xcode.16.3.dmg:ro \
--disk=$HOME/images/xcode.16.4.dmg:ro \
--disk=$HOME/images/xcode.26.0.dmg:ro
SSH login into running macOS VM.
ssh -o StrictHostKeyChecking=no appcircle@$(tart ip vm01)
Note: You should use "cicd" as SSH login password.
While trying to connect VM you can get an SSH connection error as below.
ssh: Could not resolve hostname err: nodename nor servname provided, or not known
Wait a couple of seconds and let the VM start its internal services. You can try the same command until you connect successfully.
Since the VM IPs are rotating, it's possible to see the below error when you try to connect to the VM in the long term.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:f6CfksJoc0/ZIqItwH5IJDN87SP6RiOo9q1irzDxawU.
Please contact your system administrator.
Add correct host key in /Users/appcircle/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /Users/appcircle/.ssh/known_hosts:5
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
UpdateHostkeys is disabled because the host key is not trusted.
appcircle@192.168.64.2: Permission denied (publickey,password,keyboard-interactive).
The above example error message indicates that there is an entry for the server 192.168.64.2 located on line 5 of the known_hosts file that needs to be removed.
You can delete the old host key entry with the following command and then try re-connecting.
ssh-keygen -R $(tart ip vm01)
In the macOS VM, /Volumes/agent-disk/appcircle-runner is the root folder of runner.
cd /Volumes/agent-disk/appcircle-runner
So, the following commands will assume that current working directory is /Volumes/agent-disk/appcircle-runner.
1. Check the Runner Version
You may have installed the latest Appcircle runner VM image, but the Appcircle runner may not be up-to-date.
You can follow the steps below to check the Appcircle runner version and upgrade if it isn't the latest version.
- Check the version of the current installation.
./ac-runner --version
-
Check the latest version from the Upgrade Runner page.
-
If your version is not up to date, please follow the Update Runner section in the page.
You should run the curl and unzip commands on the /Volumes/agent-disk/ path.
Since you're in the appcircle-runner directory now, please change the directory one level up.
You don't need to apply the Reconfigure Runner section. But the Reinstall Service section is necessary since the latest version may also have some service updates.
When you complete update successfully, you should see the updated version in --version output.
Go to the appcircle-runner directory.
cd appcircle-runner
Check the version of the runner.
./ac-runner --version
2. Configure Base Runner's NTP Settings
MacOS VMs try to update their date and time using the network time protocol (NTP) by default.
If your organization has limited network access for the Appcircle runner machine, the VM may be unable to reach the servers responsible for updating its date and time settings.
In a situation like that, your organization might have an NTP server for internal usage.
You can configure your macOS runner VM to use your organization's own NTP server.
You can use the helper script named configure_ntp.sh that comes with the runner package to configure the NTP settings.
To configure NTP settings:
-
The IP address or URL of the NTP server should be known.
-
Network access should be allowed from the Appcircle runner to the NTP server.
-
You will find a script named
configure_ntp.shin thescriptsfolder inside theappcircle-runnerdirectory. -
Run the script and give the NTP server IP (or URL) as an argument, like the example below:
./scripts/configure_ntp.sh "10.10.1.50"
You should change "10.10.1.50" to the NTP server address of your organization in the example above.
3. Trust The Root Certificates of Your Organization
If the resources you want to connect use a self-signed certificate, you should also trust the root certificate of your organization in your Appcircle runner VMs. These resources can be:
- Git providers (GitLab, Bitbucket, Azure DevOps, etc.)
- Self-hosted Appcircle server
- Proxy server for network access
Trusting your organization's root certificate on the OS is crucial.
Because the runner will try to connect to these resources over HTTPS and the SSL certificate will be signed with your organization's root certificate.
Furthermore, if the runner attempts to access external web sites, the requests will most likely be intercepted by the proxy and re-signed with a self-issued certificate that is also signed by the root certificate.
You can use the helper script named install_cert.sh that comes with your runner package to configure the certificates.
-
You will find a script named
install_cert.shin thescriptsfolder inside theappcircle-runnerdirectory. -
Run the script like the example below:
./scripts/install_cert.sh
-
The script will ask you to enter a URL. Please give the URL of the resource that you need to connect to from the runner.
-
Hit "enter" and check the results.
-
Your organization's root CA certificate is now trusted on the OS, Java, Ruby, and Node.js.
For more detailed usage, you can check the Self-signed Certificates page.
4. Configure Runner Service
Note: Runner logs are kept in $HOME/appcircle-runner folder.
Stop runner service.
./ac-runner service -c stop
Edit appsettings.json with your favorite editor. (nano, vi etc.)
{
...
"ASPNETCORE_NOSHUTDOWN": "false",
...
"ASPNETCORE_REDIS_STREAM_ENDPOINT": "redis.appcircle.spacetech.com:443,ssl=true",
...
"ASPNETCORE_BASE_API_URL": "https://api.appcircle.spacetech.com/build/v1"
}
ASPNETCORE_NOSHUTDOWN: It should befalse. So, it will shutdown VM when build complete.ASPNETCORE_BASE_API_URL: It should be your self-hosted Appcircle server API URL.- The runner will register to server defined here and take the build jobs from there.
The latest macOS VM image,macOS_240221 or later, has the ASPNETCORE_NOSHUTDOWN setting as false by default and has no pre-defined ASPNETCORE_BASE_API_URL setting in the appsettings.json file.
So, if you did not upgrade the packaged self-hosted runner at previous steps above, only modifying the ASPNETCORE_BASE_API_URL value with the following command should be enough for the configuration up-to-here.
echo "$(jq '.ASPNETCORE_BASE_API_URL="https://api.test-appcircle.tool.zb/build/v1"' appsettings.json)" > appsettings.json
If you upgraded the self-hosted runner, you must also modify the ASPNETCORE_NOSHUTDOWN setting as well.
echo "$(jq '.ASPNETCORE_NOSHUTDOWN="false"' appsettings.json)" > appsettings.json
ASPNETCORE_REDIS_STREAM_ENDPOINT: It should be your self-hosted Appcircle server's Redis URL, port, and SSL settings.- If you are using the Appcircle server with HTTPS, then the port should be
443and thesslargument should be set totrue. - If you are using the Appcircle server with HTTP, then the port should be the external port of Redis which is
6379by default. And thesslargument should be set tofalse.- For instance,
redis.appcircle.spacetech.com:6379,ssl=false.
- For instance,
- If you are using the Appcircle server with HTTPS, then the port should be
Using an Up-to-Date Runner with an Out-of-Date Server
By default, the latest runner (1.7.0 or later) is compatible with the Appcircle server 3.18.0 or later. For this reason, if you are installing the latest runner or upgrading the runner from older versions and using an older server, you need to make extra configurations.
To make the Appcircle runner compatible with an older server, you must change the two settings below in the Appcircle runner appsettings.json, which will make it compatible with older servers.
echo "$(jq '.ASPNETCORE_SEND_BUILD_LOG_TO_REDIS="false"' appsettings.json)" > appsettings.json && \
echo "$(jq '.ASPNETCORE_WORKFLOW_UPDATES_DISABLED="false"' appsettings.json)" > appsettings.json
Create runner access token from appcircle server and register runner to server. See details in here.
For example,
./ac-runner register -t aat_eev4NQdG_7F2jodmMShBFhh_DgabOJSsWSMojX5_lo4 -n runner1 -p macOS_pool
It won't print anything to CLI on success. You can also check its exit value with echo $?. It should be 0 on success.
Finally run below command to edit self-hosted runner configuration for pre-installed platforms.
echo "$(jq '.OsValues = ["ios","android"]' selfHosted.json)" > selfHosted.json
Start runner service.
./ac-runner service -c start
Now you should see "runner1" in "Build > Self-hosted Runners" list. It may take a couple of seconds to become online.
If "runner1" is online, we can shutdown VM since configuration is done with success.
sudo shutdown -h now