It has only been a week since the ESXi-Arm Fling was released, but the amount of experimentation and frankly cool s*** that people have been able to do in such a short period of time has been pretty mind blowing. For example, did you know you could run ESXi-Arm on Nintendo Switch!?🤯
Andrei recently published a blog post on the official ESXi-Arm blog showcasing some of the really cool stuff the community has shared on Twitter, definitely worth checking digest post #1 it out if you have not seen it.
Something that really caught my eye which I did not see mentioned in Andre's blog post was from Twitter user Joakim Korhonen who shared that he was able to run Raspberry Pi's (rPI) OS (formally Raspbian OS) as a Virtual Machine running on top of the ESXi-Arm Fling!
— Joakim Korhonen (@korhojoa) October 8, 2020
This is pretty interesting because rPI OS was designed to run on a physical rPI and there are no installers other than the image file which you download and copy onto the SD Card to boot. What is really exciting about this news is that you can now run any of the popular rPI applications such as RetroPi or Pi-hole which traditionally may have required several rPI to host.
In addition, this can also benefit the rPI OS development community by making it easier to build and test applications on top of rPI OS as you can now spin these up as VMs and get all the benefits of vSphere and ESXi such as snapshots, cloning, etc. The possibilities are endless and wanted to give a huge thanks to Joakim for sharing his hack on getting this to work on ESXi-Arm. For those interested, I have documented the detailed instructions below.
UPDATE (11/106/20) - For those familiar with VMware Virtual Appliances (OVA) and using custom OVF properties for guest/application customization, be sure to check out this complimentary blog post on how to build your own rPI OS OVA that can allow you to easily deploy additional rPI OS VMs with ease, especially useful for testing and development purposes.
Step 1 - You need access to a system that has the qemu-img utility installed. In my setup, I am using a Photon OS 3.0 (x86) VM that I have lying around. This can also be an Ubuntu VM if you have one of those. You will also need about ~6.5GB of free storage for the converted file format.
The following packages should be installed if you are using Photon OS:
tdnf -y install qemu-img unzip wget
Step 2 - Download the latest rPI OS Buster image to your system
Step 3 - Use qemu-img to convert the image file to a VMDK
qemu-img convert -f raw 2020-05-27-raspios-buster-arm64.img -O vmdk 2020-05-27-raspios-buster-arm64.vmdk
Step 4 - SCP the VMDK file to the datastore of your ESXi-Arm host
Step 5 - We need to actually convert the VMDK one more time so ESXi understands it, as the qemu-img utility only converts it to a hosted format which is normally used by Workstation/Fusion. To do so, we just use our good ol' friend, vmkfstools. You need to SSH (SSH is disabled by default) to the ESXi-Arm host after SCP'ing the VMDK and then run this command from ESXi-Arm host:
vmkfstools -i 2020-05-27-raspios-buster-arm64.vmdk -d thin raspios-buster-arm64.vmdk
After the conversion completes, you can delete the source VMDK.
Step 6 - Download the latest Debian 10.x Arm Network Installer ISO and also upload that to the datastore of your ESXi-Arm host
Step 7 - Create a New VM called rPI-OS with the following configuration:
- Compatibility: ESXi 7.0 and later
- Guest OS Family: Linux
- Guest OS Version: Debian GNU/Linux 10 (64-Bit)
- CPU: 2 (or desired value)
- MEM: 2GB (or desired value)
- Hard Disk 1: Remove default since we are going to attach the one we just converted. To so by clicking on "Add New Device" and select Existing Hard Disk and locate that on the ESXi-Arm datastore
- CD/DVD dive 1: Select Datastore ISO File and locate the Debian Network Installer ISO from ESXi-Arm Datastore and ensure the device has checked box for "Connected"
Step 11 - Select /dev/sda2 to boot from
apt install -y linux-image-arm64 grub-efi-arm64
At this point, you should disconnect the Debian ISO from the vSphere UI or ESXi Embedded Host Client. You probably will see the following warning stating the GuestOS has locked the CD-ROM drive, go ahead and click on Yes to disconnect and that should allow the VM to continue booting from updated VMDK now.
Step 1 - In the vSphere UI or ESXi Embedded Host Client, change the disk from 3GB to whatever size you wish to use (this can be done while the VM is already booted up). In my example, I selected 10GB and the next step works for any disk capacity.
Step 2 - Open terminal in rPI OS and run the following command which will automatically expand filesystem and then reboot for changes to go into effect.
sudo raspi-config --expand-rootfs
If you do not want to go through this manual process again if you make a mistake, I highly recommend you create a VM Template before performing further customization and this way you can deploy additional copies.
Lastly, I wanted to also share that I was able to compile VMware Tools for rPI OS itself and have it successfully running. For those instructions, please refer to this blog post for more details.