VOOZH about

URL: https://thenewstack.io/deploying-microsofts-new-linux-distribution-as-a-vm-is-not-easy/

⇱ Deploying Microsoft’s New Linux Distribution as a VM is Not Easy - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-07-26 09:57:10
Deploying Microsoft’s New Linux Distribution as a VM is Not Easy
tutorial,
Linux / Open Source

Deploying Microsoft’s New Linux Distribution as a VM is Not Easy

Microsoft has released its first Linux distribution, CBL-Mariner Linux. Here's how to deploy it as a virtual machine.
Jul 26th, 2021 9:57am by Jack Wallen
👁 Featued image for: Deploying Microsoft’s New Linux Distribution as a VM is Not Easy
Feature Image par David Mark de Pixabay

Hell has frozen over and pigs are flying out of the gaping, lava-filled chasms from beneath the Earth’s crust.

That’s right, Microsoft has its own Linux distribution.

Before you lose your mind, the Redmond juggernaut isn’t replacing Windows with a superior desktop (although never say never and Goonies never die). Instead, what Microsoft has purpose-built a lightweight Linux distribution for Microsoft’s internal cloud infrastructure and edge products and services. With this version of Linux, Microsoft will be able to enhance its ability to stay current in the Linux-centric cloud native landscape.

Given how enterprise businesses absolutely depend on Linux, this was a smart move on the part of Microsoft. I’d go so far as to say this should have happened years ago. But, lo and behold, the time has come and anyone can now deploy Microsoft’s CBL-Mariner Linux. For those who are curious, CBL stands for Common Base Linux, and the source code is licensed under a mixture of open-source licenses, including the GNU General Public License and the MIT license. You can download the source from the CBL-Mariner GitHub page, but what you won’t find is a handy ISO image to use for installing CLB-Mariner.

Yep, Microsoft hasn’t made it easy for those who want to try out this new cloud native, container-tastic, edge-worthy Linux distribution. In fact, getting CBL-Mariner up and running is kind of a convoluted mess at the moment.

That doesn’t mean it’s impossible. It’s just a matter of running a bunch of commands. And that’s exactly what I’m going to show you. But know this: In the end, you’ll wind up with a vhd file you can then use to spin up a virtual machine (VM). So not only do you have to go through the steps of creating the virtual appliance file, you then have to create the VM. But you’re a cloud native developer, so you’re used to jumping through hoops. To do this, you’ll need a Linux distribution from which to work. I’ll demonstrate on Ubuntu Desktop 21.04.

Let’s make this happen.

Installing the Necessary Dependencies

The first thing to be done is several dependencies must be installed, so log into your Linux machine and open a terminal window. Before you can do anything, you must add the backports repository, which is done with the command:

sudo add-apt-repository ppa:longsleep/golang-backports

Press Enter when prompted.

Next, we need to update apt with the command:

sudo apt-get update

Once the apt update has completed, install all of the necessary dependencies with the command:

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

Note: If you’re installing on an older version of Ubuntu (such as 18.04), the above command would be:

sudo apt-get install make tar wget curl rpm qemu-utils golang-1.15-go genisoimage python-minimal bison gawk -y

To get faster compression, you can optionally install pigz with the command:

sudo apt-get install pigz -y

You’ll need to create a link for go, with:

sudo ln -vsf /usr/lib/go-1.15/bin/go /usr/bin/go

The final dependency is Docker. Instead of installing the version available from the standard repository, we’ll go with the latest version with the commands:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

You’ll also need to add your user to the docker group (otherwise you’d have to run the docker command with sudo, which can be a security problem). Add your user with the command:

sudo usermod -aG docker $USER

Log out and log back in, so the changes take effect.

Clone and Build the Necessary Toolkit

Clone the CBL-Mariner toolkit source with the command:

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

Save the current directory into a stack and change into the newly created CBL-Mariner directory with the command:

pushd CBL-Mariner/toolkit

Checkout the stable version with:

git checkout 1.0-stable

Build the toolkit with:

sudo make package-toolkit REBUILD_TOOLS=y

Change back into the stored directory with the command:

popd

Clone CBL-Mariner and Extract the Toolkit

Clone the actual CBL-Mariner source with the help of git:

git clone https://github.com/microsoft/CBL-MarinerDemo.git

Save the current directory and change into the new directory with:

pushd CBL-MarinerDemo

Copy the source:

cp ../CBL-Mariner/out/toolkit-*.tar.gz ./

Unpack the toolkit:

tar -xzvf toolkit-*.tar.gz

Building the VHD

The next step will take some time. What we’re going to do now is build the vhd file that will be used for the virtual machine. First, change into the correct directory with the command:

cd toolkit

Now you can build the vhd file with the command:

sudo make image CONFIG_FILE=../imageconfigs/demo_vhd.json

Either sit back and watch the output fly by or go do something else until the build completes. This can take anywhere from 10 to 30 minutes, depending on your hardware.

Once the build is complete, you’ll find the vhd file in ~/CBL-MarinerDemo/out/images/demo_vhd/. You can fire up your virtual machine tool of choice and create the virtual guest with that file. After you’ve booted CBL-Mariner, you’ll log in with the username root and the password p@ssw0rd.

And that’s it. You’re now ready to kick the tires of Microsoft’s very own version of Linux. Although you might not want to make this your default cloud-native development platform, you can at least get an idea where Microsoft is headed. I will say that CBL-Linux is already very stable and will soon be a worthy candidate for containers, IoT, edge, and cloud development. Is it there yet? Probably not. But given how new this platform is, what Microsoft has already pulled off is pretty impressive.

TRENDING STORIES
Jack Wallen is what happens when a Gen Xer mind-melds with present-day snark. Jack is a seeker of truth and a writer of words with a quantum mechanical pencil and a disjointed beat of sound and soul. Although he resides...
Read more from Jack Wallen
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.