Photo by Sumudu Mohottige on Unsplash
Do you want to run a 5G network in Apple Silicon π₯οΈ ?
Read this post if you are considering to run a 5G network in your home lab powered by Apple Silicon
So you have got your new Apple Silicon-powered machine π₯οΈ (Macbook Pro / MacMini / MacStudio ) and you are super eager to bring up a 5GC and gNodeB Simulator. Let's see.. If you want to try open5gs in Mac based ARM systems, you have 2 approaches
Install Natively in MacOS
Install in a Virtual Machine - Which is what I prefer
Again within Virtualization, Currently there are 2 choices for Linux Virtualization in MacOS
Use UTM - QEMU based virtualization manager that supports Apple Virtualization Kit for Advanced Usecases
Use Virtualbox Developer preview - Which is way less performant based on my experience
Obviously. I chose UTM. Here again, there are multiple choices 1. Emulate x86 Linux OS within ARM 2. Virtualize a Linux ARM VM inside Apple Silicon
I tried both approaches and here are my observations
- Emulating x86 inside ARM will make the open5GS and MongoDB installation smoother based on the APT package manager install, but it has very very poor emulation performance a. For this to work, you actually need Mongo DB running. But in my case, since UTM QEMU doesn't support
AVX
instruction set emulation, MongoDB didn't start and core dumped with
ILL (Illegal Instruction Set) Error.
Next I tried with Linux ARM within Apple Silicon and after lot of trial & errors, this is what worked for me
First, install Ubuntu 22.1 ARM based instance as a VM
Next, install Mongo DB by adding the APT source
Latest Mongo DB will fail with
libssl1.1
dependency and the great gurus of Ubuntu stopped supportinglibssl1.1
and moved tolibssl3
in Ubuntu, where Mongo DB requireslibssl1.1
. This is one of those Face Palm moments π in Opensource based ecosystems. You don't know when & how the dependencies change and there is absolutely no trace. Here is where RH, Suse & Canonicals of the world will thrive since they do all the required heavy lifting for the enterprise & telcos. Okay back to this topic...Nevertheless some good opensource souls πΌπ» have provided the arm64 port of
libssl1.1.so
here: http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb .Install that. Then Mongo DB will install without any errors.
Okay so the next stop is installing Open5GS package in Ubuntu. This should be faily simple since Open5GS is available as part of standard
apt get
right? Well not easy.. If you try to check here, you will only seeamd64
packages. So this leaves us with the only option of building from source as noted in https://open5gs.org/open5gs/docs/guide/02-building-open5gs-from-sources/. However, this step worked like a charm without any hiccups
Now I will go-ahead with UERANSIM on Linux ARM on Apple Silicon. Lets see how this goes. Stay tuned !