FreeBSD virtual environment management and repository

2020-10 upd: we reached the first fundraising goal and rented a server in Hetzner for development! Thank you for donating !

Attention! Current pages describe CBSD version 13.0.x. If you are using an older version, please update first.

Attention! I apologize for the automatic translation of this text. You can improve it by sending me a more correct version of the text or fix html pages via GITHUB repository.

CBSD QEMU quick start

CBSD and QEMU

PlatformQEMU supportedNVMM supported
DragonflyBSDYY
FreeBSDYN
NetBSDYY

CBSD version 13.0.18 added support for QEMU and NVMM accelerator. Similar to the commands for jail, bhyve and XEN, you can create and manage QEMU-based virtual machines through similar commands and dialog forms, while the commands are prefixed with 'q': qstart, qdestroy ..

Currently NVMM acceleration is only available on the DragonFlyBSD/NetBSD platform. However, if you are using CBSD and QEMU on FreeBSD, you can take advantage of the lightweight image of the alternate architectures as a full virtual machine if the QEMU-usermode jail is not for you. So, on a FreeBSD amd64 host, you can easily get up and running with an OS for ARMv8/aarch64 or RISCv64.

When using NVMM, make sure the module is loaded:

	kldload nvmm
	

Don't forget to add nvmm into auto-load via /boot/loader.conf:

	nvmm_load="YES"
	

You can check the status of NVMM through the command:

	nvmmctl identify
	

If the module is missing or does not work correctly, you can create VMs, but they will work without acceleration.

Also, acceleration will not be available if you are running non-native architectures.

You need to install QEMU package named 'qemu' (or 'qemu-devel' in some cases):

	pkg install qemu
	

Detailed description of working with NVMM/QEMU on the: DragonflyBSD project page, NetBSD project guide

When working with emulation of non-native architectures, you may need firmware and bios to boot systems:

For example:

  • u-boot-qemu-arm64 - Cross-build das u-boot for model qemu-arm64
  • u-boot-qemu-riscv64 - Cross-build das u-boot for model qemu-riscv64
  • opensbi - RISC-V SBI bootloader and firmware

TODO/Limitation

At the moment, qemu is started from the 'root' user;

On the DragonFlyBSD platform, support for HammerFS2 in CBSD is under development: automatic work with PFS / snapshot / COW using HammerFS is currently not possible;

On FreeBSD platform, QEMU does not support the QXL/Spice protocol;

Creating a QEMU VM

You can work with QEMU-based virtual machines through the usual CBSD methods: TUI interface, CLI interface, or CBSDfile.

	cbsd qconstruct-tui --help
	cbsd qcreate --help
	cbsd qstart --help
	cbsd qdestroy --help
	

Demo of working with QEMU via CBSD

Demo of NVMM/QEMU via CBSD on DragonflyBSD 6.1-dev, Demo of running ARMv8 / AARCH64 and RISCv64 virtual machines on FreeBSD amd64 / x86_64: