PitchHut
Log in / Sign up
virtme-ng
9 views
Test new kernels safely with a virtual twist on your live system.
Pitch

Introducing virtme-ng, the innovative tool for quickly recompiling and testing Linux kernels. Within minutes, build a kernel that runs in a virtual environment, mirroring your live system. This allows for complete experimentation without any risk to your host. Dive into kernel development with safety and ease, making the testing process swift and reliable.

Description

Virtme-ng is a powerful tool designed to streamline the process of building and testing Linux kernels directly from their source code. This innovative solution allows developers to recompile the kernel in mere minutes instead of hours, ensuring a rapid and efficient testing cycle.

Overview

Virtme-ng creates a virtualized environment as an exact copy of your live system using a copy-on-write snapshot. This unique feature ensures that any modifications or experiments conducted within this environment do not impact the host system. After a minimal configuration is generated—including basic support for testing the kernel within QEMU—the selected kernel is automatically built and launched in the virtualized setup. Developers can safely manipulate the filesystem and crash the kernel without any repercussions on the host system.

Key Features:

  • Rapid Kernel Compilation: Reduce build time while maintaining functionality to perform tests and experiments on custom kernels.
  • Safe Virtual Environment: The copy-on-write snapshot allows developers to experiment with changes without risking the integrity of the host system.
  • Minimal Configuration: Automatically generates a streamlined .config file for efficient kernel testing.

Quick Start Usage

To get started with Virtme-ng, simply follow these commands:

$ uname -r   # Check current kernel version
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  # Clone the Linux kernel source
$ cd linux
$ vng --build --commit v6.2-rc4  # Build the kernel
$ vng  # Launch the virtualized session

Upon executing the above commands, you will have a terminal shell running a virtualized kernel instance. Just type exit to return to your host system.

Examples of Usage

  • To build a kernel from a clean local source directory (auto-generating config if necessary):
$ vng -b
  • To run a previously compiled kernel:
$ vng
  • To test an installed kernel version:
$ vng -r 6.2.0-21-generic
  • To build and test a kernel with additional features like Rust support:
$ vng --build RUSTC=rustc-1.62 BINDGEN=bindgen-0.56 RUSTFMT=rustfmt-1.62

Conclusion

By integrating virtme-ng into your development workflow, you can enhance your kernel testing acuity while minimizing the risks associated with system-level changes. Whether you're an advanced kernel developer or just starting, virtme-ng provides an accessible pathway to efficient kernel testing and development.

For more detailed instructions, visit the official repository and explore the entire scope of functionalities it offers.