Skip to content

Commit

Permalink
2024-08-07/01: add "Quick bbits: is Crostini a micro VM?"
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Aug 7, 2024
1 parent 9c8460c commit f2a0434
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions 2024-08-07/01-quick-bits-is-crostini-a-microvm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Quick bits: is Crostini a micro VM?

**Disclaimer**: I am not a Virtual Machine specialist, this post is mainly the
conclusion I got after some searching.

Someone asked me in my [previous
post](/2024-08-05/01-my-favorite-device-is-a-chromebook.md) about my Chromebook
if Crostini could be considered a micro VM. This was a interesting question, so
I decided to do another post.

To start, it is really difficult to get a good definition of what a "micro VM"
is. [Firecracker](https://firecracker-microvm.github.io/) defines itself as a
micro VM, and describes itself in its website as:

> Firecracker is a virtual machine monitor (VMM) that uses the Linux
> Kernel-based Virtual Machine (KVM) to create and manage microVMs. Firecracker
> has a minimalist design. It excludes unnecessary devices and guest
> functionality to reduce the memory footprint and attack surface area of each
> microVM. This improves security, decreases the startup time, and increases
> hardware utilization.
Now looking at Crostini, its heart is a VMM called
[crosvm](https://crosvm.dev/). It is described in its
[README](https://chromium.googlesource.com/chromiumos/platform/crosvm/+/HEAD/README.md)
as:

> crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor,
> with a focus on simplicity, security, and speed. crosvm is intended to run
> Linux guests, originally as a security boundary for running native
> applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t
> emulate architectures or real hardware, instead concentrating on
> paravirtualized devices, such as the virtio standard.
Similar descriptions right? Actually Firecracker website says it "started from
Chromium OS's Virtual Machine Monitor, crosvm, an open source VMM written in
Rust". So I would say it is safe to say crosvm itself is a micro VM.

But
[Crostini](https://www.chromium.org/chromium-os/developer-library/guides/containers/containers-and-vms/)
itself is a combination of virtualization AND containerization. Basically
inside the VM it runs a Linux kernel and LXC, that can start arbitrary
containers inside it. From the Crostini documentation this choice seems to be
to keep startup times down, and also to increase security (e.g.: in case of a
security issue inside the container).

This is definitely an interesting choice, since containers allow the overhead
of each distro that you run inside Crostini to be low, and the main VM itself
(called
[Termina](https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/HEAD/project-termina/))
should have low overhead too thanks to crosvm.

By the way, if you want to learn more how "devices" works inside a micro VM
like crosvm, I recommend [this blog
post](https://prilik.com/blog/post/crosvm-paravirt/) talking about
paravirtualized devices in crosvm.

0 comments on commit f2a0434

Please sign in to comment.