A small set of simple scripts to manage virtual environment on Alpine Linux for light users.
- Only uses about 100 to 150MB of memory on host machine
- Almost zero configuration
To use attached script files, you need to have:
- Alpine Linux 3.12 or higher version
To use attached script files, you need to download and unpack it first.
Warning
Scripts are not the everything.
wget -qO- https://api.github.com/repos/Seia-Soto/libvirtd-scripts/tarball | tar xvz -C ~/
mkdir -p ~/scripts
mv ~/Seia-Soto-libvirtd-scripts-*/scripts/* ~/scripts
rm -r ~/Seia-Soto-libvirtd-scripts-*
This script makes your system almost ready to deploy virtual machines. While making system to run virtual machine, this script will create following folders:
~/scripts
, directory for this scritps set.~/virtuals
~/virtuals/images
, directory for CD image.~/virtuals/machines
, directory for VM disks.
# Uncomment community repository before start;
cat > /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
EOF
sh ~/scripts/virt.install.sh
For post-installation message, refer following file: virt.install.postinstall.md
This script creates new Alpine Linux virtual machine on your system.
This will create an Alpine Linux virtual machine with the image downloaded when setting up new host with virt.install.sh
.
The version is same with host machine.
sh ~/scripts/virt.create.sh [NAME] [CPU_CORES] [RAM_SIZE] [DISK_SIZE]
NAME
: (required) The name of the virtual machine.CPU_CORES
: (required) The number of cores to virtualize.RAM_SIZE
: (required) The max size of RAM to allocate in MB (dynamically allocated, max).DISK_SIZE
: (required) The max size of qcow2 disk to allocate in GB (dynamically allocated, max).
- This scripts will create virtual machine which attach
br0
as default network interface.
This script deletes virtual machine and its dependencies like boot disk things.
sh ~/scripts/virt.delete.sh [NAME]
NAME
: (required) The name of the virtual machine.
This script attaches external qcow2 disk to specific machine.
sh ~/scripts/virt.add_volume.sh [NAME] [SIZE] [PATH]
NAME
: (required) The name of the virtual machine.SIZE
: (required) The number of cores to virtualize.PATH
: (required) The path to attach volume, such asvdb
,vdc
, andvdd
.
This script runs a command osinfo-query os
.