CBL-Mariner Linux 1.0 Released by Microsoft, Here’s How to Install it

16
Microsoft CBL-Mariner Linux 1.0

CBL-Mariner 1.0 is the first stable release of this new Linux distro developed by Microsoft for internal use. Learn how to install it on VirtualBox.

Definately, Microsoft has shown much more love for Linux in recent years. Windows Subsystem for Linux is a clear example of this.

Microsoft’s Linux System Group is the team at Microsoft which created the WSL2. And now the team recently released the first stable version of its own Linux distro called CBL-Mariner. If you were wondering, CBL stands for Common Base Linux. The distro is used by Microsoft engineering teams to build its cloud infrastructure and edge products and services.

CBL-Mariner consumes limited disk and memory resources. The lightweight characteristics of CBL-Mariner also provides faster boot times and a minimal attack surface.

However, let’s make an important clarification: CBM-Mariner is not a general purpose Linux disro. Its purpose is to be used as an internal lightweight Linux distro for Microsoft’s engineering teams into the Azure infrastructure.

How to Install Microsoft CBL-Mariner Linux

Microsoft made CBL-Mariner available on GitHub under an MIT License. While the source code is available, there are no ISO images, but you can build your own. Here’s how to do it by using Ubuntu.

1. Build your own installation ISO image

First, let’s install some prerequisites we’ll need for building the ISO image:

sudo apt install make tar wget curl rpm qemu-utils golang-go genisoimage python2-minimal bison gawk

Next, clone the CBL-Mariner GitHub repo:

git clone https://github.com/microsoft/CBL-Mariner.git
Cloning into 'CBL-Mariner'...
remote: Enumerating objects: 32298, done.
...
Receiving objects: 100% (32298/32298), 506.43 MiB, done.
Resolving deltas: 100% (15482/15482), done.

Finally, enter into CBL-Mariner/toolkit directory and build the installation ISO image. The following builds a bootable ISO image from precompiled RPMs:

cd CBL-Mariner/toolkit
sudo make iso REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/full.json
...
WARN[0001]  99.64% done, estimate finish Mon Jul 12 21:58:14 2021 
WARN[0001] Total translation table size: 2048           
WARN[0001] Total rockridge attributes bytes: 29673      
WARN[0001] Total directory bytes: 71680                 
WARN[0001] Path table size(bytes): 222                  
WARN[0001] Max brk space used 44000                     
WARN[0001] 346267 extents written (676 MB)

Done. You’ll find the ISO file in the ../out/images/full/ directory under a name such as full-1.0.20210712.2155.iso.

2. Install Microsoft CBL-Mariner Linux on VirtualBox

Create a new VirtualBox VM. Configure the hardware with 1 CPU, 1GB of RAM and an 8GB disk. This would be enough for a test. Select a start-up disk, in our case full-1.0.20210712.2155.iso, and begin the installation process following the screens shown below.

2.1 Choose ‘Graphical Installer‘ option.

Installation Welcome Screen

2.2 Select ‘CBL-Mariner Full‘ for installation type.

CBL-Mariner Installation Wizard

2.3 Accept terms and conditions.

Accept Terms and Conditions

2.4 Select ‘Erase disk‘ option. Of course, there is an option to manually partition the disk.

CBL-Mariner Partitioning

2.5 Enter your preferred name, username and password. Note that this user will have root/sudo privilege. When you’re done, just hit the ‘Install‘ button.

CBL-Mariner System Configuration

2.6 Wait for installation to complete…

Installation in progress...

2.7 As you can see on the image below, the installation process is extremely fast.

Microsoft CBL-Mariner Linux Successfully Installed

Congratulations! You have successfully managed to install Microsoft CBL-Mariner Linux on VirtualBox. Now just login with previously created user credentials.

Microsoft CBL-Mariner Linux Started

As you can see, the CBL-Mariner package system is RPM-based. It use tdnf (Tiny DNF) which is a C implementation of the DNF package manager without Python dependencies. Alternatively, you can also use the well-know dnf command for the package management.

16 Comments

  1. First of all, building ISO image is not possible at this moment. Ubuntu version required is 18.04, and fulfilling requirements is not possible due to not secure repos at Ubuntu side. So it seems we need to wait until there will be ISO image available for download.

    • Hi Mirlan,

      Sorry to hear that you had issue creating the ISO file. According to the above requirements, the ISO file builds smoothly under Ubuntu 20.04.

      Its creation has been also successfully tested on CentOS 8, but this is outside the scope of the topic.

  2. For me, I could create the .iso file in ubuntu and then could install in virtualbox using command line as it did not work with GUI installation.

  3. Hello everyone, i want to install light environment like xfce or i3 on cbl mariner if someone is intserested to help just pm me

    thank you in advance

  4. Creating Microsoft CBL-Mariner (Linux) ISO
    ——————————————
    It only worked on Ubuntu 20.04 as the work platform (I got lots of errors with Ubuntu 18.04)

    The only guide that worked for me is: https://www.techrepublic.com/article/microsoft-linux-is-not-what-you-think-or-hoped-it-would-be/ but I made some changes to the procedure (i.e., I built CBL-Mariner instead of CBL-MarinerDemo)
    ———————
    [email protected]:/wip# add-apt-repository ppa:longsleep/golang-backports
    [email protected]:/wip# apt-get update
    [email protected]:/wip# apt -y install -y make tar wget curl rpm qemu-utils golang-1.15-go genisoimage python-minimal bison gawk
    [email protected]:/wip# apt -y install pigz
    [email protected]:/wip# ln -vsf /usr/lib/go-1.15/bin/go /usr/bin/go
    [email protected]:/wip# curl -fsSL https://get.docker.com -o get-docker.sh
    [email protected]:/wip# sh get-docker.sh
    [email protected]:/wip# usermod -aG docker $USER

    [email protected]:/wip# git clone https://github.com/microsoft/CBL-Mariner.git
    [email protected]:/wip# pushd CBL-Mariner/toolkit
    [email protected]:/wip/CBL-Mariner/toolkit# git checkout 1.0-stable
    [email protected]:/wip/CBL-Mariner/toolkit# make package-toolkit REBUILD_TOOLS=y
    [email protected]:/wip/CBL-Mariner/toolkit# cd ..
    [email protected]:/wip/CBL-Mariner# cp out/toolkit-1.0.20210722.0141-x86_64.tar.gz .
    [email protected]:/wip/CBL-Mariner# tar -xzvf toolkit-*.tar.gz
    [email protected]:/wip/CBL-Mariner# cd toolkit/
    [email protected]:/wip/CBL-Mariner/toolkit# make iso REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/full.json

    [email protected]:/wip/CBL-Mariner/toolkit# du -sh /wip/CBL-Mariner/out/images/full/full-1.0.20210722.0200.iso
    678M /wip/CBL-Mariner/out/images/full/full-1.0.20210722.0200.iso
    ———————
    I was able to install the ISO on VirtualBox.

Leave a Reply

Your email address will not be published.

Latest from Tutorials