Run CBL-Mariner Microsoft Linux on VirtualBox | VMware

Posted on 106 views

Recently, Microsoft released a Linux-based Operating system that can be downloaded and installed for free just like any other distro. This Operating system is known as Common Base Linux Mariner abbreviated as CBL-Mariner. This is a full operating system developed and maintained by Microsoft itself. This guide demonstrates how to build and run CBL-Mariner Microsoft Linux distribution on VirtualBox | VMware.

The CBL-Mariner Operating system was released since the Windows company needs a basis for Windows Subsystem for Linux(WSL) for Windows 11 and Windows 365. In other words, it is simply designed to provide a consistent platform for cloud services. CBL-Mariner existed before and was being internally used for the infrastructure of the Azure Cloud. The Redmond company worked more to harden the kernel, signed updates, and added many more features to it.

One of the most amazing characteristics of CBL-mariner is that it is lightweight. Whether deployed as a container or container host, it consumes limited disk and memory. Another feature is its ability to update model and image-based update models when security vulnerabilities occur.

Pre-requisites

Before we start on the installation of CBL-Mariner ensure that you have:

  • VirtualBox or Vmware installed on your machine.
  • Your machine has Virtualization support (required to build ISO as well)
  • User account able to run sudo
  • Internet connectivity from your machine

Update and upgrade your system:

# Ubuntu / Debian
sudo apt update
sudo apt upgrade -y
sudo reboot

# CentOS / RHEL / Rocky / Fedora
sudo yum -y update
sudo reboot

Step 1: Download and Generate CBL-Mariner ISO

In this guide, we will download CBL-Mariner and generate the ISO file as there is no ISO image yet for download. We will need a series of packages, ensure you have them installed.

## On Ubuntu
sudo apt update
sudo apt install software-properties-common -y
sudo apt -y install git make tar wget curl rpm qemu-utils golang-go genisoimage python2-minimal bison gawk pigz

## On RHEL/CentOS/Rocky Linux 8
sudo yum -y install git make tar wget curl rpm qemu-kvm golang genisoimage python3 bison gawk

Now with the required packages installed, we need to clone GitHub repositories as below:

git clone https://github.com/microsoft/CBL-Mariner.git
cd CBL-Mariner

With the download complete, we now generate an ISO image from it for installation. First switch to toolkit as below.

cd toolkit

Then generate the ISO file using this command

sudo make iso REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/full.json

Sample Output for the above command:

