Create an ARM64 virtual environment using UTM and Vagrant

1. Creating an ARM64 development environment

This tutorial describes how to create a development environment in a virtual machine which uses the ARM64 architecture. This development environment can be used for most CITS3007 work; but

Steps

  1. Navigate to development environment directory

    Open Terminal and navigate to your development environment directory:

    cd ~/CITS3007_development_environment
  2. Create and enter an ARM64 subdirectory

  3. Initialize the Vagrant project

    Run:

    vagrant init utm/ubuntu-24.04

    This creates a default Vagrantfile that uses the “utm/ubuntu-24.04” box.

  4. Overwrite the Vagrantfile with a custom ARM64 configuration

    Execute the following command to replace the Vagrantfile with a custom configuration:

    curl --output Vagrantfile https://cits3007.arranstewart.io/labs/lab00-mac-arm64-Vagrantfile.rb

    You can alter the configuration if desired before bringing up the virtual machine, by editing the Vagrantfile (e.g. with nano or vim). The Vagrantfile contains (commented out lines) which configures a virtual machine with 8GB RAM and 6 CPU cores – uncomment these and adjust as needed. But note that for our purposes, that amount of RAM and that many CPU cores are typically not needed.

  5. Launch the ARM64 environment

    It’s possible to download and bring a VM up with one command (the “vagrant up” command, see below), but here we split this into multiple commands to make it easier to see what is happening at different stages (and to diagnose problems if they occur).

  6. Optional: extra development packages

    The previous steps should provide you with a development environment that can be used for nearly all labs – it includes basic development tools like the GCC compiler and make.

    For an environment that more closely matches the standard CITS3007 environment – running the following command from within the VM will install extra packages that include documentation, fuzzers, and debugging tools:

    curl -sSL https://raw.githubusercontent.com/cits3007/ubuntu-vagrant-box/refs/heads/master/provision-mac.sh | sudo bash




2. Notes on the ARM64 platform

In this section, we discuss some ways that an ARM64 platform can differ from the x86-64 platform.

2.1 What are some differences between ARM64 vs x86-64 platforms?

The standard CITS3007 development environment runs on the x86-64 architecture, and any code you submit for the CITS3007 project will be compiled and tested using GCC on the x86-64 architecture.

M-series Mac laptops, however, use the ARM64 architecture, which differs from x86-64 in several ways (note that the following list is not comprehensive!):

You can find comments on some of these differences in the “Miscellaneous C porting issues” section of the developer documentation for the ARMv7-A series of processors.

2.2 What platform will submitted projects be tested on?

Projects will be tested on the x86-64 platform, using GCC as a compiler, and the CITS3007 standard development environment.

2.3 How can I ensure my code runs correctly on the x86-64 platform?

It’s up to you to make sure that you thoroughly test your code and ensure it runs correctly on the x86-64 platform. Some suggestions as to how you might do so include:


Credits

Section 1 of this tutorial was written by Steve Beaver, with additions from Arran Stewart.