Start Building for Free

Using the Linux VM execution environment

2 months ago1 min read
Server v4.x
Server v3.x
On This Page

You can run your jobs in the linux VM (virtual machine) execution environment by using the machine executor and specifying a Linux image. Using the machine executor runs your jobs in a dedicated, ephemeral VM.

Using the machine executor gives your application full access to OS resources and provides you with full control over the job environment. This control can be useful in situations where you need full access to the network stack; for example, to listen on a network interface, or to modify the system with sysctl commands.

To use the machine executor, use the machine key in your job configuration and specify an image:

You can view the list of available images in the docs Configuration Reference, or on the Developer Hub. If you are working on an installation of CircleCI server, you will notice in the example above the syntax is slightly different, and the available Linux images are managed by your system administrator.

Available LinuxVM resource classes

ClassvCPUsRAMDisk SizeCloudServer
medium27.5 GB150GB
large415 GB150GB
xlarge832 GB150GB
2xlarge1664 GB150GB
2xlarge+3264 GB150GB

View resource usage

To view the compute resource usage for the duration of a job in the CircleCI web app:

  1. Select Dashboard from the sidebar menu
  2. Use the dropdown menus to select a project, and a branch
  3. Expand your workflow ( )
  4. Select a job by clicking on the job name
  5. Select the Resources tab to view CPU and RAM usage for the duration of the job

You can use these insights to decide whether to make changes to the job’s configured resource class. You can also access resource class Insights.

Resources tab

Pre-installed software

The most up to date list of pre-installed software can be found on the Discuss page.

If you are already using an image and would like to verify the all the packages that come pre-installed, you can run the apt list --installed command as a step, like in the example below:

version: 2.1
    machine: # executor type
      image: ubuntu-2004:2022.07.1
      - run: apt list --installed

Additional packages can be installed with sudo apt-get install <package>. If the package in question is not found, sudo apt-get update may be required before installing it.

Use machine with Docker

Using the machine executor also means that you get full access to the Docker process. This allows you to run privileged Docker containers and build new Docker images.

The following example uses an image and enables Docker layer caching (DLC) which is useful when you are building Docker images during your jobs.

  image: ubuntu-2004:202104-01
  docker_layer_caching: true    # default - false

Using machine and IP ranges

The IP range is reserved by CircleCI for internal use on the machine executor. This range should not be used in your jobs.

Next steps

To find out about migrating a project from using the Docker executor to using machine, see the Executor Migration from Docker to Machine document.

Help make this document better

This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.

Need support?

Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.

You can also visit our support site to find support articles, community forums, and training resources.