Virt-Lightning is a lightweight virtual machine management tool created to help developers and system administrators to quickly and consistently deploy VMs for testing or development purposes. It is focused on simplicity, speed and ease of use.
Mastering KVM Virtualization - The Ultimate eBook
From home labs to production clouds - master KVM Host management, automating KVM administration using Terraform, Vagrant, and cloud automation. This eBook will enable you to build scalable virtual infrastructure that works whether you're learning at home or deploying enterprise solutions. Get your full copy today
Virt-lightning provides a user-friendly CLI for creating, managing, and destroying VMs.
Key Features of Virt-Lightning
- Integration with libvirt:
- Builds on libvirt for VM management, ensuring compatibility with standard virtualization tools.
- Instant VM Deployment:
- It leverages cloud-init in configuring VMs during launch, thus ensuring minimal setup time.
- It caches VM images for instant provisioning.
- Predefined OS images:
- Downloads and caches standard operating system images for reuse.
- Provides a default image repository or allows users to specify custom images.
- Cloud-Init Support:
- Automates initial VM setup, such as user creation, network configuration, and package installation using YAML-based configuration files.
- Lightweight and Developer-Friendly:
- Focuses on being a developer tool rather than a full-scale virtualization platform.
Installation of virt-lightning
The system requirements required for running virt-lightning are:
- Python version 3.8 or higher
- The Python3 binding for libvirt (
python3-libvirt
)Â or ‘libvirt-python’ according to pip. - Access to libvirt daemon
Installation of virt-lightning
The system requirements required for running virt-lightning are:
- Python version 3.8 or higher
- The Python3 binding for libvirt (
python3-libvirt
)Â or ‘libvirt-python’ according to pip. - Access to libvirt daemon
Installation on RHEL-based systems
Here’s how to install install virt-lightning
- RHEL 9:
sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf install genisoimage libvirt-devel gcc python3-devel python3-pip
sudo pip3 install virt-lightning
- Rocky 9 / AlmaLinux 9
sudo dnf -y install epel-release
sudo dnf config-manager --set-enabled crb
sudo dnf install genisoimage libvirt-devel gcc python3-devel python3-pip
sudo pip3 install virt-lightning
- Rocky 8 / AlmaLinux 8
sudo dnf -y install epel-release
sudo dnf config-manager --set-enabled powertools
sudo dnf install genisoimage libvirt-devel gcc python3-devel python3-pip
sudo pip3 install virt-lightning
- Debian / Ubuntu
sudo apt update
sudo apt install genisoimage python3-venv pkg-config gcc libvirt-dev python3-dev pipx
pipx ensurepath
pipx install virt-lightning
After the installation is done, add ~/.local/bin/
in your $PATH
if it’s not already the case.
echo "export PATH=$PATH:~/.local/bin/" >> ~/.bashrc
source ~/.bashrc
If using zsh
then run:
echo "export PATH=$PATH:~/.local/bin/" >> ~/.zshrc
source ~/.zshrc
To prevent permission issues, ensure that the user you are logged in as is a member of the libvirt
group.
sudo usermod -aG libvirt $USER
newgrp libvirt
The installation was successful if you can get help page displayed.
virt-lightning --help
# OR vl - short for virt-lightning
vl --help
You can also run vl
without a command to see list of accepted commands.
vl