Skip to content

Quicksand

Launch, control, and snapshot QEMU virtual machines through an async Python API. No root, no Docker, no cloud.

$ pip install quick-sandbox

Example: Ubuntu Hello, World

Install quicksand with QEMU and an Ubuntu VM image. Everything you need in one line.

bash
pip install 'quicksand[qemu,ubuntu]'

Launch a sandbox, install a package, and use it. All inside an isolated VM that boots in ~2 seconds.

python
import asyncio
from quicksand import Sandbox, Mount, NetworkMode

async def main():
    # Each sandbox is a real Ubuntu VM with its own kernel
    async with Sandbox(
        image="ubuntu",
        network_mode=NetworkMode.FULL,  # Enable internet for apt
        mounts=[Mount(".", "/mnt/workspace")],  # Share your project into the VM
    ) as sb:
        # Full apt ecosystem — install anything you'd install on a real machine
        await sb.execute("apt-get update && apt-get install -y figlet")
        # Your files are right there inside the VM
        await sb.execute("ls /mnt/workspace")
        # Run it just like you would in a terminal
        result = await sb.execute("figlet Quicksand")
        print(result.stdout)
    # VM is gone — nothing left on the host

asyncio.run(main())
 ____            _        _
|  _ \ ___  _ __| |_ __ _| |__   _____  __
| |_) / _ \| '__| __/ _` | '_ \ / _ \ \/ /
|  __/ (_) | |  | || (_| | |_) | (_) >  <
|_|   \___/|_|   \__\__,_|_.__/ \___/_/\_\

That's it. No Docker, no root, no cloud account. Just a normal user process with hypervisor-level isolation.