agentsclimarketplace

Vng

Skill black-desk/bdev/skills/vng

This skill should be used when the user asks to "build kernel", "compile kernel", "test kernel change", "verify kernel functionality", "run kselftest", "boot kernel in QEMU", "vng build", "vng test", "test kernel module", "run kernel in VM", "verify kernel patch", or discusses building, testing, or verifying Linux kernel changes using virtme-ng (vng). Covers both CLI and MCP server integration for AI-agent-driven kernel build-test cycles.From its SKILL.md

Install
npx -y skills add black-desk/bdev --skill vng

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.2 KB, as published. Nobody here has run it

Kernel Build and Test with virtme-ng (vng)

Guide for building Linux kernels and running tests in QEMU using virtme-ng (vng). This enables self-contained kernel build-test cycles without separate VM setup.

Overview

virtme-ng (vng) builds and runs kernels inside a virtualized snapshot of the live system. It provides both a CLI and an MCP server interface for AI agent integration.

Critical behavior: Each vng -e / run_kernel_cmd invocation spawns a new independent VM. State does NOT persist between invocations. Commands requiring shared state must be combined with && or ; in a single invocation.

Prerequisites

  • vng installed and available in $PATH (check with which vng)
  • Working kernel source tree with .config
  • Sufficient disk space for build artifacts

Workflow

Phase 1: Kernel Configuration

Ensure the kernel source tree has a valid .config with relevant options enabled.

Scenario A — No existing .config (fresh tree): Generate a minimal bootable config:

vng --kconfig

Scenario B — Existing .config that needs virtme compatibility: Update the current config to add all options required by virtme, without overwriting existing settings:

virtme-configkernel --update

This is the recommended approach when the source tree already has a .config (e.g. from make defconfig, distribution configs, or a previous build). It only appends the virtme-required options on top of the existing configuration.

Scenario C — Existing .config that needs specific options enabled:

# Ensure virtme compatibility first
virtme-configkernel --update
# Then enable project-specific options
./scripts/config --enable CONFIG_FOO
make olddefconfig

For details on config management, consult references/vng-usage.md.

Phase 2: Build Kernel

Build the kernel in the current source tree:

vng -v --build

Tip — Always use ccache when available: If ccache is installed, use it for every build to maximize cache hit rates. Pass CC, HOSTCC, and clear KBUILD_BUILD_TIMESTAMP to ensure deterministic preprocessor output:

vng -v --build KBUILD_BUILD_TIMESTAMP='' CC="ccache gcc" HOSTCC="ccache gcc"

Setting KBUILD_BUILD_TIMESTAMP='' prevents timestamps from embedding into the build, which significantly improves ccache hit rates across rebuilds.

Key build options:

  • --build — build kernel and modules
  • -S — skip module installation for faster builds (suitable when only testing core kernel changes)
  • -v — verbose output
  • -j N — override number of build jobs (defaults to nproc)

Typical build times: 10-60+ minutes depending on config and hardware.

Important: Do not use MCP run_kernel_cmd for builds. Use the CLI directly or the build_kernel MCP tool.

Phase 3: Run Tests

After a successful build, run test commands in a QEMU VM using the just-compiled kernel.

Run a Single Command

vng -e "uname -r"

Run Multiple Dependent Commands (State in Single VM)

Since each vng -e invocation is a fresh VM, combine dependent commands:

vng -e "modprobe mymodule && dmesg | tail -20"

Run Kselftest

vng -e "cd /path/to/kselftest && ./test_suite"

Or use the dedicated kselftest flag:

vng --kselftest TEST_NAME

Run with a Specific Kernel

If testing a previously built kernel:

vng -r /path/to/vmlinuz -e "command"

Phase 4: Iterative Development

After modifying source code:

  1. Rebuild: vng -v --build (add KBUILD_BUILD_TIMESTAMP='' CC="ccache gcc" HOSTCC="ccache gcc" if ccache is available)
  2. Re-test: vng -e "test command"
  3. Repeat until tests pass

For common patterns (verifying module loads, checking kernel features at runtime, running multi-step scripts), consult references/vng-usage.md.

MCP Server Integration

When the virtme-ng MCP server is configured, tools such as build_kernel, run_kernel_cmd, run_kselftest_cmd, and get_kernel_info are available. For detailed MCP tool parameters and configuration, consult references/vng-usage.md.

Troubleshooting

ProblemSolution
Build fails with missing configRun vng --kconfig (fresh) or virtme-configkernel --update (existing config)
Module not found at runtimeDo not use -S flag; rebuild with full modules
Command fails in VMEnsure all dependencies are combined in single vng -e call
Timeout during buildBuild times of 10-60 min are normal; increase timeout

Additional Resources

Reference Files

For detailed usage patterns and advanced configuration, consult:

  • references/vng-usage.md — Complete vng CLI and MCP server usage reference

Keep looking

Skills are one crate of 607,721. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.