MCPcopy Index your code
hub / github.com/cubic-vm/cubic

github.com/cubic-vm/cubic @v0.24.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.24.0 ↗ · + Follow
706 symbols 1,371 edges 127 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cubic :star: Please star us on GitHub to promote the project!

github.com crates.io snapcraft.io

Cubic spins up Linux virtual machines on Linux, macOS and Windows with a single command.

Every distribution comes as a prebuilt cloud image and is ready to use within seconds, so you skip the long installation. Cubic keeps things simple and secure by acting as lightweight glue over proven tools. No privileged system service is required and every VM runs as your normal user, so you never need admin or root rights. Cubic is built on top of QEMU, EDK2, official cloud images and cloud-init.

Get it from the Snap Store

:monocle_face: Why use Cubic?

One command takes you from nothing to a shell inside a fresh Linux VM. The images are official and verified, downloaded straight from each distribution. Every machine is a real VM, so you get stronger isolation than containers can offer. The same workflow runs on Linux, macOS and Windows across amd64 and arm64. No privileged system service is required and you never need admin or root rights.

Cubic fits a lot of everyday workflows:

  • Spin up disposable VMs that are ready in seconds and easy to throw away
  • Compare many Linux distributions side by side on any host
  • Develop and test across distributions and CPU architectures
  • Try or build software without polluting your host
  • Run untrusted or experimental software inside an isolated VM
  • Reproduce CI or production Linux environments locally
  • Run local services such as HTTP servers and databases with port forwarding

:fire: Features

  • Simple command-line interface
  • Supports the following guest OS:
  • Alma Linux
  • Arch Linux
  • Debian
  • Fedora
  • Gentoo
  • OpenSUSE
  • Rocky Linux
  • Ubuntu
  • Supports the following host OS: Linux, macOS, Windows
  • Supports amd64 and arm64 CPU architectures
  • Supports hardware acceleration with KVM (Linux), Hypervisor (macOS), and Hyper-V (Windows)
  • Daemonless design which does not require root privileges
  • Written in Rust

:rocket: Quick Start

A virtual machine instance can be created with a single command. This example creates an instance from a Ubuntu image with the name quickstart.

$ cubic run quickstart --image ubuntu:noble
Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 6.8.0-101-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

cubic@quickstart:~$

Use cubic images to list all supported images.

:dizzy: How to install Cubic?

Ubuntu (Snap)

sudo snap install cubic && \
sudo snap connect cubic:kvm

macOS (Homebrew)

brew install cubic-vm/cubic/cubic

Others (Cargo)

Install the Rust toolchain and then build Cubic:

cargo install cubic

Cubic needs QEMU and its UEFI firmware on the host. Install them with your package manager:

# Debian/Ubuntu
sudo apt install qemu-system qemu-utils ovmf qemu-efi-aarch64
# Fedora/RHEL
sudo dnf install qemu-system-x86 qemu-img edk2-ovmf edk2-aarch64
# Arch Linux
sudo pacman -S qemu-full edk2-ovmf edk2-armvirt
# openSUSE
sudo zypper install qemu qemu-tools qemu-ovmf-x86_64 qemu-uefi-aarch64
# macOS
brew install qemu
# Windows
winget install SoftwareFreedomConservancy.QEMU

See the install instructions for more information.

:bulb: How to use Cubic?

Cubic has a simple CLI:

$ cubic --help
Cubic runs Linux virtual machines on Linux, macOS and Windows with a single
command. Every distribution comes as a prebuilt cloud image and is ready to use
within seconds, so you skip the long installation. Cubic keeps things simple and
secure by acting as lightweight glue over proven tools. No privileged system
service is required and every VM runs as your normal user, so you never need
admin or root rights. Cubic is built on top of QEMU, EDK2, official cloud images
and cloud-init.

