out-of-tree kernel {module, exploit} development tool
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
dump_stack() 81234fc3a6
Update bootstrap scripts to Ubuntu 20.04
il y a 4 mois
README.md Refactor [2] il y a 1 an
qemu-kernel.go Fix spelling il y a 1 an
qemu-kernel_test.go Add timeout after start qemu for tests il y a 9 mois
test.config.go Update bootstrap scripts to Ubuntu 20.04 il y a 4 mois



Qemu wrapper for kernel-related CI tasks. Supports GNU/Linux and macOS.


  • Uses upstream virtualization -- KVM in GNU/Linux and Hypervisor.framework in macOS.
  • Run files and kernel modules directly from local filesystem. No need to copy byself!
  • Run commands inside qemu virtual machine at the same way as you run in it locally.


$ go get code.dumpstack.io/tools/out-of-tree/qemu

Generate root image

First of all we need to generate rootfs for run qemu.

Install qemu and docker

$ sudo apt install -y qemu docker

Note: qemu on macOS since v2.12 (24 April 2018) supports Hypervisor.framework.

$ brew install qemu
$ brew cask install docker

Generate image

$ cd $GOPATH/src/code.dumpstack.io/tools/out-of-tree/tools/qemu-debian-img
$ ./bootstrap.sh

Fill configuration file

$ $EDITOR $GOPATH/src/code.dumpstack.io/tools/out-of-tree/qemu/test.config.go

Run tests

$ go test -v


$ go get code.dumpstack.io/tools/out-of-tree/qemu

Minimal example:

kernel := qemu.Kernel{
    Name:       "Some kernel name",
    KernelPath: "/path/to/vmlinuz",
    InitrdPath: "/path/to/initrd", // if required
q, err := qemu.NewSystem(qemu.X86_64, kernel, "/path/to/qcow2")
if err != nil {

if err = q.Start(); err != nil {
defer q.Stop()

output, err = q.Command("root", "echo Hello, World!")
if err != nil {

// output == "Hello, World!\n"

More information and list of all functions see at go documentation project, or just run locally:

$ godoc code.dumpstack.io/tools/out-of-tree/qemu