How to Setup Metal³on Ubuntu with Virtual Box

Safe
4 min readJun 14, 2023

--

Setting up a development environment for, an open-source project for bare metal infrastructure management in Kubernetes, can be an exciting journey. However, like any technical endeavor, it comes with its fair share of challenges. This article aims to guide you through the process of setting up a Metal³ development environment on Ubuntu, so you probably won’t have to go through the same challenges I faced.

To get started, you would need the System Requirements and Dependencies, this is s detailed list of system requirements, including hardware specifications and Ubuntu version compatibility.

The Metal³-development environment is a collection of scripts in a GitHub repository inside the Metal³ project that aims to allow contributors and other interested users to run a fully functional Metal³ environment for testing and have a first contact with the project.

Actually, Metal³-dev-env sets up an emulated environment that creates a set of virtual machines (VMs) to manage as if they were bare metal hosts.

The Prerequisites include ;

  • Minimum resource requirements for the host machine: 4C CPUs, 16 GB RAM memory
  • A system with the latest version of Ubuntu or 22.04
  • Virtual Machines to emulate bare metal hosts
  • Creating a passwordless sudo access

I would share this guide on how to create a VM using VirtualBox

VirtualBox is typically used in this case to have easy access via a Graphical User Interface which the VirtualBox provides as seen below.

SystemAfter successfully installing the VirtualBox, it should look like this

You might need to disable UEFI secure boot manually from the setup if you face this error during VirtualBox installation.

The guide would help you create a new VM, select a desktop ISO if you want a graphical interface from here https://releases.ubuntu.com/jammy/, download, then import it and your VM

For the VM setup

  • Operating system to Linux and select Ubuntu 22.04
  • Memory should be 8192 (it translates to 8GB)
  • Video memory should be 128 MB (max size)
  • Disable the audio, you don’t need it and it will be a bit faster
  • Increase the size of the disk to at least 80GB

Like this

Choose your ISO disk file like below

and your VM should be up and running like this

Once it starts running remember it’s a new software so you would need to configure our GitHub on the terminal before cloning the metal3-dev-env repository.

Next, use this guide https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/ to enable passwordless sudo access

Or enter this command

sudo usermod -aG sudo ${user}
sudo visudo

Replace %sudo ALL=(ALL:ALL) ALL with sudo ALL=(ALL) NOPASSWD: ALL

Clone the repo

git clone https://github.com/metal3-io/metal3-dev-env
cd metal3-dev-env
make

make is composed of 3 bash installation and configuration scripts plus a verification one:

01_prepare_host.sh — Mainly installs all needed packages.

02_configure_host.sh — Basically create a set of VMs that will be managed as if they were bare metal hosts. It also downloads some images needed for Ironic.

03_launch_mgmt_cluster.sh — Launches a management cluster using minikube and runs the bare metal operator on that cluster.

04_verify.sh — Finally runs a set of tests that verify that the deployment was completed successfully

You could also run the scripts simultaneously,

./01_prepare_host.sh

In case you run into this error while running the second script

First (for Intel), go to your VM setting in VirtualBox and enable nested virtualization

If the box is frozen you might need to manually go to your BIOS setup and enable nested virtualization as seen below.
Note that this works for only Intel, the process of enabling nested virtualization manually might be different if your system is AMD

You might need to create a new VM and then run this

grep vmx /proc/cpuinfo

It should return an output, you can then run the scripts again and it should pass successfully like below.

--

--

Safe
Safe

Written by Safe

An experienced web developer and DevOps engineer learning and experimenting with new technologies, sharing knowledge and helping beginners in the tech community

No responses yet