Magma Installation on Ubuntu 20.04 – Magma (2023)

Follow along this post to see how to install Magma in a virtual environment on Ubuntu 20.04 and set up a basic LTE connection.

Note 1:The Magma gateway cannot be set upon Apple computers with the M1 chip. Using Rosetta or even double virtualization will not do the trick. On MacOS, the installation of most prerequisites can be done relatively easily, especially with the help of brew. While brew can be set up for Ubuntu, a more roundabout approach will be taken here.

(Video) Installation of Magma

Note 2:When choosing a host machine, ensure that it has enough RAM and memory. Insufficient RAM will lead to errors such as the host closing the connection to the gateway VM when building the gateway.


systemctl start docker

Installing docker compose

Setting up Virtualbox

Magma Installation on Ubuntu 20.04 – Magma (1)Magma Installation on Ubuntu 20.04 – Magma (2)

  • Click on<Ok>and create a new passphrase.
  • To finish setting up Virtualbox, you need to complete two more steps
    • Restarting the system will take you to a screen asking for the passphrase generated above. Suppy this and the start the system.
    • If errors such as the following are produced, you will also have to log into the BIOS and disable secure boot.

Magma Installation on Ubuntu 20.04 – Magma (3)Magma Installation on Ubuntu 20.04 – Magma (4)

Installing Vagrant

Vagrant helps manage virtual machines and allows users to interact with them in a uniform way across systems.

curl -fsSL | sudo apt-key add -sudo apt-add-repository "deb [arch=amd64] $(lsb_release -cs) main"sudo apt-get update && sudo apt-get install vagrant

Setting up Go

The command given in theMagma prerequisites pageindicates that Go 1.13 is necessary.

  • Obtain the compressed file from the archived versions fromthe Go downloads page.
  • Runsudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.13.15.linuxamd64.tar.gz
  • Add Go to the path in~/.profileas below
export PATH=$PATH:/usr/local/go/bin

The Magma prerequisites page asks for the path to added to~/.bash_profileinstead of~/.bashrc. Look at this medium post and this Stack Exchange question for the difference between~/.bash_profile,~/.bashrcand~/.profile.

  • To check the correctness of the Go installation run
source ~/.profilego version

The output should be similar to that below

(Video) MAGMA AGW Installation

go version go1.13.15 linux/amd64
  • This will however not apply to any new terminals you create as the change is not in~/.bashrc. Therefore, restart the system (interchangeably used withhostfrom now on) for this change to take hold.

Setting up Python 3.7.3

TheMagma prerequisites pagerecommends that pyenv be installed to set up Python 3.7.3. However, we will usecondain this setup instead as we were unable to proceed with the following steps using pyenv on Ubuntu 20.04. A global installation of Python 3.7.3 is not recommended as discussedin this post on Python best practices.

conda config --set auto_activate_base false

to prevent the base environment from activating by default when a terminal starts.

  • Created a conda environment namedmagma_pythonwithPython 3.7.3andpip 21.2.2. Refer tothis conda cheat sheetfor conda commands.
  • Activate the environment using
conda activate magma_python
  • Install the remaining libraries in this environment as given in theprerequisites page.


Install as in theprerequisites page.


Magma can be cloned from the repositoryon the official GitHub page.

Prerequisites for deployment

  • Open two terminal tabs as directed in theQuick Start Guide(called guide from here on).
  • Activate the conda environment created previously in each terminal
conda activate magma_python
  • Check out the branch you want to use. If you want to use, say,v1.6, you would navigate to the magma git repository and do
git checkout v1.6
  • Provision the AGW VM as directed in the guide using one of the terminals.
  • As the Magma Quick Start Guide mentions, the development VMs are in the, and address spaces. These need to be made allowed ranges. If not,vagrant up magmawill terminate with an error similar to the one belowMagma Installation on Ubuntu 20.04 – Magma (5)
  • Follow the instructions in theVirtualBox manual on Host-Only Networkingand add

to/etc/vbox/networks.confcreating it in the process if necessary.

  • Further, in order to set up the magma VM, virtualization needs to be enabled on the host system. If it is not, it will produce an error such as that below

