#!/usr/bin/env bash #fail fast and loud set -euo pipefail # -- setting up system vm_name="gnu-nix-mother-eleriel" virtual_storage_unit="result/nixos.qcow2" random_access_memory_allocated="4096" central_process_units="4" media_access_control_address="E8:B4:70:C0:00:A1" log="/home/control/vhdd/gnu-nix-mother-eleriel.log" # -- execution exec qemu-system-x86_64 \ -name "${vm_name}" \ -enable-kvm \ -cpu host \ -smp "${central_process_units}" \ -m "${random_access_memory_allocated}" \ -daemonize \ -display none \ -serial file:"${log}" \ -netdev tap,id=lemu-bridge,ifname=lemu-tap,script=no,downscript=no \ -device virtio-net-pci,netdev=lemu-bridge,mac="${media_access_control_address}" \ -drive file="${virtual_storage_unit}",format=qcow2,if=virtio,cache=writeback