diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b048b0..616242e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,9 +83,9 @@ jobs: uses: actions/cache/restore@v3 id: cache-restore with: - path: ~/.config/packer/plugins + path: ${{ runner.os == 'Linux' && '~/.config/packer/plugins' || '/usr/local/bin/github.com' }} key: ${{ runner.os }}-${{ hashFiles('sources/build.pkr.hcl') }} - + - name: Install Packer plugins shell: bash run: packer init sources @@ -94,7 +94,7 @@ jobs: uses: actions/cache/save@v3 if: always() with: - path: ~/.config/packer/plugins + path: ${{ runner.os == 'Linux' && '~/.config/packer/plugins' || '/usr/local/bin/github.com' }} key: ${{ steps.cache-restore.outputs.cache-primary-key }} - name: Build diff --git a/.gitignore b/.gitignore index 8ad5ffb..6d175b2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ distros/centos-stream/**/*.hcl __pycache__ *.pyc *.pyo +packer_cache +.venv +venv \ No newline at end of file diff --git a/README.md b/README.md index e877863..5eb8a85 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,24 @@ # Building on Windows +It's probably a good idea to have Windows Terminal installed, if you +don't already. While it's not strictly necessary, it does provide a +much better interface than the standard command prompt interface. + 1. Be sure that Hyper-V is installed and enabled on your system -1. Download and install packer.exe to your system, and add the folder it is in to your user's PATH environment variable -1. Download the [Windows ADK](https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install) being sure to select - at the least "Deployment Tools" from the feature set. - 1. To see more details, including a walkthrough, check [this web page](https://www.makeuseof.com/windows-iso-folder-command-prompt/) - 1. Be sure to add the install path for the Oscdimg tool to your Windows PATH. - 1. On my system, that path is "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg" -1. Open PowerShell (on my system I had to run as administrator), and ensure that you have access to python - 1. If you type "python" at the prompt and do not have it installed, it should prompt you to install from the Store - 1. Do not install the version downloaded from the Internet unless you know what you're doing + * Get ahead of the curve and create an external switch called `packer-amd64` that connects directly to the external network +1. Install [Chocolatey](https://chocolatey.org/install) + * Use Chocolatey to install packer `choco install packer` + * Use Chooolatey to install the Windows Assessment and Development Kit's CD tooling `choco install windows-adk-oscdimg` +1. Install Python + * From a PowerShell prompt type `python`. If it is not already installed on your system, then your Windows Store will prompt you to install it. This might require you to be in an Administrator terminal 1. Create a venv `python -m venv .venv` 1. Activate it `.\.venv\scripts\Activate.ps1` -1. Install the packages in requirements-windows.txt +1. Install xonsh and PyYAML `pip install xonsh PyYAML` 1. Try a build - 1. You can execute directly with the `packer` executable, if you want - 1. If you want to wrap up standard options, or build multiple versions/distros at once, use the `build.xsh` file - 1. `xonsh build.xsh -d -b hyperv-iso.amd64 -v` - 1. You can substitute out any of the options with `-a` to build "all" targets that match + * You can execute directly with the `packer` executable, if you want + * If you want to wrap up standard options, or build multiple versions/distros at once, use the `build.xsh` file + * `xonsh build.xsh -d -b hyperv-iso.amd64 -v` + * You can substitute out any of the options with `-a` to build "all" targets that match ### Troubleshooting @@ -26,7 +27,7 @@ need to download Shell files from the Packer http server (NixOS, Archlinux, and HTTP server on the host. To rectify this: 1. From the Windows Start/Search type "Firewall" -1. Click "Allow and App Through The Firewall" +1. Click "Allow an App Through The Firewall" 1. Click "Change Settings" 1. Scroll all the way down to where you find the entries for the packer-hyperv plugin 1. Ensure that all such plugin versions have the box on the left and BOTH boxes on the right checked @@ -40,8 +41,8 @@ to reach it. 1. Open Hyper-V Manager 1. In the right hand side, click "Virtual Switch Manager..." -1. Select the `packer-x86_64` switch +1. Select the `packer-amd64` switch 1. Set connection type to 'External' 1. In your DHCP server, assign a static IP address to MAC address "00:00:de:ad:be:ef" - 1. Personally, I use dnsmasq and my subnet is 10.42.2.1/16 for DHCP, so the appropriate config line is `dhcp-host=00:00:de:ad:be:ef,10.42.2.254` - 1. The actual IP address you assign is unimportant, and if you need to spoof a different Mac address, edit the file `sources/hyperv-iso.pkr.hcl` + 1. Personally, I use dnsmasq and my subnet is 10.42.2.1/16 for DHCP, so the appropriate config line is `dhcp-host=00:00:de:ad:be:ef,10.42.2.254` + 1. The actual IP address you assign is unimportant, and if you need to spoof a different Mac address, edit the file `sources/hyperv-iso.pkr.hcl` diff --git a/Vagrantfile.in b/Vagrantfile.in index 5b0d697..ad40a1f 100644 --- a/Vagrantfile.in +++ b/Vagrantfile.in @@ -30,6 +30,11 @@ Vagrant.configure("2") do |config| # # Customize the amount of memory on the VM: # vb.memory = "1024" # end + + config.vm.provider "hyperv" do |hv| + config.vm.network "private_network", bridge: "packer-amd64" + end + # # View the documentation for the provider you are using for more # information on available options. diff --git a/distros/centos-stream/8/amd64.pkrvars.hcl.sh b/distros/centos-stream/8/amd64.pkrvars.hcl.sh index 8340723..a604aaa 100755 --- a/distros/centos-stream/8/amd64.pkrvars.hcl.sh +++ b/distros/centos-stream/8/amd64.pkrvars.hcl.sh @@ -6,7 +6,7 @@ set -ex name="${0%.sh}" checksums="$(mktemp)" -until curl -f -L -o "${checksums}" "http://mirror.centos.org/centos/8-stream/isos/x86_64/CHECKSUM"; do +until curl -f -L "https://mirrors.edge.kernel.org/centos/8-stream/isos/x86_64/CHECKSUM" > "${checksums}"; do sleep 1 done sha="$(grep -e latest-boot "${checksums}" | grep SHA256 | cut -d' ' -f 4)" @@ -15,7 +15,7 @@ cat << HERPDERP > "${name}" distro = "centos-stream" version = "8" iso = { - url = "http://mirror.centos.org/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-latest-boot.iso" + url = "https://mirrors.edge.kernel.org/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-latest-boot.iso" checksum = "${sha}" } boot_command = [ diff --git a/distros/centos-stream/8/disc/ks.cfg b/distros/centos-stream/8/disc/ks.cfg index 1771a9b..fa97a68 100644 --- a/distros/centos-stream/8/disc/ks.cfg +++ b/distros/centos-stream/8/disc/ks.cfg @@ -61,7 +61,9 @@ open-vm-tools %addon com_redhat_kdump --disable %end -%post +%post --erroronfail +dnf update -y + # configure swap to a file fallocate -l 2G /swapfile chmod 600 /swapfile @@ -138,6 +140,13 @@ restorecon -f - < "${checksums}"; do sleep 1 done sha="$(awk '/SHA256/ {print $4}' "${checksums}")" @@ -26,4 +26,4 @@ boot_command = [ "" ] cd_files = [ "distros/centos-stream/9/disc/*" ] -HERPDERP +HERPDERP \ No newline at end of file diff --git a/distros/centos-stream/9/disc/ks.cfg b/distros/centos-stream/9/disc/ks.cfg index bd63f1e..b1dd882 100644 --- a/distros/centos-stream/9/disc/ks.cfg +++ b/distros/centos-stream/9/disc/ks.cfg @@ -70,7 +70,9 @@ open-vm-tools %addon com_redhat_kdump --disable %end -%post +%post --erroronfail +dnf update -y + # configure swap to a file fallocate -l 2G /swapfile chmod 600 /swapfile @@ -150,6 +152,13 @@ restorecon -f - <", - " inst.ks=cdrom:/ks.cfg console=tty0", + " inst.ks=cdrom:/ks.cfg console=tty0", "" ] cd_files = ["distros/centos/7/disc/*"] diff --git a/distros/centos/7/disc/ks.cfg b/distros/centos/7/disc/ks.cfg index e7c7e1a..783093c 100644 --- a/distros/centos/7/disc/ks.cfg +++ b/distros/centos/7/disc/ks.cfg @@ -34,6 +34,15 @@ libselinux-python -rdma %end +%pre +# In Hyper-V this needs a re-do for some reason +virt="$(systemd-detect-virt)" +if [ "${virt}" == "microsoft" ]; then + nmcli c down eth0 + nmcli c up eth0 +fi +%end + %post --erroronfail yum -y update diff --git a/distros/centos/supports.yml b/distros/centos/supports.yml index 86d239b..5c1deca 100644 --- a/distros/centos/supports.yml +++ b/distros/centos/supports.yml @@ -5,5 +5,4 @@ provider: virtualbox-iso - arch: amd64 provider: vmware-iso - - arch: amd64 - provider: hyperv-iso + # Hyper-V, I have been thus far unable to have it bring up its network automatically diff --git a/distros/debian/10/finalize.sh b/distros/debian/10/finalize.sh index 7f53e39..207b063 100644 --- a/distros/debian/10/finalize.sh +++ b/distros/debian/10/finalize.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash set -ex -apt update apt autoremove -y -apt upgrade -y # Configure sshd to be faster sed -i -E -e 's,^.*(UseDNS).*$,\1 No,' /etc/ssh/sshd_config @@ -11,3 +9,11 @@ echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/sshd_config # Clean up after ourselves apt-get clean + +virt="$(systemd-detect-virt)" +if [ "${virt}" == "microsoft" ]; then + yum install -y hyperv-daemons + systemctl enable hpervfcopyd + systemctl enable hypervkvpd + systemctl enable hypervvssd +fi \ No newline at end of file diff --git a/distros/debian/10/http/preseed.cfg b/distros/debian/10/http/preseed.cfg index 8878035..2c62675 100644 --- a/distros/debian/10/http/preseed.cfg +++ b/distros/debian/10/http/preseed.cfg @@ -41,7 +41,7 @@ d-i apt-setup/non-free boolean true d-i apt-setup/contrib boolean true tasksel tasksel/first multiselect -d-i pkgsel/include string curl openssh-server sudo python3 +d-i pkgsel/include string curl openssh-server sudo python3 hyperv-daemons d-i grub-installer/bootdev string default @@ -55,4 +55,6 @@ d-i preseed/early_command string d-i preseed/late_command string \ echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \ echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \ - chmod 440 /target/etc/sudoers.d/vagrant + chmod 440 /target/etc/sudoers.d/vagrant; \ + in-target apt-get update; \ + in-target apt-get upgrade -y \ No newline at end of file diff --git a/distros/debian/11/amd64.pkrvars.hcl b/distros/debian/11/amd64.pkrvars.hcl index 0fbb210..15ab70f 100644 --- a/distros/debian/11/amd64.pkrvars.hcl +++ b/distros/debian/11/amd64.pkrvars.hcl @@ -7,10 +7,10 @@ iso = { boot_command = [ "", "auto ", - "DEBIAN_FRONTEND=text ", - "preseed/url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ", - "console=tty0 ", - "--- net.ifnames=0 biosdevnames=0 ", + "DEBIAN_FRONTEND=text ", + "preseed/url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ", + "console=tty0 ", + "--- net.ifnames=0 biosdevnames=0 ", "" ] http_directory = "distros/debian/11/http/" diff --git a/distros/debian/11/finalize.sh b/distros/debian/11/finalize.sh index cec7f5e..8e33511 100644 --- a/distros/debian/11/finalize.sh +++ b/distros/debian/11/finalize.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash set -ex -apt update apt autoremove -y -apt upgrade -y # Configure sshd to be faster cat << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf @@ -13,3 +11,11 @@ EOF # Clean up after ourselves apt-get clean + +virt="$(systemd-detect-virt)" +if [ "${virt}" == "microsoft" ]; then + yum install -y hyperv-daemons + systemctl enable hpervfcopyd + systemctl enable hypervkvpd + systemctl enable hypervvssd +fi \ No newline at end of file diff --git a/distros/debian/11/http/preseed.cfg b/distros/debian/11/http/preseed.cfg index 8a20817..f4c4133 100644 --- a/distros/debian/11/http/preseed.cfg +++ b/distros/debian/11/http/preseed.cfg @@ -55,8 +55,10 @@ d-i preseed/early_command string d-i preseed/late_command string \ echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \ echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \ - chmod 440 /target/etc/sudoers.d/vagrant; \ - sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces + chmod 440 /target/etc/sudoers.d/vagrant; \ + sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces; \ + in-target apt-get update; \ + in-target apt-get upgrade -y #echo '[Match]' >> /target/etc/systemd/network/dhcp.network; \ #echo 'Name=en*' >> /target/etc/systemd/network/dhcp.network; \ diff --git a/distros/debian/12/amd64.pkrvars.hcl b/distros/debian/12/amd64.pkrvars.hcl index b733ca0..2a795a0 100644 --- a/distros/debian/12/amd64.pkrvars.hcl +++ b/distros/debian/12/amd64.pkrvars.hcl @@ -7,10 +7,10 @@ iso = { boot_command = [ "", "auto ", - "DEBIAN_FRONTEND=text ", - "preseed/url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ", - "console=tty0 ", - "--- net.ifnames=0 biosdevnames=0 ", + "DEBIAN_FRONTEND=text ", + "preseed/url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ", + "console=tty0 ", + "--- net.ifnames=0 biosdevnames=0 ", "" ] http_directory = "distros/debian/12/http/" diff --git a/distros/debian/12/finalize.sh b/distros/debian/12/finalize.sh index cec7f5e..8e33511 100644 --- a/distros/debian/12/finalize.sh +++ b/distros/debian/12/finalize.sh @@ -1,9 +1,7 @@ #!/usr/bin/env bash set -ex -apt update apt autoremove -y -apt upgrade -y # Configure sshd to be faster cat << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf @@ -13,3 +11,11 @@ EOF # Clean up after ourselves apt-get clean + +virt="$(systemd-detect-virt)" +if [ "${virt}" == "microsoft" ]; then + yum install -y hyperv-daemons + systemctl enable hpervfcopyd + systemctl enable hypervkvpd + systemctl enable hypervvssd +fi \ No newline at end of file diff --git a/distros/debian/12/http/preseed.cfg b/distros/debian/12/http/preseed.cfg index 7e5ea02..80f39dc 100644 --- a/distros/debian/12/http/preseed.cfg +++ b/distros/debian/12/http/preseed.cfg @@ -56,4 +56,6 @@ d-i preseed/early_command string d-i preseed/late_command string \ echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \ echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \ - chmod 440 /target/etc/sudoers.d/vagrant + chmod 440 /target/etc/sudoers.d/vagrant; \ + in-target apt-get update; \ + in-target apt-get upgarde -y \ No newline at end of file diff --git a/distros/fedora/39/amd64.pkrvars.hcl b/distros/fedora/39/amd64.pkrvars.hcl index fdd6404..660d7b3 100644 --- a/distros/fedora/39/amd64.pkrvars.hcl +++ b/distros/fedora/39/amd64.pkrvars.hcl @@ -6,7 +6,7 @@ iso = { } boot_command = [ "e ", - "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/x86_64.ks console=tty0" + "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/x86_64.ks console=tty0" ] cd_files = [ "distros/fedora/39/*.ks" diff --git a/distros/fedora/rawhide/amd64.pkrvars.hcl.sh b/distros/fedora/rawhide/amd64.pkrvars.hcl.sh index 7dbf317..5ae75ee 100755 --- a/distros/fedora/rawhide/amd64.pkrvars.hcl.sh +++ b/distros/fedora/rawhide/amd64.pkrvars.hcl.sh @@ -35,7 +35,7 @@ iso = { } boot_command = [ "e", - "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/x86_64.ks console=tty0 console=ttyS0" + "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/x86_64.ks console=tty0 console=ttyS0" ] cd_files = [ "distros/fedora/rawhide/*.ks" diff --git a/distros/fedora/supports.yml b/distros/fedora/supports.yml index edf71ad..529dc94 100644 --- a/distros/fedora/supports.yml +++ b/distros/fedora/supports.yml @@ -5,8 +5,12 @@ provider: virtualbox-iso - arch: amd64 provider: vmware-iso + - arch: amd64 + provider: hyperv-iso 38: *supp 39: *supp rawhide: - arch: amd64 provider: qemu + - arch: amd64 + provider: hyperv-iso diff --git a/distros/nixos/23.05/amd64.pkrvars.hcl.sh b/distros/nixos/23.05/amd64.pkrvars.hcl.sh index d8d8c91..7015a4d 100755 --- a/distros/nixos/23.05/amd64.pkrvars.hcl.sh +++ b/distros/nixos/23.05/amd64.pkrvars.hcl.sh @@ -31,9 +31,9 @@ iso = { boot_command = [ " net.ifnames=0 biosdevnames=0", "", # Wait for system to come up? - "curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh", + "curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh", "", - "sudo bash /tmp/install.sh {{ .HTTPPort }} {{ .HTTPIP }}" + "sudo bash /tmp/install.sh {{ .HTTPPort }} {{ .HTTPIP }}" ] http_directory = "distros/nixos/23.05/http/" boot_wait = "5s" diff --git a/distros/nixos/23.11/amd64.pkrvars.hcl.sh b/distros/nixos/23.11/amd64.pkrvars.hcl.sh index 3fb7b84..a824cd6 100755 --- a/distros/nixos/23.11/amd64.pkrvars.hcl.sh +++ b/distros/nixos/23.11/amd64.pkrvars.hcl.sh @@ -30,10 +30,10 @@ iso = { } boot_command = [ " net.ifnames=0 biosdevnames=0", - "", # Wait for system to come up? - "curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh", + "", # Wait for system to come up? + "curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh", "", - "sudo bash /tmp/install.sh {{ .HTTPPort }} {{ .HTTPIP }}" + "sudo bash /tmp/install.sh {{ .HTTPPort }} {{ .HTTPIP }}" ] http_directory = "distros/nixos/23.05/http/" boot_wait = "5s" diff --git a/distros/nixos/supports.yml b/distros/nixos/supports.yml index 8d31ec2..059cb52 100644 --- a/distros/nixos/supports.yml +++ b/distros/nixos/supports.yml @@ -5,4 +5,6 @@ provider: virtualbox-iso - arch: amd64 provider: vmware-iso + - arch: amd64 + provider: hyperv-iso 23.11: *supp diff --git a/distros/ubuntu/23.10/amd64.pkrvars.hcl b/distros/ubuntu/23.10/amd64.pkrvars.hcl index d664468..75ca28f 100644 --- a/distros/ubuntu/23.10/amd64.pkrvars.hcl +++ b/distros/ubuntu/23.10/amd64.pkrvars.hcl @@ -7,10 +7,10 @@ iso = { boot_command = [ "e", "console=tty0 ", - "fsck.mode=skip ", - "locale=en_US ", + "fsck.mode=skip ", + "locale=en_US ", "auto=true ", - "priority=critical ", + "priority=critical ", "autoinstall", "", ] diff --git a/distros/ubuntu/supports.yml b/distros/ubuntu/supports.yml index 94c3d5b..b4be4ea 100644 --- a/distros/ubuntu/supports.yml +++ b/distros/ubuntu/supports.yml @@ -5,6 +5,8 @@ provider: virtualbox-iso - arch: amd64 provider: vmware-iso + - arch: amd64 + provider: hyperv-iso 22.04: *supp "23.10": *supp #18.04: *supp # EOL diff --git a/scripts/minimize.sh b/scripts/minimize.sh index 1407cd7..013f4e4 100644 --- a/scripts/minimize.sh +++ b/scripts/minimize.sh @@ -26,3 +26,5 @@ if [ -n "${swap_device}" ] && [ -e "${swap_device}" ]; then sudo dd if=/dev/zero of="$swap_device" bs=1M || : sudo /sbin/mkswap ${swap_device_label:+-L "$swap_device_label"} ${swap_device_uuid:+-U "$swap_device_uuid"} "$swap_device" fi + +sleep 15 # Hyper-v seems to be super fast during boot \ No newline at end of file diff --git a/sources/build.pkr.hcl b/sources/build.pkr.hcl index 2d68c2d..d03c3eb 100644 --- a/sources/build.pkr.hcl +++ b/sources/build.pkr.hcl @@ -17,7 +17,7 @@ packer { source = "github.com/hashicorp/vmware" } hyperv = { - version = "= 1.1.1" + version = "= 1.1.3" source = "github.com/hashicorp/hyperv" } virtualbox = { diff --git a/sources/hyperv-iso.pkr.hcl b/sources/hyperv-iso.pkr.hcl index 0a4005e..220e6c5 100644 --- a/sources/hyperv-iso.pkr.hcl +++ b/sources/hyperv-iso.pkr.hcl @@ -11,12 +11,15 @@ source "hyperv-iso" "amd64" { ssh_password = local.ssh.password ssh_handshake_attempts = local.ssh.handshake_attempts ssh_private_key_file = local.ssh.private_key_file + ssh_host = "10.42.2.254" - vm_name = "packer-${local.name}" - disk_size = "${local.disk_size}000" - cpus = local.cpus - memory = local.memory - headless = var.headless + vm_name = "packer-${local.name}" + disk_size = "${local.disk_size}000" + cpus = local.cpus + memory = local.memory + headless = var.headless + switch_name = "packer-amd64" + mac_address = "0000deadbeef" http_content = var.http_files http_directory = var.http_directory diff --git a/test.xsh b/test.xsh index 2e085bf..98d6b7b 100755 --- a/test.xsh +++ b/test.xsh @@ -5,6 +5,7 @@ import pathlib import re import sys import time +from shutil import rmtree def get_vagrant_provider(provider): @@ -62,7 +63,7 @@ def main(): p = pathlib.Path(box) with open("Vagrantfile.in", "r") as fr: content = fr.read() - content = content.replace("@@BOX@@", f"file:///home/greg/src/vms/vms/{box}") + content = content.replace("@@BOX@@", p.resolve().as_uri()) content = content.replace("@@BOX_NAME@@", p.name) with open("Vagrantfile", "w") as fw: fw.write(content) @@ -73,7 +74,9 @@ def main(): print(f"Now whatcha wanna go and do that for? {box}") continue vagrant destroy -f - rm -rf .vagrant + vag_folder = pathlib.Path(".vagrant") + if vag_folder.exists(): + rmtree(vag_folder) if __name__ == '__main__':