...........................
Adding RPM to worker chroot: ncurses-devel-6.2-4.cm1.x86_64.rpm.
Adding RPM to worker chroot: ncurses-libs-6.2-4.cm1.x86_64.rpm.
Adding RPM to worker chroot: ncurses-term-6.2-4.cm1.x86_64.rpm.
Adding RPM to worker chroot: readline-7.0-4.cm1.x86_64.rpm.
........................
INFO[0008] Cloning: [alsa-lib:C:''V:'',C2:''V2:'' alsa-utils:C:''V:'',C2:''V2:''
 espeak-ng:C:''V:'',C2:''V2:'' espeakup:C:''V:'',C2:''V2:'' 
kernel-drivers-accessibility:C:''V:'',C2:''V2:'
' kernel-drivers-sound:C:''V:'',C2:''V2:'' pcaudiolib:C:''V:'',C2:''V2:'' pam:C:''V:'',C2:''V2:'
' attr:C:''V:'',C2:''V2:'' awk:C:''V:'',C2:''V2:'' bash:C:''V:'
',C2:''V2:'' bzip2:C:''V:'',C2:''V2:'' calamares:C:'
'V:'',C2:''V2:'' cifs-utils:C:''V:'',C2:''V2:'' coreutils:C:'
'V:'',C2:''V2:'' cpio:C:''V:'',C2:''V2:'' cracklib:C:''V:'',C2:''V2:'' cracklib-dicts:C:''V:'',C2:''V2:'
' cryptsetup:C:''V:'',C2:''V2:'' curl:C:''V:'',C2:
..................
WARN[0005] Total translation table size: 2048           
WARN[0005] Total rockridge attributes bytes: 29996      
WARN[0005] Total directory bytes: 71680                 
WARN[0005] Path table size(bytes): 222                  
WARN[0005] Max brk space used 44000                     
WARN[0005] 347510 extents written (678 MB) 
[email protected]:~/CBL-Mariner/toolkit$ 

This process takes some time, but once it is complete, you will have your ISO file in the directory CBL-mariner/out/images/full/

cd ~/CBL-Mariner/out/images/full

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-15

Step 2: Create a CBL-Mariner Virtual Machine.

With the ISO image, we are now set to do our installation. Let us first create a virtual machine.

1. Create a CBL-Mariner Virtual Machine on Virtualbox.

To create a Virtual Machine in VirtualBox, click on New, then assign the virtual machine a name let’s say “CBL-mariner” as shown.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware

The next step is assigning memory to CBL-Mariner as shown:

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-1

Create a hard disk for CBL-Mariner.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-3

Click Create and proceed to create a hard disk for your CBL-Mariner VM. Here you select the disk type to create.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-37

With the disk type selected, now select how you want data to be stored, either a fixed disk size or dynamic(grows as data on it increases).

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-38

Then finish disk creation by allocating the disk size of the VM, it is recommended to be greater than 12GB.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-6

Now with these steps, you will have your CBL-Mariner VM created. The next step is now loading the created ISO file on it.

To load the ISO file, go to settings of the created CBL-Mariner VM select Storage. Then click at Empty. Here is where you are required to load your ISO file. Click on the disk icon next to IDE Secondary Device then click on Choose a disk file

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-10

You will be required to navigate to the storage location of your ISO file. Select and load the created CBL-Mariner ISO file. (~/CBL-mariner/out/images/full/) as shown.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-16

2. Create a CBL-Mariner Virtual Machine on VMware.

Steps for VM creation are a bit similar to those in VirtualBox but here, the order in which they occur is different. Launch VMware and click on Create a new Virtual Machine as below.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-7

Then select the VM configuration. I prefer Typically because this makes it easy to create a VM.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-8

The next step requires us to select the ISO file for CBL-Mariner VM. Click browse and navigate to the store location of the generated CBL-Mariner ISO.(~/CBL-mariner/out/images/full/)

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-9

With the ISO file loaded, we are required to set the type of Operating system we want to install.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-11

Then proceed and set a name for the Virtual Machine.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-12

The last step is creating a hard disk for the CBL-Mariner VM.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-13

You will have a preview of the settings made and you can make changes by clicking on the Customize hardware button.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-14

When you click finish with the last button checked to “Automatically power on the Virtual Machine..” The machine will begin the installation.

Step 3: Install CBL-Mariner Microsoft Linux distribution on VirtualBox | VMware

Start/Power on your Virtual machine to start the installation of CBL-Mariner Microsoft Linux distribution. The installation starts as shown. Go for the Graphical Installer

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-25

You are required to select the installation type. You have two options here, the core and full installation. Whichever option you choose takes a short time to complete. The core installation takes about 30seconds while the full installation takes about 80seconds.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-18

Agree to the License Terms.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-19

Then provide parameters for disk partitioning, here you can choose between Erase entire disk and manual partitioning.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-20

Then create a username and a strong password as recommended.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-21

Then you will see this popup installation prompt. Click Install now to proceed with the installation if you are comfortable with the settings made earlier.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-22

The installation begins. Sit back and watch the installation.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-35

When the installation is complete, you will see this. My installation took 332 seconds this time is worth waiting.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-36

Step 4: Run CBL-Mariner Microsoft Linux distribution.

When the installation is complete as shown above, click Done. The ISO file will automatically be unmounted and the system reboots. You will then be granted this login window.

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-39

Enter your set credentials and begin enjoying CBL-Mariner Microsoft Linux distribution. Once logged in, you can install the SSH daemon from the tdnf package manager.

sudo tdnf install -y openssh-server

Sample Output:

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-41-1

Now enable the service.

sudo systemctl enable --now sshd.service

With this enabled, you can now access your CBL-Mariner VM. Get the IP_Adddress using:

ip a

CBL-Mariner package and Update system

CBL-Mariner package system is RPM-based, thus both tdnf (tiny dnf) and dnf are available as package managers.

Update the system with this command:

sudo tdnf repolist

Sample output:

How-To-Build-and-Run-CBL-Mariner-Microsoft-Linux-distribution-on-VirtualBox-VMware-43

That is that! Now you have your CBL-MarinerMicrosoft Linux distribution successfully installed on VirtualBox | VMware. You can comfortably use and get to enjoy the amazing features of this new Operating System.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.