Giter VIP home page Giter VIP logo

vmchamp's Introduction

VmChamp

Simple and fast creation of throwaway VMs on your local machine. Connect via SSH in just a few seconds.

โœจ Features

  • Create throwaway VMs on your local machine and connect via SSH in just a few seconds.
  • Fast and easy to use.
  • Fast boot times because by default uses minimal cloud images.
  • On demand download of latest Debian, Ubuntu, Arch, Fedora, CentOS and Alma cloud images.
  • Shell completion.
  • Customizable cloud-init commands if needed.
  • Uses KVM, QEMU and libvirt.

๐Ÿค” Why?

Sometimes Docker containers are not sufficient for all use cases. For example when you want to load or unload kernel modules, test grub configs or doing low level networking stuff. Also when Systemd is needed to test unit files or install and test applications that require an init system. In this case a VM is often the better choice. Unfortunately it usually takes far too long to create a local VM for quick tests. Download ISO, create VM, run installer, network config, reboot, ssh login. This usually takes at least 5-15 minutes. VmChamp can create local VMs within seconds and then establish a network connection via SSH.

๐Ÿ”ง Prerequisites

Your local linux machine needs to support virtualization and KVM must be installed and working.

A default network interface defined in libvirt must be present. Usually it comes with one by default named "default". If your default interface is not started (wubbl0rz#3) try:

# use sudo if your user is not in the libvirt group
virsh --connect qemu:///system net-start --network default
virsh --connect qemu:///system net-autostart default

๐Ÿš€ Usage

VmChamp run mytestvm
# or VmChamp run mytestvm --os debian11 --mem 256MB --disk 4GB

For shell completion put this in your ~.zshrc:

source <(VmChamp --completion zsh)
Description:

Usage:
  vmchamp [command] [options]

Options:
  --completion <completion>  generate shell completion. (zsh or bash)
  --version                  Show version information
  -?, -h, --help             Show help and usage information

Commands:
  run, start <name>                      start a new VM [default: testvm]
  clean                                  delete all vms and images
  remove, rm <debiantestvm>              removes a vm [default: testvm]
  reboot, reset, restart <debiantestvm>  force restarts a vm [default: testvm]
  ssh <debiantestvm>                     connect to vm via ssh [default: testvm]
  list, ls, ps                           list all existing vms
  images, os                             get a list of all available os images

๐Ÿ—๏ธ Build

Simply use the included bash script as follows:

./build.sh <version> <output dir>

For example:

./build.sh 1.2.3 ~/build/

Output dir defaults to ./build/.

vmchamp's People

Contributors

wubbl0rz avatar seriousm4x avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.