Files
server/usr/share/doc/qemu-system-common/system/i386/microvm.html
2026-01-07 20:52:11 +01:00

297 lines
18 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>microvm virtual platform (microvm) &mdash; QEMU Debian 1:8.2.2+ds-0ubuntu1.11 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=86f27845" />
<link rel="stylesheet" type="text/css" href="../../_static/theme_overrides.css?v=08e6c168" />
<link rel="shortcut icon" href="../../_static/qemu_32x32.png"/>
<script src="../../_static/jquery.js?v=8dae8fb0"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=802af9f6"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/custom.js?v=2ab9f71d"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="i440fx PC (pc-i440fx, pc)" href="pc.html" />
<link rel="prev" title="x86 System emulator" href="../target-i386.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: #802400" >
<a href="../../index.html" class="icon icon-home">
QEMU
<img src="../../_static/qemu_128x128.png" class="logo" alt="Logo"/>
</a>
<div class="version">
8.2.2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../about/index.html">About QEMU</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">System Emulation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="../invocation.html">Invocation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../device-emulation.html">Device Emulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keys.html">Keys in the graphical frontends</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mux-chardev.html">Keys in the character backend multiplexer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../monitor.html">QEMU Monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="../images.html">Disk Images</a></li>
<li class="toctree-l2"><a class="reference internal" href="../virtio-net-failover.html">QEMU virtio-net standby (net_failover)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../linuxboot.html">Direct Linux Boot</a></li>
<li class="toctree-l2"><a class="reference internal" href="../generic-loader.html">Generic Loader</a></li>
<li class="toctree-l2"><a class="reference internal" href="../guest-loader.html">Guest Loader</a></li>
<li class="toctree-l2"><a class="reference internal" href="../barrier.html">QEMU Barrier Client</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vnc-security.html">VNC security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tls.html">TLS setup for network services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../secrets.html">Providing secret data to QEMU</a></li>
<li class="toctree-l2"><a class="reference internal" href="../authz.html">Client authorization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../gdb.html">GDB usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../replay.html">Record/replay</a></li>
<li class="toctree-l2"><a class="reference internal" href="../managed-startup.html">Managed start up options</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bootindex.html">Managing device boot order with bootindex properties</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cpu-hotplug.html">Virtual CPU hotplug</a></li>
<li class="toctree-l2"><a class="reference internal" href="../pr-manager.html">Persistent reservation managers</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../targets.html">QEMU System Emulator Targets</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../target-arm.html">Arm System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-avr.html">AVR System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-m68k.html">ColdFire System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-mips.html">MIPS System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-ppc.html">PowerPC System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-openrisc.html">OpenRISC System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-riscv.html">RISC-V System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-rx.html">RX System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-s390x.html">s390x System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-sparc.html">Sparc32 System emulator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target-sparc64.html">Sparc64 System emulator</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../target-i386.html">x86 System emulator</a><ul class="current">
<li class="toctree-l4 current"><a class="reference internal" href="../target-i386.html#board-specific-documentation">Board-specific documentation</a></li>
<li class="toctree-l4"><a class="reference internal" href="../target-i386.html#architectural-features">Architectural features</a></li>
<li class="toctree-l4"><a class="reference internal" href="../target-i386.html#os-requirements">OS requirements</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../target-xtensa.html">Xtensa System emulator</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multi-process.html">Multi-process QEMU</a></li>
<li class="toctree-l2"><a class="reference internal" href="../confidential-guest-support.html">Confidential Guest Support</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vm-templating.html">QEMU VM templating</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User Mode Emulation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../interop/index.html">System Emulation Management and Interoperability</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../specs/index.html">System Emulation Guest Hardware Specifications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devel/index.html">Developer Information</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #802400" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">QEMU</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../index.html">System Emulation</a></li>
<li class="breadcrumb-item"><a href="../targets.html">QEMU System Emulator Targets</a></li>
<li class="breadcrumb-item"><a href="../target-i386.html">x86 System emulator</a></li>
<li class="breadcrumb-item active">microvm virtual platform (<code class="docutils literal notranslate"><span class="pre">microvm</span></code>)</li>
<li class="wy-breadcrumbs-aside">
<a href="https://gitlab.com/qemu-project/qemu/blob/master/docs/system/i386/microvm.rst" class="fa fa-gitlab"> Edit on GitLab</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="microvm-virtual-platform-microvm">
<h1>microvm virtual platform (<code class="docutils literal notranslate"><span class="pre">microvm</span></code>)<a class="headerlink" href="#microvm-virtual-platform-microvm" title="Link to this heading"></a></h1>
<p><code class="docutils literal notranslate"><span class="pre">microvm</span></code> is a machine type inspired by <code class="docutils literal notranslate"><span class="pre">Firecracker</span></code> and
constructed after its machine model.</p>
<p>Its a minimalist machine type without <code class="docutils literal notranslate"><span class="pre">PCI</span></code> nor <code class="docutils literal notranslate"><span class="pre">ACPI</span></code> support,
designed for short-lived guests. microvm also establishes a baseline
for benchmarking and optimizing both QEMU and guest operating systems,
since it is optimized for both boot time and footprint.</p>
<section id="supported-devices">
<h2>Supported devices<a class="headerlink" href="#supported-devices" title="Link to this heading"></a></h2>
<p>The microvm machine type supports the following devices:</p>
<ul class="simple">
<li><p>ISA bus</p></li>
<li><p>i8259 PIC (optional)</p></li>
<li><p>i8254 PIT (optional)</p></li>
<li><p>MC146818 RTC (optional)</p></li>
<li><p>One ISA serial port (optional)</p></li>
<li><p>LAPIC</p></li>
<li><p>IOAPIC (with kernel-irqchip=split by default)</p></li>
<li><p>kvmclock (if using KVM)</p></li>
<li><p>fw_cfg</p></li>
<li><p>Up to eight virtio-mmio devices (configured by the user)</p></li>
</ul>
</section>
<section id="limitations">
<h2>Limitations<a class="headerlink" href="#limitations" title="Link to this heading"></a></h2>
<p>Currently, microvm does <em>not</em> support the following features:</p>
<ul class="simple">
<li><p>PCI-only devices.</p></li>
<li><p>Hotplug of any kind.</p></li>
<li><p>Live migration across QEMU versions.</p></li>
</ul>
</section>
<section id="using-the-microvm-machine-type">
<h2>Using the microvm machine type<a class="headerlink" href="#using-the-microvm-machine-type" title="Link to this heading"></a></h2>
<section id="machine-specific-options">
<h3>Machine-specific options<a class="headerlink" href="#machine-specific-options" title="Link to this heading"></a></h3>
<p>It supports the following machine-specific options:</p>
<ul class="simple">
<li><p>microvm.x-option-roms=bool (Set off to disable loading option ROMs)</p></li>
<li><p>microvm.pit=OnOffAuto (Enable i8254 PIT)</p></li>
<li><p>microvm.isa-serial=bool (Set off to disable the instantiation an ISA serial port)</p></li>
<li><p>microvm.pic=OnOffAuto (Enable i8259 PIC)</p></li>
<li><p>microvm.rtc=OnOffAuto (Enable MC146818 RTC)</p></li>
<li><p>microvm.auto-kernel-cmdline=bool (Set off to disable adding virtio-mmio devices to the kernel cmdline)</p></li>
</ul>
</section>
<section id="boot-options">
<h3>Boot options<a class="headerlink" href="#boot-options" title="Link to this heading"></a></h3>
<p>By default, microvm uses <code class="docutils literal notranslate"><span class="pre">qboot</span></code> as its BIOS, to obtain better boot
times, but its also compatible with <code class="docutils literal notranslate"><span class="pre">SeaBIOS</span></code>.</p>
<p>As no current FW is able to boot from a block device using
<code class="docutils literal notranslate"><span class="pre">virtio-mmio</span></code> as its transport, a microvm-based VM needs to be run
using a host-side kernel and, optionally, an initrd image.</p>
</section>
<section id="running-a-microvm-based-vm">
<h3>Running a microvm-based VM<a class="headerlink" href="#running-a-microvm-based-vm" title="Link to this heading"></a></h3>
<p>By default, microvm aims for maximum compatibility, enabling both
legacy and non-legacy devices. In this example, a VM is created
without passing any additional machine-specific option, using the
legacy <code class="docutils literal notranslate"><span class="pre">ISA</span> <span class="pre">serial</span></code> device as console:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ qemu-system-x86_64 -M microvm \
-enable-kvm -cpu host -m 512m -smp 2 \
-kernel vmlinux -append &quot;earlyprintk=ttyS0 console=ttyS0 root=/dev/vda&quot; \
-nodefaults -no-user-config -nographic \
-serial stdio \
-drive id=test,file=test.img,format=raw,if=none \
-device virtio-blk-device,drive=test \
-netdev tap,id=tap0,script=no,downscript=no \
-device virtio-net-device,netdev=tap0
</pre></div>
</div>
<p>While the example above works, you might be interested in reducing the
footprint further by disabling some legacy devices. If youre using
<code class="docutils literal notranslate"><span class="pre">KVM</span></code>, you can disable the <code class="docutils literal notranslate"><span class="pre">RTC</span></code>, making the Guest rely on
<code class="docutils literal notranslate"><span class="pre">kvmclock</span></code> exclusively. Additionally, if your hosts CPUs have the
<code class="docutils literal notranslate"><span class="pre">TSC_DEADLINE</span></code> feature, you can also disable both the i8259 PIC and
the i8254 PIT (make sure youre also emulating a CPU with such feature
in the guest).</p>
<p>This is an example of a VM with all optional legacy features
disabled:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ qemu-system-x86_64 \
-M microvm,x-option-roms=off,pit=off,pic=off,isa-serial=off,rtc=off \
-enable-kvm -cpu host -m 512m -smp 2 \
-kernel vmlinux -append &quot;console=hvc0 root=/dev/vda&quot; \
-nodefaults -no-user-config -nographic \
-chardev stdio,id=virtiocon0 \
-device virtio-serial-device \
-device virtconsole,chardev=virtiocon0 \
-drive id=test,file=test.img,format=raw,if=none \
-device virtio-blk-device,drive=test \
-netdev tap,id=tap0,script=no,downscript=no \
-device virtio-net-device,netdev=tap0
</pre></div>
</div>
</section>
<section id="triggering-a-guest-initiated-shut-down">
<h3>Triggering a guest-initiated shut down<a class="headerlink" href="#triggering-a-guest-initiated-shut-down" title="Link to this heading"></a></h3>
<p>As the microvm machine type includes just a small set of system
devices, some x86 mechanisms for rebooting or shutting down the
system, like sending a key sequence to the keyboard or writing to an
ACPI register, doesnt have any effect in the VM.</p>
<p>The recommended way to trigger a guest-initiated shut down is by
generating a <code class="docutils literal notranslate"><span class="pre">triple-fault</span></code>, which will cause the VM to initiate a
reboot. Additionally, if the <code class="docutils literal notranslate"><span class="pre">-no-reboot</span></code> argument is present in the
command line, QEMU will detect this event and terminate its own
execution gracefully.</p>
<p>Linux does support this mechanism, but by default will only be used
after other options have been tried and failed, causing the reboot to
be delayed by a small number of seconds. Its possible to instruct it
to try the triple-fault mechanism first, by adding <code class="docutils literal notranslate"><span class="pre">reboot=t</span></code> to the
kernels command line.</p>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../target-i386.html" class="btn btn-neutral float-left" title="x86 System emulator" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="pc.html" class="btn btn-neutral float-right" title="i440fx PC (pc-i440fx, pc)" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2025, The QEMU Project Developers.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
<!-- Empty para to force a blank line after "Built with Sphinx ..." -->
<p></p>
<p>This documentation is for QEMU version 8.2.2.</p>
<p><a href="../../about/license.html">QEMU and this manual are released under the
GNU General Public License, version 2.</a></p>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>