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
npx -y skills add black-desk/bdev --skill vngAssembled 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
vnginstalled and available in$PATH(check withwhich 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:
- Rebuild:
vng -v --build(addKBUILD_BUILD_TIMESTAMP='' CC="ccache gcc" HOSTCC="ccache gcc"if ccache is available) - Re-test:
vng -e "test command" - 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
| Problem | Solution |
|---|---|
| Build fails with missing config | Run vng --kconfig (fresh) or virtme-configkernel --update (existing config) |
| Module not found at runtime | Do not use -S flag; rebuild with full modules |
| Command fails in VM | Ensure all dependencies are combined in single vng -e call |
| Timeout during build | Build 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