This document explains the dependencies for hyper2kvm and how to install them.
hyper2kvm has two types of dependencies:
These MUST be installed via your system package manager before installing Python dependencies.
Note: hyper2kvm uses the VMCraft engine (pure Python) for VM manipulation. Native VMCraft engine - no C dependencies.
| Package | Purpose |
|---|---|
qemu-utils |
QEMU disk image utilities (qemu-img) |
qemu-system-x86 |
QEMU virtualization for testing |
libvirt-daemon-system |
LibVirt virtualization management |
libvirt-clients |
LibVirt client tools (virsh) |
sudo dnf install -y \
python3 \
python3-pip \
qemu-img \
qemu-kvm \
qemu-system-x86 \
libvirt \
libvirt-client \
libvirt-daemon-kvm
sudo apt-get update
sudo apt-get install -y \
python3 \
python3-pip \
python3-venv \
qemu-utils \
qemu-system-x86 \
libvirt-daemon-system \
libvirt-clients
sudo zypper install -y \
python3 \
python3-pip \
python3-virtualenv \
qemu-tools \
qemu-x86 \
libvirt-daemon-qemu \
libvirt-client
| Package | Purpose |
|---|---|
openssh-client |
SSH for remote operations |
rsync |
File synchronization |
After installing system dependencies, install Python packages via pip.
Install from requirements.txt:
pip install -r requirements.txt
Contents of requirements.txt:
rich>=13.0.0 - Beautiful terminal outputclick>=8.0.0 - CLI frameworkPyYAML>=6.0 - YAML configuration parsingrequests>=2.31.0 - HTTP clientpyvmomi>=8.0.0 - VMware vSphere APIFor testing and development:
pip install -r requirements-dev.txt
Includes:
pytest - Testing frameworkpytest-cov - Code coverageruff - Fast Python lintermypy - Static type checkerbandit - Security scannerCRITICAL: Install in this exact order:
# 1. Install system dependencies first
sudo apt-get install -y qemu-utils libvirt-clients
# 2. Create virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate
# 3. Install Python dependencies
pip install -r requirements.txt
# 4. Install hyper2kvm
pip install -e .
Cause: QEMU tools not installed.
Solution: Install via system package manager:
# Ubuntu/Debian
sudo apt-get install qemu-utils
# Fedora/RHEL
sudo dnf install qemu-img
Or skip virtualenv for system-wide installation:
# Install directly (not recommended for development)
pip install --user -r requirements.txt
pip install --user -e .
After installation, verify everything works:
# 1. Check system tools
qemu-img --version
virsh --version
# 2. Check hyper2kvm
python -m hyper2kvm --help
# 3. Run tests (if dev dependencies installed)
python -m pytest tests/unit/ -v
If you only need core functionality without testing:
# System packages
sudo apt-get install qemu-utils
# Python packages (minimal)
pip install rich click PyYAML requests
# Install hyper2kvm
pip install -e .
For containerized environments:
FROM ubuntu:22.04
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
qemu-utils \
qemu-system-x86 \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip3 install -r requirements.txt
# Install hyper2kvm
COPY . /app
WORKDIR /app
RUN pip3 install -e .
For GitHub Actions, Travis CI, etc:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
qemu-utils \
qemu-system-x86
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Update all packages
pip install --upgrade -r requirements.txt
# Update specific package
pip install --upgrade pyvmomi
# Ubuntu/Debian
sudo apt-get update
sudo apt-get upgrade qemu-utils
# Fedora/RHEL
sudo dnf upgrade qemu-img