Tuesday, April 26, 2022

Installing arm64 version of Debian as a virtual machine in Proxmox

I wanted to test out the arm64 snap build of the Tellsis language translator, so I tried installing a arm64 VM using this guide. (Update April 29, 2022: Step by step instructions at end of post.)

The written version of the guide is here.

By the way, the installation process can take a long time. For me, it was around one and a half hours for the installation process to complete.

If you follow this guide, the VM will boot into the EFI shell each time, and you need to manually type in
fs0:\EFI\debian\grubaa64.efi
to start the OS. To avoid this, after booting into Debian, run the following:
sudo apt install refind
sudo mvrefind /boot/efi/EFI/refind /boot/efi/EFI/BOOT
Then, change the refind timeout to 2s by editing /boot/efi/EFI/BOOT/refind.conf and change
timeout 20
to
timeout 2
This should then let you boot into the refind menu, and after 2s, it will boot into grub, which will then boot into Debian.
(To avoid this, you can follow my step by step instructions at the end of this post, which uses a EFI disk as part of the process.)

Anyway, here is a screenshot of Debian 11 running on QEMU aarch64.

During the installation process, I chose to install XFCE desktop environment. After installation, I switched the display back to "Standard VGA" and managed to boot to this screen.


I then installed snap and Tellsis language translator.
sudo apt install snapd
sudo snap install telsis-translator-flutter --channel=latest/edge
/snap/bin/telsis-translator-flutter
And got this!
 
Yes! Looks like the Tellsis language translator will run on ARM64 platforms too!

To automatically log in a certain user on boot, when using lightdm,
sudo nano /etc/lightdm/lightdm.conf
and add
[SeatDefaults]
autologin-user=username
to the end of the file, replacing username with the name of the user to log in automatically. Remember, this is not safe as no password is required to log into the system.

Note: Regarding the EFI shell issue, I think I figured it out. The trick is to create a EFI disk. However, the default size of the EFI disk that Proxmox creates is too small, so the process is:
- When creating the VM, in the System tab, choose "Add EFI Disk", select a location for it, choose "Raw disk image (raw)" for the Format, and do not pre-enroll keys.
- Once the VM has been created, go to the console of your server (either via web UI or SSH) and resize the EFI disk using:
qemu-img resize path_to_efi_disk 64M
where path_to_efi_disk is the full path to the disk image, which should be named vm-XXX-disk-0.raw (XXX is the VM number).
This should change the EFI disk to the required size. I have included this as part of the step by step instructions below.

Step by step instructions:

I have taken the instructions for Debian from here and adapted it for the following set of instructions which I used to install Debian 11, arm64 version.
 
- Upload the Debian arm64 iso to the Proxmox server, either by downloading it to a local computer and then uploading to the server, or using the web UI to download it directly to the server
- Use the Proxmox web UI to create a VM on the node you want
- Give the VM a name and assign it a VM ID; in this example, the VM ID will be 101 > Next
- For OS, set the Type to Linux, Version to 5.x - 2.6 Kernel and select Do not use any media > Next
- On the System tab set the BIOS for OVMF (UEFI), check the Add EFI Disk checkbox, select a location for it (must not be lvm-thin; in this example, mine is in a zfs pool called pve430zfs), choose "Raw disk image (raw)" for the Format, and do not pre-enroll keys > Next
- On the Hard Disk tab, set the Storage device and Disk size to 16 (adjust as needed) > Next
- On the CPU tab, set the number Cores to 4 (adjust as needed) > Next
- On the Memory tab, set the Memory to 8192 (adjust as needed) > Next
- Leave the defaults on the Network tab > Next
- Verify the summary and click Finish
- Select the VM in the left navigation pane
- Select Hardware from the left navigation sub-menu
- Click on the CD/DVD Drive to select it > Click Remove at the top of the main content area > Click Yes to confirm
- Click Add > Serial Port > Leave the Port Number 0 > Click Add (This step is optional; the default VGA works too.)
- Click Add > Select CD/DVD Drive > Set the Bus/Device to SCSI > Select the Storage device where the Ubuntu arm64 iso is uploaded > Select the uploaded Ubuntu arm64 iso > Click Create
- Double click Display to edit it > Set the Graphic card value to Serial terminal 0 > Click OK (This step is optional; the default VGA works too.)
- Select Options from the left navigation sub-menu
- Double click Boot order to edit it > Drag/drop the SCSI2 device (where the Ubuntu iso is attached) to the top of the list > Click OK
- Right click the ProxMox node name > Console
- Once the VM has been created, go to the console of your server (either via web UI or SSH) and resize the EFI disk using:
qemu-img resize path_to_efi_disk 64M
where path_to_efi_disk is the full path to the disk image, which should be named vm-101-disk-0.raw (101 is the VM number).
In this example, the command would be:
qemu-img resize /zfspool/pve430zfs/images/101/vm-101-disk-0.raw 64M
- Run the following commands in the terminal
# edit the VM conf file, change 101 to the VM ID for the VM
nano /etc/pve/qemu-server/101.conf
- Add the following line to the bottom of the .conf file:
arch: aarch64
- Find the line starting with efidisk0: and change it to something like the following:
efidisk0: pve430zfs:101/vm-101-disk-0.raw,size=64M
where pve430zfs is the storage location.
- Find the line starting with vmgenid: and comment it out by adding a # to the beginning of the line
- Press CTRL+O, Enter, CTRL+X to write the changes to the conf file
- Back in the Proxmox web UI, select the VM from the left navigation menu
- Click console in the left sub-navigation menu
- Click Start at the top right of the screen to start the VM
- Wait a moment for the serial console to initialize
- Follow the prompts to complete the OS installation
NOTE: This will feel slower than normal, allow it time to complete; for me, it took around one and a half hours
- After the installation completes, at the prompt to reboot, reboot and let it boot into the installer again; then, select the Shutdown dropdown at the top of the screen > Stop
- Select Hardware from the left sub-navigation menu
- Double click the CD/DVD Drive to edit it > Select Do not use any media > Click OK
- Go back to the VM console
- Click Start at the top right of the screen to start the VM again
- The GRUB menu should boot and start loading Debian

No comments: