Setting Up ARM VM on Proxmox VE
Tags: proxmox, arm, linux, virtualmachine
Published: 2024-05-18 17:00:42

Running ARM64 virtual machines on Proxmox VE is now possible with the addition of ARM64 emulation support. This guide will walk you through the steps needed to create and run an ARM64 VM on Proxmox VE, whether for testing, development, or other purposes.

**Disclaimer**: ARM emulation on Proxmox VE is an experimental feature and not fully supported or extensively tested by Proxmox. Users may encounter errors or issues that are not covered in this guide.

## Prerequisites

First, ensure the `pve-edk2-firmware-aarch64` package is installed. This package provides the (U)EFI firmware necessary for ARM64 VM integration. Note that this package isn't installed automatically during upgrades, so you'll need to install it manually.

```bash
apt update
apt install pve-edk2-firmware-aarch64
```

## Upload the ARM64 ISO to Proxmox VE

You'll need an ARM64 ISO image, and for this guide, we'll use Debian 12 "Bookworm". Ensure you're using the AArch64 ISO, the official name for the 64-bit ARM architecture. Upload the ISO to your Proxmox VE storage.

![Upload ISO to Proxmox VE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rz4pyrsg1pb2oxgm1gqm.png)

## Create a New VM

To create a new VM, click on the "Create VM" button in the Proxmox VE interface. Assign a name and ID to your VM.

![Create VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ck9xfyfs8uqmz0dssd6h.png)

In the OS tab, disable the CD/DVD Drive by selecting "Do not use any media."

![OS Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqs7i3l54tev3klur9e4.png)

In the System tab, set the Graphic card to "Serial terminal 0," change the BIOS to "OVMF (UEFI)," and disable EFI Disk creation by unchecking the box "Add EFI Disk" (we will create it later manually). Ensure the SCSI Controller is set to "VirtIO SCSI."

![System Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6uaio9d76kurri3dim8y.png)

Next, in the Disks tab, choose the storage and space allocation for your VM, ensuring "IO thread" is disabled by unchecking the box.

![Disks Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wvillgdrdzs229obbftt.png)

In the CPU tab, do not add a CPU type, leave it as default.

![CPU Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78we3o05k2e2b2l4f43n.png)

Allocate the desired amount of RAM in the Memory tab, and no changes are needed in the Network tab.

![Confirm Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uoupy5s0zywseiyw36ii.png)

## Modify VM Hardware

After creating the VM, go to the hardware settings to remove the existing CD/DVD drive. Then, add a new one by choosing "SCSI" as the Bus/Device and selecting the Debian ISO image you uploaded earlier.

![Hardware](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yyix9jgqqb53vcasqt14.png)

## Edit the VM Configuration File

Edit the configuration file located at `/etc/pve/qemu-server/<vm_id>.conf` by adding and modifying the lines as follows:

```bash
nano /etc/pve/qemu-server/<vm_id>.conf
```

Add `arch: aarch64` at the bottom of the file:
```
arch: aarch64
```

Comment out the line that starts with `vmgenid:` by adding a `#` at the beginning:
```
#vmgenid: <value>
```

Remove the line that starts with `cpu:`, if it exists:
```
cpu: <value>
```

## Adjust Boot Order

Go to the VM "Options" and change the "Boot Order" to place the CD/DVD drive with the Debian ISO as the first boot device.

![Boot Order](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6qdk98g6cag8w1rufmhp.png)

## Create an EFI Disk

Run the following command to create an EFI disk for your VM, replacing `<VM_ID>` with your actual VM ID:

```bash
qm set <VM_ID> -efidisk0 second:1,efitype=4m,format=raw
```

## Launch the VM and Install the OS

Start the VM and follow the prompts to complete the Debian installation. It's highly recommended to use the xterm.js option in the Proxmox VE interface to connect to the VM for a smoother installation experience.

![Launch VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xocufw299h1ba17sjafq.png)

## Post-Installation

After the OS installation is complete, go to the VM hardware settings, remove the CD/DVD drive, and change Display to VNC. Then restart the VM to ensure it boots correctly from the installed OS. Congratulations! You now have an ARM64 VM running on Proxmox VE.

## Troubleshooting

If you encounter the following error:

```bash
qemu-system-aarch64: -drive if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/dev/second/vm-104-disk-1,size=67108864: The sum of offset (0) and size (0) has to be smaller or equal to the actual size of the containing file (4194304)
```

Follow these steps to resolve it:

1. Remove the EFI Disk by going to the VM's "Hardware" tab, selecting the EFI disk, and clicking "Remove."
2. Recreate the EFI Disk with the following command, replacing `<VM_ID>` with your actual VM ID:

    ```bash
    qm set <VM_ID> -efidisk0 second:1,efitype=4m,format=raw
    ```

3. Start the VM again.

That's all! I hope you enjoyed this content and using ARM VM on Proxmox.