{"id":13588137,"url":"https://github.com/ruzickap/packer-templates","last_synced_at":"2025-04-07T20:09:24.326Z","repository":{"id":37550078,"uuid":"62026075","full_name":"ruzickap/packer-templates","owner":"ruzickap","description":"Scripts and Templates used for generating Vagrant images","archived":false,"fork":false,"pushed_at":"2025-04-06T04:45:41.000Z","size":1392,"stargazers_count":451,"open_issues_count":2,"forks_count":113,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-06T05:23:55.865Z","etag":null,"topics":["ansible","driver","libvirt","linux","packer","packer-template","packer-templates","public","qemu","templates","vagrant","vagrant-plugins","virtio","virtualbox","windows"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruzickap.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-27T04:44:10.000Z","updated_at":"2025-04-06T04:43:11.000Z","dependencies_parsed_at":"2023-10-12T09:01:34.718Z","dependency_job_id":"9917c1f6-b3ec-45ec-bfa2-ab304dd7a772","html_url":"https://github.com/ruzickap/packer-templates","commit_stats":{"total_commits":933,"total_committers":15,"mean_commits":62.2,"dds":"0.38585209003215437","last_synced_commit":"8015d761612731c7b60a261c10905c5a8d00188b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruzickap%2Fpacker-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruzickap%2Fpacker-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruzickap%2Fpacker-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruzickap%2Fpacker-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruzickap","download_url":"https://codeload.github.com/ruzickap/packer-templates/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721898,"owners_count":20985084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","driver","libvirt","linux","packer","packer-template","packer-templates","public","qemu","templates","vagrant","vagrant-plugins","virtio","virtualbox","windows"],"created_at":"2024-08-01T15:06:31.820Z","updated_at":"2025-04-07T20:09:24.285Z","avatar_url":"https://github.com/ruzickap.png","language":"Shell","funding_links":[],"categories":["Shell","ansible"],"sub_categories":[],"readme":"# Packer Templates mainly for the Vagrant [libvirt][libvirt] and [VirtualBox][virtualbox]\n\n\u003e ⚠️ **Outdated repository**\n\u003e\n\u003e This GitHub repository is outdated and no longer actively maintained.\n\u003e Feel free to fork it if needed.\n\u003e\n\u003e Things which may still be handy:\n\u003e\n\u003e * The packer template build process is using [Ansible](https://github.com/ruzickap/packer-templates/tree/main/ansible)\n\u003e   to configure the Linux/Windows VMs.\n\u003e * Packer build process is using GitHub Action + [MacOS runners](https://github.com/ruzickap/packer-templates/blob/c7ee52ca72c4295c982fa952b5e5f235ad9ffd92/.github/workflows/build.yml#L155)\n\u003e   to build the images which are uploaded to [Vagrant Cloud](https://app.vagrantup.com/boxes/search?utf8=%E2%9C%93\u0026sort=downloads\u0026provider=\u0026q=peru).\n\u003e\n\u003e Anyway - I recommend to use some other alternatives...\n\n---\n\n## Customized+Clean/Minimal boxes for [libvirt][libvirt] and [VirtualBox][virtualbox]\n\n[libvirt]: https://github.com/vagrant-libvirt/vagrant-libvirt\n[virtualbox]: https://www.vagrantup.com/docs/providers/virtualbox\n\n[![Build Status](https://github.com/ruzickap/packer-templates/workflows/build/badge.svg)](https://github.com/ruzickap/packer-templates)\n\n---\n\n### GitHub repository for bug reports or feature requests\n\n* [https://github.com/ruzickap/packer-templates/](https://github.com/ruzickap/packer-templates/issues)\n\n### Vagrant Cloud repository for the images build by these templates\n\n* [https://app.vagrantup.com/peru](https://app.vagrantup.com/peru)\n\n## Requirements\n\n* [QEMU-KVM](https://en.wikibooks.org/wiki/QEMU/Installing_QEMU)\n* [Vagrant](https://www.vagrantup.com/downloads)\n* [Vagrant Libvirt Plugin](https://github.com/pradels/vagrant-libvirt#installation)\n* [VirtualBox](https://www.virtualbox.org/) (Version 6.1 or later)\n* [Packer](https://www.packer.io/) (Version 1.8.0 or later)\n\n## Login Credentials\n\n`root` / `Administrator` password is `vagrant` or is not set.\n\nDefault login credentials:\n\n* Username: `vagrant`\n* Password: `vagrant`\n\n## VM Specifications\n\nDrivers / Devices added for the VMs for specific providers.\n\n### Libvirt\n\n* VirtIO dynamic Hard Disk (up to 50 GiB)\n* VirtIO Network Interface\n* QXL Video Card (SPICE display)\n* Channel Device (com.redhat.spice.0)\n\n### VirtualBox\n\n* SATA Disk\n\n## Configuration\n\n### Minimal Linux installation\n\n* en_US.UTF-8\n* keymap for standard US keyboard\n* UTC timezone\n* NTP enabled (default configuration)\n* full-upgrade\n* unattended-upgrades\n* /dev/vda1 mounted on / using ext4/xfs filesystem (all files in one partition)\n* no swap\n\n### Customized Linux installation\n\nSome of the [images](https://app.vagrantup.com/boxes/search?utf8=%E2%9C%93\u0026sort=downloads\u0026provider=\u0026q=peru/my)/templates\nbegins with \"my_\" - they are preconfigured with [Ansible role](https://github.com/ruzickap/ansible-role-my_common_defaults/):\n\n* there are usually many customization depends on distribution - all are\n  described in [Ansible playbook](https://github.com/ruzickap/packer-templates/blob/main/ansible/site.yml).\n* added packages: see the [Common list](https://github.com/ruzickap/ansible-role-my_common_defaults/blob/main/vars/main.yml)\n  and [Debian list](https://github.com/ruzickap/ansible-role-my_common_defaults/blob/main/vars/Debian.yml)\n  or [CentOS list](https://github.com/ruzickap/ansible-role-my_common_defaults/blob/main/vars/RedHat.yml)\n* mouse disabled in Midnight Commander + other MC customizations\n* preconfigured snmpd, vim, screen\n* logrotate using xz instead of gzip\n* logwatch is running once per week instead of once per day\n* sshd is using only the strong algorithms\n* sysstat (sar) is running every minute instead of every 5 minutes\n\n### Minimal Windows installation\n\n* UTC timezone\n* IEHarden disabled\n* Home Page set to \"about:blank\"\n* First Run Wizard disabled\n* Firewall allows Remote Desktop connections\n* AutoActivation skipped\n* DoNotOpenInitialConfigurationTasksAtLogon set to true\n* WinRM (SSL) enabled\n* OpenSSH installed and enabled\n* New Network Window turned off\n* Administrator account enabled\n* EnableLUA\n* Windows image was finalized using `sysprep`: [unattended.xml](https://github.com/ruzickap/packer-templates/blob/main/scripts/win-common/unattend.xml)\n\n### Customized Windows 10 installation\n\n* added packages: see the [common_windows_packages](https://github.com/ruzickap/ansible-role-my_common_defaults/blob/main/vars/Windows.yml)\n* Additional configuration done via Ansible playbook [Win32NT-common.yml](https://github.com/ruzickap/ansible-role-my_common_defaults/blob/main/tasks/Win32NT-common.yml)\n\n### Additional Drivers installed for libvirt boxes - [VirtIO](https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers)\n\nInstalled during installation:\n\n* NetKVM: VirtIO Network driver\n* qxldod: QXL graphics driver\n* viostor: VirtIO Block driver (VirtIO SCSI controller driver)\n\nInstalled components via Ansible playbook [win-simple.yml](https://github.com/ruzickap/packer-templates/blob/main/ansible/win-simple.yml)\nfor Windows:\n\n* vioscsi: Support for VirtIO SCSI pass-through controller\n* Balloon: VirtIO Memory Balloon driver\n* viorng: VirtIO RNG Device driver\n* vioser: VirtIO Serial Driver\n* vioinput: VirtIO Input Driver - support for new QEMU input devices\n  virtio-keyboard-pci, virtio-mouse-pci, virtio-tablet-pci,\n  virtio-input-host-pci\n* pvpanic: QEMU pvpanic device driver\n* qemu-ga: [Qemu Guest Agent](http://wiki.libvirt.org/page/Qemu_guest_agent)\n\n### Additional Drivers installed for VirtualBox boxes\n\n* VirtualBox Guest Additions\n\n## How to build images\n\nIf you have necessary software installed+configured on your local machine you\ncan use the following commands to build the images.\nYou can build the images using the build script [build.sh](build.sh) or directly\nwith Packer.\n\n* Ubuntu requirements:\n\n  ```bash\n  sudo apt update\n  sudo apt install -y ansible curl dnsmasq freerdp2-x11 git jq libc6-dev libvirt-daemon-system libvirt-dev python3-winrm qemu-kvm qemu-utils sshpass xorriso unzip virtualbox\n\n  PACKER_LATEST_VERSION=\"$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')\"\n  curl \"https://releases.hashicorp.com/packer/${PACKER_LATEST_VERSION}/packer_${PACKER_LATEST_VERSION}_linux_amd64.zip\" --output /tmp/packer_linux_amd64.zip\n  sudo unzip /tmp/packer_linux_amd64.zip -d /usr/local/bin/\n  rm /tmp/packer_linux_amd64.zip\n\n  VAGRANT_LATEST_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/vagrant | jq -r -M '.current_version')\n  curl \"https://releases.hashicorp.com/vagrant/${VAGRANT_LATEST_VERSION}/vagrant_${VAGRANT_LATEST_VERSION}_x86_64.deb\" --output /tmp/vagrant_x86_64.deb\n  sudo apt install --no-install-recommends -y /tmp/vagrant_x86_64.deb\n  rm /tmp/vagrant_x86_64.deb\n\n  sudo gpasswd -a \"${USER}\" kvm\n  sudo gpasswd -a \"${USER}\" libvirt\n  sudo gpasswd -a \"${USER}\" vboxusers\n\n  vagrant plugin install vagrant-libvirt\n  ```\n\n* Debian 10+ requirements:\n\n  VirtualBox is not in Debian 10 or later. If you need it, you will need to\n  figure out a way to install it.\n\n  ```bash\n  echo 'deb http://deb.debian.org/debian bullseye main contrib non-free' | sudo tee /etc/apt/sources.list.d/bullseye.list\n  sudo sed --regexp-extended 's/^([^#].+\\s+main)$/\\1 contrib non-free/;' --in-place /etc/apt/sources.list ## Ensure required apt components are enabled.\n  cat \u003c\u003c EOF | sudo tee /etc/apt/preferences.d/bullseye.pref\n  Explanation: Just install packages from bullseye if they are not in buster or buster-backports. Do not upgrade. Delete this file when you want to upgrade to bullseye.\n  Package: *\n  Pin: release o=Debian,n=bullseye\n  Pin-Priority: 50\n  EOF\n  sudo apt update\n  sudo apt install -y ansible curl dnsmasq freerdp2-x11 git jq libc6-dev libvirt-daemon-system libvirt-dev python3-winrm qemu-kvm qemu-utils sshpass xorriso unzip packer/bullseye vagrant vagrant-libvirt\n\n  sudo gpasswd -a \"${USER}\" kvm\n  sudo gpasswd -a \"${USER}\" libvirt\n  sudo gpasswd -a \"${USER}\" vboxusers ## If you have VirtualBox installed.\n  ```\n\n* Fedora requirements:\n\n  ```bash\n  sudo dnf install \"https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm\"\n  sudo dnf install -y ansible curl freerdp git jq libvirt libvirt-devel qemu-kvm ruby-devel xorriso unzip VirtualBox\n\n  PACKER_LATEST_VERSION=\"$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')\"\n  curl \"https://releases.hashicorp.com/packer/${PACKER_LATEST_VERSION}/packer_${PACKER_LATEST_VERSION}_linux_amd64.zip\" --output /tmp/packer_linux_amd64.zip\n  sudo unzip /tmp/packer_linux_amd64.zip -d /usr/local/bin/\n  rm /tmp/packer_linux_amd64.zip\n\n  VAGRANT_LATEST_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/vagrant | jq -r -M '.current_version')\n  sudo dnf install -y \"https://releases.hashicorp.com/vagrant/${VAGRANT_LATEST_VERSION}/vagrant-${VAGRANT_LATEST_VERSION}-1.x86_64.rpm\"\n  CONFIGURE_ARGS=\"with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64/libvirt\" vagrant plugin install vagrant-libvirt\n\n  sudo gpasswd -a \"${USER}\" kvm\n  sudo gpasswd -a \"${USER}\" libvirt\n  sudo gpasswd -a \"${USER}\" vboxusers\n  systemctl start libvirtd\n  ```\n\n### Build process with the [build.sh](build.sh) script\n\n```bash\ngit clone --recurse-submodules https://github.com/ruzickap/packer-templates.git\ncd packer-templates || exit\n```\n\n* Ubuntu:\n\n  ```bash\n  # Ubuntu Server\n  ./build.sh ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox}\n\n  # Ubuntu Desktop\n  ./build.sh ubuntu-{20.04,18.04}-desktop-amd64-{libvirt,virtualbox}\n\n  # Ubuntu Server - customized\n  ./build.sh my_ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox}\n  ```\n\n* Windows:\n\n  ```bash\n  # Windows Server\n  ./build.sh windows-server-2016-standard-x64-eval-{libvirt,virtualbox}\n  ./build.sh windows-server-2019-standard-x64-eval-{libvirt,virtualbox}\n  ./build.sh windows-server-2022-standard-x64-eval-{libvirt,virtualbox}\n\n  # Windows 10\n  ./build.sh windows-10-enterprise-x64-eval-{libvirt,virtualbox}\n\n  # Windows 10 - customized\n  ./build.sh my_windows-10-enterprise-x64-eval-{libvirt,virtualbox}\n  ```\n\n### Build process with the Packer\n\n* Ubuntu:\n\n  ```bash\n  export PACKER_IMAGES_OUTPUT_DIR=\"/var/tmp/\"\n  export LOGDIR=\"/tmp/\"\n\n  # Ubuntu Server\n  export NAME=\"ubuntu-20.04-server-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/\"\n  export UBUNTU_TYPE=\"server\"\n  packer build -only=\"qemu\" ubuntu-server.json\n\n  export NAME=\"ubuntu-18.04-server-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/\"\n  export UBUNTU_TYPE=\"server\"\n  packer build -only=\"qemu\" ubuntu-server.json\n\n  export NAME=\"ubuntu-16.04-server-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/\"\n  export UBUNTU_TYPE=\"server\"\n  packer build -only=\"qemu\" ubuntu-server.json\n\n  # Ubuntu Desktop\n  export NAME=\"ubuntu-20.04-desktop-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/\"\n  export UBUNTU_TYPE=\"desktop\"\n  packer build -only=\"qemu\" ubuntu-desktop.json\n\n  # Ubuntu Server - customized\n  export NAME=\"my_ubuntu-20.04-server-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/\"\n  export UBUNTU_TYPE=\"server\"\n  packer build -only=\"qemu\" my_ubuntu-server.json\n\n  export NAME=\"my_ubuntu-18.04-server-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/\"\n  export UBUNTU_TYPE=\"server\"\n  packer build -only=\"qemu\" my_ubuntu-server.json\n\n  export NAME=\"my_ubuntu-16.04-server-amd64\"\n  export UBUNTU_IMAGES_URL=\"http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/\"\n  export UBUNTU_TYPE=\"server\"\n  packer build -only=\"qemu\" my_ubuntu-server.json\n  ```\n\n* Windows:\n\n  ```bash\n  export PACKER_IMAGES_OUTPUT_DIR=\"/var/tmp/\"\n  export TMPDIR=\"/var/tmp\"\n  export LOGDIR=\"/tmp/\"\n  export VIRTIO_WIN_ISO_DIR=\"/var/tmp/virtio-win\"\n\n  curl -L -o \"${TMPDIR}/virtio-win.iso\" https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso\n  xorriso -report_about WARNING -osirrox on -indev \"${TMPDIR}/virtio-win.iso\" -extract / \"${VIRTIO_WIN_ISO_DIR}\"\n  find \"${VIRTIO_WIN_ISO_DIR}\" -type d -exec chmod u+rwx {} \\;\n\n  # Windows Server\n  ## Windows Server 2022\n  export NAME=\"windows-server-2022-standard-x64-eval\"\n  export WINDOWS_VERSION=\"2022\"\n  export ISO_URL=\"https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso\"\n  packer build -only=\"qemu\" windows.json\n\n  ## Windows Server 2019\n  export NAME=\"windows-server-2019-standard-x64-eval\"\n  export WINDOWS_VERSION=\"2019\"\n  export ISO_URL=\"https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66749/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso\"\n  packer build -only=\"qemu\" windows.json\n\n  ## Windows Server 2016\n  export NAME=\"windows-server-2016-standard-x64-eval\"\n  export WINDOWS_VERSION=\"2016\"\n  export ISO_URL=\"https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO\"\n  packer build -only=\"qemu\" windows.json\n\n  # Windows 10\n  export NAME=\"windows-10-enterprise-x64-eval\"\n  export WINDOWS_VERSION=\"10\"\n  export VIRTIO_WIN_ISO_DIR=\"/var/tmp/virtio-win\"\n  export ISO_URL=\"https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66750/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso\"\n  export PACKER_IMAGES_OUTPUT_DIR=\"/var/tmp/\"\n  packer build -only=\"qemu\" windows.json\n\n  # Windows 10 - customized\n  export NAME=\"my_windows-10-enterprise-x64-eval\"\n  export WINDOWS_VERSION=\"10\"\n  export VIRTIO_WIN_ISO_DIR=\"/var/tmp/virtio-win\"\n  export ISO_URL=\"https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66750/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso\"\n  export PACKER_IMAGES_OUTPUT_DIR=\"/var/tmp/\"\n  packer build -only=\"qemu\" my_windows.json\n  ```\n\n## Helper scripts\n\n* `build.sh` - build single image specified on command-line\n* `build_all.sh` - builds all images\n* `build_all_remote_ssh.sh` - connects to remote Ubuntu server, install\n  the necessary packages for building images and execute `build_all.sh`\n* `vagrant_init_destroy_boxes.sh` - tests all `*.box` images in the current\n  directory using `vagrant add/up/ssh/winrm/destroy`\n\nGitLab CI configuration (obsolete) can be found here: [GitLab_CI_configuration.md](docs/GitLab_CI_configuration.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruzickap%2Fpacker-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruzickap%2Fpacker-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruzickap%2Fpacker-templates/lists"}