Examples:

  Create a new VM instance with:
  $ cubic create example --image ubuntu:noble
  Open a shell in the VM instance:
  $ cubic ssh example

  Alternatively, use `run` to execute the above commands in a single command:
  $ cubic run example --image ubuntu:noble

  Show all supported VM images:
  $ cubic images

  List previously created VM instances:
  $ cubic instances

  Show information about a VM instance:
  $ cubic show <instance>

  Execute a command in a VM instance:
  $ cubic exec <instance> <shell command>

  Transfer files and directories between host and VM instance:
  $ cubic scp <path/to/host/file> <instance>:<path/to/guest/file>
  See `cubic scp --help` for more examples

For more information, visit: https://cubic-vm.org/
The source code is located at: https://github.com/cubic-vm/cubic


Usage: cubic [OPTIONS] <COMMAND>

Commands:
  run          Create and start VM instances
  create       Create VM instances
  instances    List VM instances
  images       List VM images
  ports        List ports for VM instances
  show         Show VM images and instances
  modify       Modify VM instances
  console      Open VM instance console
  ssh          Connect to VM instances
  scp          Copy data between host and VM instances
  exec         Execute commands on VM instances
  start        Start VM instances
  stop         Stop VM instances
  restart      Restart VM instances
  rename       Rename VM instances
  clone        Clone VM instances
  delete       Delete VM instances
  prune        Clear caches
  completions  Generate shell completion scripts

Options:
  -v, --verbose  Increase logging output
  -q, --quiet    Reduce logging output
  -h, --help     Print help
  -V, --version  Print version

:hammer: How to Build Cubic from Source?

See CONTRIBUTING.md for instructions on setting up a development environment and building the project.

:speech_balloon: How to contribute to Cubic?

We are actively looking for help to improve Cubic. You can help in various ways:

  • :girl: Increase Cubic's user base by installing and using it!
  • :star: Star us on Github to promote the project!
  • :beetle: If you found a bug or you are interested in a feature, please create an issue on Github!
  • :construction_worker: If you are a developer and you want to submit a change, please have a look at the contribution page!
  • :pencil: If you are a technical writer and you want to improve the documentation, please have a look at the contribution page!

:page_with_curl: License

Cubic is dual-licensed under Apache and MIT.

Extension points exported contracts — how you extend this code

Command (Interface)
(no doc) [21 implementers]
src/commands.rs
ImageProvider (Interface)
(no doc) [8 implementers]
src/image/image_provider.rs
Console (Interface)
(no doc) [2 implementers]
src/view/console.rs
InstanceDeserializer (Interface)
(no doc) [2 implementers]
src/instance/instance_deserializer.rs
ReadWrite (Interface)
(no doc) [1 implementers]
src/qemu/qmp.rs
ImageStore (Interface)
(no doc) [2 implementers]
src/image/image_store.rs
InstanceStore (Interface)
(no doc) [2 implementers]
src/instance/instance_store.rs

Core symbols most depended-on inside this repo

add
called by 65
src/view/map_view.rs
arg
called by 56
src/util/system_command.rs
as_str
called by 26
src/models/instance_name.rs
exists
called by 21
src/ssh_cmd/sftp_path.rs
to_str
called by 19
src/ssh_cmd/sftp_path.rs
get_instance_store
called by 17
src/commands/context.rs
info
called by 17
src/view/stdio.rs
load
called by 15
src/models/instance_cert_paths.rs

Shape

Method 413
Function 168
Class 108
Enum 10
Interface 7

Languages

Rust100%

Modules by API surface

src/models/port_forward.rs38 symbols
src/iso9660/binary_writer.rs29 symbols
src/ssh_cmd/russh.rs23 symbols
src/models/data_size.rs23 symbols
src/qemu/qemu_system.rs20 symbols
src/models/environment.rs20 symbols
src/util/system_command.rs17 symbols
src/qemu/qemu_firmware_descriptor.rs17 symbols
src/ssh_cmd/sftp_path.rs15 symbols
src/instance/instance_dao.rs15 symbols
src/qemu/qemu_firmware.rs14 symbols
src/instance/instance_store_mock.rs13 symbols

For agents

$ claude mcp add cubic \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page