diff --git a/morph/grid/local/Vagrantfile b/morph/grid/local/Vagrantfile index 40ec9b2fbe4a49b5cc04b1b271605be5bd27636c..30060cf9e1234a4e192fb8417b05899f28539a62 100644 --- a/morph/grid/local/Vagrantfile +++ b/morph/grid/local/Vagrantfile @@ -4,6 +4,9 @@ # This Vagrantfile worked for Florian Sesser using Vagrant 2.2.16dev and # the VirtualBox Hypervisor. Earlier Vagrant and LibVirt did not work. +# Get the LibVirt pool name or use default +pool_name = ENV.has_key?('POOL_NAME') ? ENV['POOL_NAME'] : 'default' + Vagrant.configure("2") do |config| # For a complete reference, please see the online documentation at # https://docs.vagrantup.com. @@ -14,9 +17,9 @@ Vagrant.configure("2") do |config| # Tune QEmu guests config.vm.provider :libvirt do |libvirt| # Using a specific pool may help to manage the disk space - libvirt.storage_pool_name = "morph_local" - libvirt.snapshot_pool_name = "morph_local" - # No need of graphics + libvirt.storage_pool_name = pool_name + libvirt.snapshot_pool_name = pool_name + # No need of graphics - better use serial libvirt.graphics_type = "none" libvirt.video_type = "none" end @@ -89,9 +92,11 @@ Vagrant.configure("2") do |config| end # To make the VMs assign the static IPs to the network interfaces we need a rebuild: - config.vm.provision "shell", inline: "echo '{nix.trustedUsers = [ \"@wheel\" \"root\" \"vagrant\" ];}' > /etc/nixos/custom-configuration.nix" + config.vm.provision "shell", + inline: "echo '{ nix.trustedUsers = [ \"@wheel\" \"root\" \"vagrant\" ]; boot.kernelParams = [ \"console=tty0\" \"console=ttyS0,115200\" ]; }' > /etc/nixos/custom-configuration.nix" config.vm.provision "shell", inline: "nixos-rebuild switch" config.vm.provision "shell", inline: "systemctl stop firewall.service" + config.vm.provision "shell", inline: "systemctl start serial-getty@ttyS0.service" config.trigger.after :up do |trigger| trigger.info = "Hostname and IP address this host actually uses:"