> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/vm-build-infrastructure/define-macos-build-infra-with-anka-registry.md).

# Set up a macOS VM build infrastructure with Anka Registry

Set up a Harness macOS build farm that uses an Anka registry and controller.

{% hint style="warning" %}
**Harness recommends** [**Harness Cloud**](/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/use-harness-cloud-build-infrastructure.md) **for macOS builds.**

This recommendation is due to licensing requirements and the complexity of managing macOS VMs with Anka virtualization.

With Harness Cloud, your builds run on Harness-managed runners, and you can start running builds in minutes.
{% endhint %}

This topic describes how to use AWS EC2 instances to run a macOS build farm with [Anka's virtualization platform for macOS](https://docs.veertu.com/anka/what-is-anka/). This configuration uses [AWS EC2 instances and dedicated hosts](https://aws.amazon.com/blogs/compute/getting-started-with-anka-on-ec2-mac-instances/) to host a Harness Delegate and Runner, as well as the Anka Controller, Registry, and Virtualization. Working through the Anka controller and registry, the Harness Runner creates VMs dynamically in response to CI build requests.

For more information about Anka and Mac on EC2 go to the Anka documentation on [What is the Anka Build Cloud](https://docs.veertu.com/anka/anka-build-cloud/), [Setting up the Controller and Registry on Linux/Docker](https://docs.veertu.com/anka/anka-build-cloud/getting-started/setup-controller-and-registry/), and [Anka on AWS EC2 Macs - Community AMIs](https://docs.veertu.com/anka/aws-ec2-mac/#community-ami).

The following diagram illustrates how Harness CI and Anka work together. The [Harness Delegate](/harness-ai/use-harness-platform/delegates/delegate/delegate-concepts/delegate-overview.md) communicates directly with your Harness instance. The [VM runner](https://docs.drone.io/runner/vm/overview/) maintains a pool of VMs for running builds. When the delegate receives a build request, it forwards the request to the runner, which runs the build on an available VM. The [Anka registry and controller](https://docs.veertu.com/anka/#controller--registry) orchestrate and maintain the Mac VMs. Once you set up the Harness and Anka components, you can scale up your build farm with additional templates, build nodes, and VMs.

![](https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-7bcb98ae1f3b9cfbc33f47d168891f62b77d5175%2Fmacos-build-infra-with-anka-registry-mult-nodes.png?alt=media)

This is one of several build infrastructure options, for example, you can also run Mac builds on [Harness Cloud build infrastructure](/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/use-harness-cloud-build-infrastructure.md)

### Requirements <a href="#requirements" id="requirements"></a>

This configuration requires:

* An [Anka Build license](https://veertu.com/anka-build/).
* Familiarity with AWS EC2, Anka, and the macOS ecosystem.
  * [What is the Anka build cloud?](https://docs.veertu.com/anka/anka-build-cloud/)
  * [Getting started with Anka on EC2 Mac instances](https://aws.amazon.com/blogs/compute/getting-started-with-anka-on-ec2-mac-instances/)
  * [Anka on AWS EC2 instances](https://docs.veertu.com/anka/aws-ec2-mac/)
* Familiarity with the [Harness Platform](/harness-ai/new-to-harness-platform/overview.md) and [CI pipeline creation](/continuous-integration/use-harness-ci/use-harness-ci/prep-ci-pipeline-components.md).
* Familiarity with Harness Delegates, VM runners, and pools.
  * [Harness Delegates](/harness-ai/use-harness-platform/delegates/delegate/delegate-concepts/delegate-overview.md)
  * [Drone VM runner overview](https://docs.drone.io/runner/vm/overview/)
  * [Drone pools](https://docs.drone.io/runner/vm/configuration/pool/)
  * [Drone Anka drivers](https://docs.drone.io/runner/vm/drivers/anka/)
  * [GitHub repository - Drone runner AWS](https://github.com/drone-runners/drone-runner-aws)

### Set up the Anka Controller and Registry <a href="#set-up-the-anka-controller-and-registry" id="set-up-the-anka-controller-and-registry"></a>

Install the Anka Controller and Registry on your Linux-based EC2 instance. For more information about this set up and getting acquainted with the Anka Controller and Registry, go to the Anka documentation on [Setting up the Controller and Registry on Linux/Docker](https://docs.veertu.com/anka/anka-build-cloud/getting-started/setup-controller-and-registry/).

1. In the [AWS EC2 Console](https://console.aws.amazon.com/ec2/), launch a Linux-based instance. Make sure this instances has enough resources to support the Anka Controller and Registry, at least 10GB. Harness recommends a size of **t2-large** or greater or storage of 100 GiB.
2. [SSH into your Linux-based EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html).
3. [Install Docker](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker).
4. [Install Docker Compose](https://docs.docker.com/compose/install/).
5. Follow the [Docker Compose post-installation setup](https://docs.docker.com/install/linux/linux-postinstall/) so you can run `docker-compose` without `sudo`.
6. [Download and extract the Anka Docker Package.](https://docs.veertu.com/anka/anka-build-cloud/getting-started/setup-controller-and-registry/#download-and-extract-the-docker-package)
7. [Configure Anka settings in docker-compose.yml.](https://docs.veertu.com/anka/anka-build-cloud/getting-started/setup-controller-and-registry/#configuration)
8. Run `docker-compose up -d` to start the containers.
9. Run `docker ps -a` and verify the `anka-controller` and `anka-registry` containers are running.
10. Optionally, you can [enable token authentication for the Controller and Registry](https://docs.veertu.com/anka/anka-build-cloud/advanced-security-features/root-token-authentication/).

### Set up Anka Virtualization <a href="#set-up-anka-virtualization" id="set-up-anka-virtualization"></a>

After setting up the Anka Controller and Registry, you can set up [Anka Virtualization](https://docs.veertu.com/anka/anka-virtualization-cli/) on a Mac-based EC2 instance. For more information, go to [Anka on AWS EC2 Macs](https://docs.veertu.com/anka/aws-ec2-mac/). These instructions use an [Anka community AMI](https://docs.veertu.com/anka/aws-ec2-mac/#community-ami).

1. In AWS EC2, [allocate a dedicated host](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-allocating). For **Instance family**, select **mac-m2**.
2. [Launch an instance on the dedicated host](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#launching-dedicated-hosts-instances), configured as follows:

   * Application and OS Images: Select **Browse AMIs** and select an [Anka community AMI](https://docs.veertu.com/anka/aws-ec2-mac/#community-ami). If you don't want to use a preconfigured AMI, you can use a different macOS AMI, but you'll need to take additional steps to [install Anka Virtualization](https://docs.veertu.com/anka/anka-virtualization-cli/getting-started/installing-the-anka-virtualization-package/) on the instance.
   * Instance type: Select a **mac-m2** instance.
   * Key pair: Select an existing key pair or create one.
   * Advanced details - Tenancy: Select **Dedicated host - Launch this instance on a dedicated host**
   * Advanced details - Target host by: Select **Host ID**
   * Advanced details - Tenancy host ID: Select your mac-m2 dedicated host.
   * User data: Refer to the Anka documentation on [User data](https://docs.veertu.com/anka/aws-ec2-mac/#user-data-envs).
   * Network settings: **Allow HTTP Traffic from the Internet** might be required to use virtualization platforms, such as VNC viewer.

   The first three minutes of this [Veertu YouTube video](https://www.youtube.com/watch?v=DoRaiMklIP0) briefly demonstrate the Anka community AMI set up process, include details about **User data**.
3. [Connect to your instance's GUI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-mac-instances.html#connect-to-mac-instance).
4. Open a terminal and run `anka version` to check if Anka Virtualization is installed. If it is not, [Install Anka Virtualization](https://docs.veertu.com/anka/anka-virtualization-cli/getting-started/installing-the-anka-virtualization-package/).
5. Make sure the environment is updated and necessary packages are installed. For example, you can run `softwareupdate -i -a`.
6. [Join your Anka Virtualization node to the Controller](https://docs.veertu.com/anka/anka-build-cloud/getting-started/preparing-and-joining-your-nodes/)

### Create Anka VM templates <a href="#create-anka-vm-templates" id="create-anka-vm-templates"></a>

1. In your Anka Virtualization EC2 instance, [create one or more Anka VMs](https://docs.veertu.com/anka/anka-virtualization-cli/getting-started/creating-vms/#create-your-first-vm).

   Anka VMs created with `anka create` are [VM templates](https://docs.veertu.com/anka/anka-build-cloud/getting-started/registry-vm-templates-and-tags/). You can use these to create Vms on other Anka Virtualization nodes you launch in EC2.
2. Set up port forwarding on each VM template to enable connectivity between the Harness Runner and your Anka VMs. For each VM template, stop the VM and run the following command:

   ```
   anka modify $VM_NAME add port-forwarding service -g 9079
   ```

   For more information about `anka modify`, go to the Anka documentation on [Modifying your VM](https://docs.veertu.com/anka/anka-virtualization-cli/getting-started/modifying-your-vm/).
3. [Push your VM templates to the Registry.](https://docs.veertu.com/anka/anka-build-cloud/getting-started/preparing-and-joining-your-nodes/#push-the-vm-to-the-registry)

### Install the Harness Delegate and Runner <a href="#install-the-harness-delegate-and-runner" id="install-the-harness-delegate-and-runner"></a>

Install a Harness Docker Delegate and Runner on the Linux-based AWS EC2 instance where the Anka Controller and Registry are running.

#### Configure pool.yml <a href="#configure-poolyml" id="configure-poolyml"></a>

The `pool.yml` file defines the VM pool size, the Anka Registry host location, and other information used to run your builds on Anka VMs. A pool is a group of instantiated VMs that are immediately available to run CI pipelines.

1. [SSH into your Linux-based EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html) where your Anka Controller and Registry are running.
2. Create a `/runner` folder and `cd` into it.

   ```
   mkdir /runner
   cd /runner
   ```
3. In the `/runner` folder, create a `pool.yml` file.
4. Modify `pool.yml` as described in the following example and the [Pool settings reference](#pool-settings-reference). You can configure multiple pools in pool.yml, but you can only specify one pool (by `name`) in each Build (`CI`) stage in Harness.

```yaml
version: "1"
instances:
  - name: anka-build
    default: true
    type: ankabuild
    pool: 2
    limit: 10
    platform:
      os: darwin
      arch: amd64
    spec:
      account:
        username: anka
        password: admin
      vm_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
      registry_url: https://anka-controller.myorg.com:8089
      tag: 1.0.6
      auth_token: sometoken
```

**Pool settings reference**

You can configure the following settings in your `pool.yml` file. You can also learn more in the Drone documentation for the [Pool File](https://docs.drone.io/runner/vm/configuration/pool/) and [Anka drivers](https://docs.drone.io/runner/vm/drivers/anka/).

**User Data Example**

Provide [cloud-init data](https://docs.drone.io/runner/vm/configuration/cloud-init/) in either `user_data_path` or `user_data` if you need custom configuration. Refer to the [user data examples for supported runtime environments](https://github.com/drone-runners/drone-runner-aws/tree/master/app/cloudinit/user_data).

Below is a sample `pool.yml` for GCP with `user_data` configuration:

```yaml
version: "1"
instances:
  - name: linux-amd64
    type: google
    pool: 1
    limit: 10
    platform:
      os: linux
      arch: amd64
    spec:
      account:
        project_id: YOUR_PROJECT_ID
        json_path: PATH_TO_SERVICE_ACCOUNT_JSON
      image: IMAGE_NAME_OR_PATH
      machine_type: e2-medium
      zones:
        - YOUR_GCP_ZONE # e.g., us-central1-a
      disk:
        size: 100
      user_data: |
        #cloud-config
        {{ if and (.IsHosted) (eq .Platform.Arch "amd64") }}
        packages: []
        {{ else }}
        apt:
          sources:
            docker.list:
              source: deb [arch={{ .Platform.Arch }}] https://download.docker.com/linux/ubuntu $RELEASE stable
              keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
        packages: []
        {{ end }}
        write_files:
          - path: {{ .CaCertPath }}
            path: {{ .CertPath }}
            permissions: '0600'
            encoding: b64
            content: {{ .TLSCert | base64 }}
          - path: {{ .KeyPath }}
        runcmd:
          - 'set -x'
          - |
            if .ShouldUseGoogleDNS; then
              echo "DNS=8.8.8.8 8.8.4.4\nFallbackDNS=1.1.1.1 1.0.0.1\nDomains=~." | sudo tee -a /etc/systemd/resolved.conf
              systemctl restart systemd-resolved
            fi
          - ufw allow 9079
```

| Setting                                                                                                                                                                                                              | Type           | Description                                                                                                                                                                                                                                |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`                                                                                                                                                                                                               | String         | Unique identifier of the pool. You will need to specify this pool name in Harness when you [set up the CI stage build infrastructure](#specify-build-infrastructure).                                                                      |
| `pool`                                                                                                                                                                                                               | Integer        | Warm pool size number. Denotes the number of VMs in ready state to be used by the runner.                                                                                                                                                  |
| `limit`                                                                                                                                                                                                              | Integer        | Maximum number of VMs the runner can create at any time. `pool` indicates the number of warm VMs, and the runner can create more VMs on demand up to the `limit`.                                                                          |
| For example, assume `pool: 3` and `limit: 10`. If the runner gets a request for 5 VMs, it immediately provisions the 3 warm VMs (from `pool`) and provisions 2 more, which are not warm and take time to initialize. |                |                                                                                                                                                                                                                                            |
| `username`, `password`                                                                                                                                                                                               | Strings        | User name and password of the Anka VM in the Anka Virtualization machine (the mac-m2 EC2 machine). These are set when you [run anka create](https://docs.veertu.com/anka/anka-virtualization-cli/getting-started/creating-vms/).           |
| `vm_id`                                                                                                                                                                                                              | String - ID    | ID of the Anka VM.                                                                                                                                                                                                                         |
| `registry_url`                                                                                                                                                                                                       | String - URL   | Registry/Controller URL and port. This URL must be reachable by your Anka nodes. You can configure `ANKA_ANKA_REGISTRY` in your [Controller's docker-compose.yml](https://docs.veertu.com/anka/anka-build-cloud/configuration-reference/). |
| `tag`                                                                                                                                                                                                                | String - Tag   | [Anka VM template tag.](https://docs.veertu.com/anka/anka-build-cloud/getting-started/registry-vm-templates-and-tags/)                                                                                                                     |
| `auth_token`                                                                                                                                                                                                         | String - Token | Required if you [enabled token authentication for the Controller and Registry](https://docs.veertu.com/anka/anka-build-cloud/advanced-security-features/root-token-authentication/).                                                       |

**File System Access**

In `harness-docker-runner`, the following default mount paths are used on Mac. Harness requires write access to these locations because it creates directories inside them.

If write access is blocked, runs will fail with a 500 error similar to:

```
failed with code: 500, message: { "error_msg": "failed to create directory for host volume path: /addon: mkdir /addon: read-only file system" } 
```

Default mount paths:

* `/tmp/addon`
* `/tmp/harness`
* `/private/tmp/harness` (only when the `CI_MOUNT_PATH_ENABLED_MAC` feature flag is enabled)

Harness also needs write access to any declared shared paths that your pipelines or CI Stages use.

#### Start the runner <a href="#start-the-runner" id="start-the-runner"></a>

[SSH into your Linux-based EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html) and run the following command to start the runner:

```
docker run -v /runner:/runner -p 3000:3000 drone/drone-runner-aws:latest  delegate --pool /runner/pool.yml
```

This command mounts the volume to the Docker runner container and provides access to `pool.yml`, which is used to authenticate with AWS and pass the spec for the pool VMs to the container. It also exposes port 3000.

You might need to modify the command to use sudo and specify the runner directory path, for example:

```
sudo docker run -v ./runner:/runner -p 3000:3000 drone/drone-runner-aws:latest  delegate --pool /runner/pool.yml
```

{% hint style="info" %}
**WHAT DOES THE RUNNER DO?**

When a build starts, the delegate receives a request for VMs on which to run the build. The delegate forwards the request to the runner, which then allocates VMs from the warm pool (specified by `pool` in `pool.yml`) and, if necessary, spins up additional VMs (up to the `limit` specified in `pool.yml`).

The runner includes lite engine, and the lite engine process triggers VM startup through a cloud init script. This script downloads and installs Scoop package manager, Git, the Drone plugin, and lite engine on the build VMs. The plugin and lite engine are downloaded from GitHub releases. Scoop is downloaded from `get.scoop.sh` which redirects to `raw.githubusercontent.com`.

Firewall restrictions can prevent the script from downloading these dependencies. Make sure your images don't have firewall or anti-malware restrictions that are interfering with downloading the dependencies.
{% endhint %}

#### Install the delegate <a href="#install-the-delegate" id="install-the-delegate"></a>

1. In Harness, go to **Account Settings**, select **Account Resources**, and then select **Delegates**.

   You can also create delegates at the project scope. In your Harness project, select **Project Settings**, and then select **Delegates**.
2. Select **New Delegate** or **Install Delegate**.
3. Select **Docker**.
4. Enter a **Delegate Name**.
5. Copy the delegate install command and paste it in a text editor.
6. To the first line, add `--network host`, and, if required, `sudo`. For example:

   ```
   sudo docker run --cpus=1 --memory=2g --network host
   ```
7. [SSH into your Linux-based EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html) and run the delegate install command.

{% hint style="info" %}
The delegate install command uses the default authentication token for your Harness account. If you want to use a different token, you can create a token and then specify it in the delegate install command:

1. In Harness, go to **Account Settings**, then **Account Resources**, and then select **Delegates**.
2. Select **Tokens** in the header, and then select **New Token**.
3. Enter a token name and select **Apply** to generate a token.
4. Copy the token and paste it in the value for `DELEGATE_TOKEN`.
   {% endhint %}

For more information about delegates and delegate installation, go to [Delegate installation overview](/harness-ai/use-harness-platform/delegates/delegate/install-delegates/overview.md).

#### Verify connectivity <a href="#verify-connectivity" id="verify-connectivity"></a>

1. Verify that the delegate and runner containers are running correctly. You might need to wait a few minutes for both processes to start. You can run the following commands to check the process status:

   ```
   docker ps
   docker logs DELEGATE_CONTAINER_ID
   docker logs RUNNER_CONTAINER_ID
   ```
2. In the Harness UI, verify that the delegate appears in the delegates list. It might take two or three minutes for the delegates list to update. Make sure the **Connectivity Status** is **Connected**. If the **Connectivity Status** is **Not Connected**, make sure the Docker host can connect to `https://app.harness.io`.

   ![](https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-b7c92d98d3cb26df2afbdf17432fc9bd22039afc%2Fset-up-an-aws-vm-build-infrastructure-13.png?alt=media)

The delegate and runner are now installed, registered, and connected.

### Specify build infrastructure <a href="#specify-build-infrastructure" id="specify-build-infrastructure"></a>

Configure your pipeline's **Build** (`CI`) stage to use your Anka VMs as build infrastructure.

{% tabs %}
{% tab title="Visual" %}

1. In Harness, go to the CI pipeline that you want to use the AWS VM build infrastructure.
2. Select the **Build** stage, and then select the **Infrastructure** tab.
3. Select **VMs**.
4. For **Operating System**, select **MacOS**.
5. Enter the **Pool Name** from your [pool.yml](#configure-poolyml).
6. Save the pipeline.

<figure><img src="https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-f3fdf4a9c126994f2c61f25ddd3ced8579613dad%2Fci-stage-settings-vm-infra.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="YAML" %}

```yaml
    - stage:
        name: build
        identifier: build
        description: ""
        type: CI
        spec:
          cloneCodebase: true
          infrastructure:
            type: VM
            spec:
              type: Pool
              spec:
                poolName: POOL_NAME_FROM_POOL_YML
                os: MacOS
          execution:
            steps:
            ...
```

{% endtab %}
{% endtabs %}

#### Delegate selectors with self-managed VM build infrastructures <a href="#delegate-selectors-with-self-managed-vm-build-infrastructures" id="delegate-selectors-with-self-managed-vm-build-infrastructures"></a>

{% hint style="info" %}
Currently, delegate selectors for self-managed VM build infrastructures is behind the feature flag `CI_ENABLE_VM_DELEGATE_SELECTOR`. Contact [Harness Support](mailto:support@harness.io) to enable the feature.
{% endhint %}

Although you must install a delegate to use a self-managed VM build infrastructure, you can choose to use a different delegate for executions and cleanups in individual pipelines or stages. To do this, use [pipeline-level delegate selectors](/harness-ai/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md#pipeline-delegate-selector) or [stage-level delegate selectors](/harness-ai/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md#stage-delegate-selector).

Delegate selections take precedence in the following order:

1. Stage
2. Pipeline
3. Platform (build machine delegate)

This means that if delegate selectors are present at the pipeline and stage levels, then these selections override the platform delegate, which is the delegate that you installed on your primary VM with the runner. If a stage has a stage-level delegate selector, then it uses that delegate. Stages that don't have stage-level delegate selectors use the pipeline-level selector, if present, or the platform delegate.

For example, assume you have a pipeline with three stages called `alpha`, `beta`, and `gamma`. If you specify a stage-level delegate selector on `alpha` and you don't specify a pipeline-level delegate selector, then `alpha` uses the stage-level delegate, and the other stages (`beta` and `gamma`) use the platform delegate.

<details>

<summary>Early access feature: Use delegate selectors for codebase tasks</summary>

{% hint style="info" %}
Currently, delegate selectors for CI codebase tasks is behind the feature flag `CI_CODEBASE_SELECTOR`. Contact [Harness Support](mailto:support@harness.io) to enable the feature.
{% endhint %}

By default, delegate selectors aren't applied to delegate-related CI codebase tasks.

With this feature flag enabled, Harness uses your [delegate selectors](/harness-ai/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md) for delegate-related codebase tasks. Delegate selection for these tasks takes precedence in order of [pipeline selectors](/harness-ai/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md#pipeline-delegate-selector) over [connector selectors](/harness-ai/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md#infrastructure-connector).

</details>

{% hint style="info" %}
This configuration applies to Harness CI VM Runners used for Windows build VMs.
{% endhint %}

You can make custom CA certificates available inside all build step containers (including the `drone/git` clone container) on **Windows build VMs** by setting the `DRONE_RUNNER_VOLUMES` environment variable when starting the VM runner.

## Example <a href="#example" id="example"></a>

```bash
docker run -d \
  -v /runner:/runner \
  -p 3000:3000 \
  -e DRONE_RUNNER_VOLUMES=/custom-cert:/git/mingw64/ssl/certs \
  <your_registry_domain>/drone/drone-runner-aws:latest \
  delegate --pool /runner/pool.yml
```

## Notes <a href="#notes" id="notes"></a>

* The certificate file inside `/custom-cert` must be named **`ca-bundle.crt`**.
* The `drone-git` container on Windows expects the certificate to be available at **`C:\git\mingw64\ssl\certs\ca-bundle.crt`**.
* The `DRONE_RUNNER_VOLUMES` path must use **Linux-style syntax** — use `/` as the path separator and omit the drive letter (`C:`), even though the build VM runs Windows.

### Add more Mac nodes and VM templates to the Anka Registry <a href="#add-more-mac-nodes-and-vm-templates-to-the-anka-registry" id="add-more-mac-nodes-and-vm-templates-to-the-anka-registry"></a>

You can [launch more Anka Virtualization nodes on your EC2 dedicated host](#set-up-anka-virtualization) and [create more VM templates](#create-anka-vm-templates) as needed. After you join a Virtualization node to the Controller cluster, it can pull VM templates from the registry and use them to create VMs.

### Troubleshoot self-managed VM build infrastructure <a href="#troubleshoot-self-managed-vm-build-infrastructure" id="troubleshoot-self-managed-vm-build-infrastructure"></a>

Go to the [CI Knowledge Base](/continuous-integration/troubleshooting-and-resources/ci-articles-and-faqs/continuous-integration-faqs.md) for questions and issues related to self-managed VM build infrastructures, including:

* [Can I use the same build VM for multiple CI stages?](/continuous-integration/troubleshooting-and-resources/ci-articles-and-faqs/continuous-integration-faqs.md#can-i-use-the-same-build-vm-for-multiple-ci-stages)
* [Why are build VMs running when there are no active builds?](/continuous-integration/troubleshooting-and-resources/ci-articles-and-faqs/continuous-integration-faqs.md#why-are-build-vms-running-when-there-are-no-active-builds)
* [How do I specify the disk size for a Windows instance in pool.yml?](/continuous-integration/troubleshooting-and-resources/ci-articles-and-faqs/continuous-integration-faqs.md#how-do-i-specify-the-disk-size-for-a-windows-instance-in-poolyml)
* [Clone codebase fails due to missing plugin](/continuous-integration/troubleshooting-and-resources/ci-articles-and-faqs/continuous-integration-faqs.md#clone-codebase-fails-due-to-missing-plugin)
* [Can I limit memory and CPU for Run Tests steps running on self-managed VM build infrastructure?](/continuous-integration/troubleshooting-and-resources/ci-articles-and-faqs/continuous-integration-faqs.md#can-i-limit-memory-and-cpu-for-run-tests-steps-running-on-harness-cloud)

{% @harness-feedback/feedback %}
