Skip to main content

No project description provided

Project description

EZQM

Making QEMU Environment easier to be setup & run.

Disk image generation and configuration for EZQM

Using Syzkaller's create-image.sh to create a disk image and corresponding SSH key.

wget https://raw.githubusercontent.com/google/syzkaller/master/tools/create-image.sh
chmod +x create-image.sh
./create-image.sh

After creation, use following command to configure the disk image and SSH key used by EZQM.

These configuration will affect all EZQM local projects (we'll talk about local projects later!)

ezcf -g -u diskimage <path/to/your/image>
ezcf -g -u sshkey  <path/to/your/rsakey>

Creating a local project

To create a local project, execute following command:

mkdir myproj && cd myproj 
ezcf --init-local <folder/to/your/compiled/linux/source/folder> 

After executing, you will find a ezqmlocal.json file under your folder with content like:

{
    "src": "/xxxx/linux-upstream",
    "vmlinux": "/xxxx/linux-upstream/vmlinux",
    "bzImage": "/xxxx/linux-upstream/arch/x86/boot/bzImage",
    "gdbport": 11451,
    "qemuport": 19198,
    "sshport": 8964,
    "outputfile": "/tmp/bQZv746sBv",
    "kernelparam": "nokaslr console=ttyS0 root=/dev/sda rw kasan_multi_shot=1 printk.synchronous=1",
    "additionalcmd": []
}

Then, when you switch to that directory and execute EZQM related command, the corresponding ezqmlocal.json will be used as the local configuration file and can be configured by following command:

ezcf -l -u key val

Start QEMU with ezqm

After setting up, simply use the following command to launch the QEMU

ezqm

Using memory snapshot to skip QEMU booting (optionl)!

Taking a snapshot after QEMU booting and restore the memory snapshot everytime we start QEMU to make things faster! We don't have to wait for QEMU boot anymore! First we need a folder to store QEMU memorysnapshot. Ideally, creating a ramfs to reduce reading time by the following command:

mount ramfs -t ramfs <path/to/your/folder>

Then we use ezcf to configure this folder globally.

ezcf -g -u snapshotfolder <path/to/your/folder>

Create snapshot and set booting parameter with the following command (Currently, only works for diskimage created by Syzkaller's create-image.sh)

ezqm -b

Debug the kernel with the GDB wrapper ezgdb

ezgdb is the tool for this!

  1. Launch GDB with vmlinux:

    ezgdb
    

    Equivalent to:

    gdb <vmlinux>
    
  2. Connect to a Remote Target:

    ezgdb conn
    

    Equivalent to:

    gdb <vmlinux> -ex "target remote :<gdbport>"
    
  3. Custom GDB Commands:

    ezgdb --ex "break KASAN"
    

    Equivalent to:

    gdb <vmlinux> --ex "break main"
    

File transfering with ezcp

The ezcp tool allows you to transfer files or folders between the host machine and a virtual machine (VM). You can also transfer files in reverse, from the VM to the host.

Transfer from Host to VM

To copy a file or folder from the host machine to the VM, use the following command:

ezcp <source> <destination>
  • <source>: Path to the file or folder on the host.
  • <destination>: Path where the file or folder should be placed on the VM.

Example

ezcp /path/to/file.txt /path/on/vm

Transfer from VM to Host

To copy a file or folder from the VM to the host machine, use the --reverse or -r option:

ezcp --reverse <source> <destination>
  • <source>: Path to the file or folder on the VM.
  • <destination>: Path where the file or folder should be placed on the host.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezqm-1.0.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezqm-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file ezqm-1.0.0.tar.gz.

File metadata

  • Download URL: ezqm-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for ezqm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 016037432935be62a2b11048e0c7794a49e1f4367817c5877f9dd9819d55e9c0
MD5 6b05cdfd654ef11470acbe7ca1624307
BLAKE2b-256 a98fed630559d930118f1c7662dcce641cfa2cecbda7ebf50b1b1f5904d2d258

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezqm-1.0.0.tar.gz:

Publisher: pypi-release.yml on TomAPU/ezqm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ezqm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ezqm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for ezqm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc6d3e2b966427ea202c3d5f9164e05aae47100db2a4d45cc8234ed9d0695668
MD5 23f11d5f9fc6f9684f7d779067336e1f
BLAKE2b-256 fd74d201f63825f06fdb470b7ab8d7a891bdec45f35df6354f4d6bc1dbdf37c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezqm-1.0.0-py3-none-any.whl:

Publisher: pypi-release.yml on TomAPU/ezqm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page