KVMX: vagrant-like QEMU KVM Wrapper =================================== KVMX is a lightweight implementation of a virtual machine manager inspired by [vagrant](https://www.vagrantup.com/), [kvm-manager](https://git.fluxo.info/kvm-manager/about/) and [bocker](https://github.com/p8952/bocker). It may be used for development or as a wrapper for desktop GUI isolation. This is simple stuff. Don't use it if you need any complex behavior or integration. In the other hand, if you're looking for a small application that doesn't depend on software installed from unstrusted sources, you'll feel welcome here :) ## Dependencies KVMX currently needs a Debian-based system and the following dependencies: sudo apt install git qemu qemu-kvm virt-viewer spice-client spice-client-gtk If you plan to create guest images, you may also want the following packages: sudo apt install debootstrap grub-pc parted vmdebootstrap mbr libguestfs-tools If you want Xpra and Xephyr support: sudo apt install xpra xserver-xephyr ## Instalation Simply clone it and add to your `$PATH`: git clone https://git.fluxo.info/kvmx You can also verify the latest commit's OpenPGP signature: /usr/bin/git -C kvmx verify-commit HEAD Note that `/usr/bin/git` is called to avoid any other `git` wrappers or aliases you might have available on your shell. ## Basic usage kvmx init [project-name] [project-folder] # initialize kvmx edit [project-name] # optional customization kvmx up [project-name] # bring it up! If no project name is specified, the current folder name is assumed as the project name. If no folder is specified, the current folder is assumed as the project home. ## Using with existing guests Instead of a simple `kvmx up`, you might want to use and existing virtual machine. Simply point the `image` parameter at your project's `kvmxfile` to where you image resides. ## Manually creating a guest Alternativelly, you might create a new one by hand. To do so, proceed as usual with `kvmx init` and `kvmx edit` acording to the Basic Usage stated above. Then, before, doing `kvmx up`, do something like the following example: # Create the environment kvmx init /var/cache/qemu/ qemu-img create -f qcow2 /var/cache/qemu/box.img 10G # Install the Operating System kvm -m 2048 -net nic,model=virtio -net user -drive file=/var/cache/qemu//box.img -cdrom ~/path/to/install.iso If you want OpenSSH functionality, make sure to create an user and set a password related to the configuration present at the project's `kvmxfile`. Also, make sure to to create an OpenSSH keypair for this virtual machine and put the public key into the guest user's home folder. Passwordless sudo might also be desired for the full development functionality. Test your new system with kvm -m 2048 -net nic,model=virtio -net user -drive file=box.img Then, if everything is fine, stop the guest and turn it on again, this time with kvmx up ## Further development * Fix isolinux support: * http://www.syslinux.org/wiki/index.php?title=Development/Testing * http://linux-kernel-driver.blogspot.com.br/2009/06/linux-kernel-development-using.html * https://bbs.archlinux.org/viewtopic.php?id=177299 * Alternative folder sharing support (NFS, SMB or even [via SSH](https://superuser.com/questions/831659/mount-a-local-directory-to-a-remote-ssh-server)). * Remount 9p shared folders and reinitialize spice-vdagent upon resume from disk [see possible bug](https://bugzilla.redhat.com/show_bug.cgi?id=1333072). * [Nested virtualization](http://www.rdoxenham.com/?p=275) ([1](https://wiki.archlinux.org/index.php/KVM#Nested_virtualization), [2](https://ladipro.wordpress.com/2017/02/24/running-hyperv-in-kvm-guest/)). * Integration with [image-bootstrap](https://github.com/hartwork/image-bootstrap). * Systemd service. * Shell completions. * Docs (tutorial and manpage). * Makefile and debian package. * Fit into `kvm-manager` use case. ## References See [Virtualized GUI environments](https://blog.fluxo.info/suckless/virtual) for details.