Earlier this year, I needed to deploy a task on an ARM64 host, but I didn’t have a physical machine on hand. So, I decided to create a virtualized solution. It worked pretty well and I shared my methodology at the recent BurgasConf 2019, held in the city of Burgas, Bulgaria.
In this post, I want to explain the background to my ARM64 virtualization and point you to the instructions I’ve created for doing it yourself. But first, a quick word about BurgasConf.
BurgasConf 2019
Bulgaria has a relatively small but fast-growing IT scene, especially when it comes to engineers working with open source software. Global companies, like VMware, recognize this and are building their presence in the country. To date, however, the sector has been mostly concentrated around the capital, Sofia. BurgasConf is one of a series of conferences, collectively known as the IT-Tour, that aim to support people working in some of the country’s other large cities, especially those interested in open source technologies. The tour has been running since 2012, and my impression is that it’s doing a good job.
I spoke about Network Service Mesh at the IT-Tour stop in the city of Veliko Tarnovo back in April and was inspired to come up with something new to offer in Burgas.
So, on to the subject I spoke about at BurgasConf talk: how to set up an ARM64 cluster on your x86 host using VMs.
Setting Up a Virtualized ARM64 Cluster
This was a classic case of necessity being the mother of invention. I needed to deploy a specific service in a Kubernetes or Docker swarm environment that was hosted on an ARM64 machine, but I didn’t have any of those physical devices at hand. So, I decided to try another approach and virtualize them instead.
I began to do this once before, just because I was interested in thinking about how it could be achieved. But it had been such a nightmare that I ran out of time and patience. This time, though, I had the incentive to push through and to write out the solution I came up with. I didn’t want to have to recreate the whole thing from scratch a second time.
I also wanted to help anyone else in the same situation. I’ve seen a few guides to ARM virtualization online but nothing had the detail that I was looking to share, or built everything from scratch, or took you through to virtualizing the Kubernetes or Docker swarm environment.
ARM processors, of course, are found everywhere these days, especially in mobile and IoT devices. They are cheap, consume very little power and have attracted a great community of passionate, creative developers who are doing interesting things with them.
In virtualizing an ARM64 cluster, I wasn’t aiming to create something that I’d actually use in production. The underlying architecture of my Linux laptop wasn’t ARM-based, so it was never going to give me a better performance than using a physical ARM chip (although if you do this on an ARM-based machine your performance will be pretty good).
But there are a number of advantages to virtualization beyond accommodating your lack of an available ARM device.
The Advantages of ARM64 Virtualization
For one thing, it’s free. You can test out an ARM-based solution for nothing (my virtualization works for both ARM32 and ARM64, by the way). It also gives you your own development environment – you can run an ARM project on your laptop and do it without having to carry around SD cards, cables or any other physical gear.
Plus, you get to leverage all the benefits of virtualization, including expanding your ARM virtualization to a full ARM64 cluster: if you want another device, you can just spin up another VM; you have reusable disk images; and you can save or load the state of your VM.
For the complete walkthrough of how to do this, check out the gist I have put up on GitHub. But it’s worth sharing my prerequisites for the build:
- Linux host machine (preferably an Ubuntu ARM host with KVM support for virtualization if you want ARM-like performance)
- 8GB of RAM or more
- 20GB of storage
If you have all that, set up shouldn’t take more than 30 minutes.
Once I had the virtualization available, I was able to test out the service I was interested in deploying to a Kubernetes or Docker swarm environment and make sure it would work as I intended.
ARM virtualization has the potential to help you develop all kinds of interesting projects – in home automation, IoT, automotive and other transport services and so on. Try it out and let me know if you have any feedback. I’m especially curious to know if you do this on an ARM-based machine and tried it in production.
You can find me at https://github.com/rdimitrov.
Stay tuned to the Open Source Blog and follow us on Twitter (@vmwopensource) for all the latest open source news and updates.