Magma Installation on Ubuntu 20.04 – Magma (6)

To fix this, log in to your BIOS (the method to do this varies from host to host) and enableVirtualization Technology. You will likely find this inSystem ConfigurationorSecurity. If this option is not available, then virtualization is not possible on your machine and you will require an new one.

(Video) Install Magma Access Gateway on Libvirt KVM/QEMU

  • Upon making these changes,vagrant up magmashould finish with an output similar to that shown below. It is important that the number of failures be zero i.e failed = 0.

Magma Installation on Ubuntu 20.04 – Magma (7)

  • The first time around, provisioning the AGW VM (the whole process fromvagrant up magma) took34 minuteson the author’s host machine.
  • Now, follow the instructions in the guide to ssh into the VM and build the AGW.
  • To set up the Orchestrator, once again follow the instructions in theBuild Orchestratorsection of the guide. This took around29 minuteson the author’s machine.
  • Start the Orchestrator as directed in the guide. If run with metrics, this should terminate with an output similar to that below

Magma Installation on Ubuntu 20.04 – Magma (8)

  • Navigating to themagma/cache/test_certsfolder (open usingnautilus/magma/cache/test_certs) and double clicking on theadmin_operator.pfxand supplying the password“magma”produces the following dialog box

Magma Installation on Ubuntu 20.04 – Magma (9)

Add the certificate to Firefox by navigating toPreferencesand looking for“View certificates”and adding the.pfxfile to the“Your certificates”tab of Certificate manager. As this has to be imported from the sytem and.cacheis a hidden folder, transfer the.pfxfile to a visible directory outside the repository and import it from there. This results in the following dialog box

Magma Installation on Ubuntu 20.04 – Magma (10)

Upon openinghttps://localhost:9443/swagger/v1/uiin Firefox, you will see the following warning (as mentioned in the guide)

Magma Installation on Ubuntu 20.04 – Magma (11)

(Video) Magma Access Gateway on Ubuntu (Bare Metal)

Click onAdvancedand then choose to continue. This will open the following

Magma Installation on Ubuntu 20.04 – Magma (12)

  • Attempting to connect the Orc8r and LTE Gateway using
fab -f register_vm

might produce an error such as the one below

...PermissionError: [Errno 13] Permission denied:'./../../.cache/test_certs/admin_operator.key.pem'...
sudo chown -R $USER .cache/test_certs/
  • Start the magmad service as directed in the guide. Note that you might see errors relating totd-agent-bit. These are to be expected as the Quick Start Guide doesn’t enable this service. Refer to thisissue about FluentBitfor more details.
  • Finally run the NMS UI as directed in the guide. Note that if theGateway Error 502persists, check the status of themagmaltedocker container using
docker container ls

and kill it if it is unhealthy using

docker kill <container_id>

and set up the NMS UI again.

  • If your Orchestrator (Orc8r) and AGW are connected and the magma services are running on the AGW, then the health of the gateway in the NMS UI (navigate to the Equipment tab on the left of the NMS UI and scroll down to Gateways) should readGood. This health status is based on how often the gateway checks in. Look atthis comment on the gateway health.
  • The Orc8r can be shut down usingdocker-compose down. If this fails, try
HOST [magma/orc8r/cloud/docker]$ ./

and thendocker-compose down.

If you would like to learn more about the project and get involved check thewebsitefor more information ordownload the codeand start to experiment with the platform.

(Video) Magma Access Gateway In-Depth Deployment Explanation


1. Magma Orchestrator Deployment | AWX | Ansible
(Magma India)
2. Magma Orchestrator Deployment
(Magma India)
3. Magma 1.12.2 Install Guide
4. Magma Orchestrator Deployment on Kind Kubernetes Cluster | MOK (Magma On Kind)
(Magma India)
5. Instalar Magma vEPC 4G - Access Gateway
(Capri Caviedes)
6. Deploy Magma locally on Kind kubernetes cluster with cert-manager
(Shubham Tatvamasi)
Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated: 03/03/2023

Views: 6748

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.