This project explores using libvirt
based tools to create Virtual Machines (VMs).
Intention is to create VMs from cloud disk image provided by GNU/Linux distributions and for basic initialization use cloud-init
.
Note
The project is developed on Debian 12 if you use another distribution have that in mind if something doesn't work as expected.
🦈
- GNU/Linux OS capable of running QEMU/KVM based VMs.
Check compatibility:
grep -o 'vmx\|svm' /proc/cpuinfo # If nothing comes back check BIOS to make sure virtualization is enabled
Install and setup on Debian/Ubuntu:
sudo apt-get install virt-manager
sudo adduser <USER_NAME> libvirt # Add user to `libvirt` group
sudo adduser <USER_NAME> libvirt-qemu
Download genericcloud
image for Debian version you wish to use in VMs. You can also use cloud image for another distribution if you wish.
Copy ./shark
to your echo $PATH
and set execute permission on it with:
chmod +x shark
To create VM config files, most notably Sharkfile
which defines VM, in empty directory execute:
shark init
./example_vm_configuration_generated_with_init_action
directory contains example of VM configuration generated with shark init
command.
You must edit Sharkfile
before creating VM with command:
shark up