packer-templates | Scripts and Templates used for generating Vagrant images
kandi X-RAY | packer-templates Summary
kandi X-RAY | packer-templates Summary
Scripts and Templates used for generating Vagrant images
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of packer-templates
packer-templates Key Features
packer-templates Examples and Code Snippets
Community Discussions
Trending Discussions on packer-templates
QUESTION
Goal
I try to find the reason why a Laravel Dusk test fails on Travis CI, that is why I am trying to reproduce the used Travis CI environment locally.
Setting
In my .travis.yml
I have
ANSWER
Answered 2017-Jun-13 at 09:53An answer from Travis CI support states that it is not possible to do what I want:
Regarding your question about instructions for provisioning these images from OS X, unfortunately, this is not possible at the moment being so we don't have further instructions for that
Theoretically the following must be done: The travis_ci_sugilite Cookbook needs to be provisoned locally, the best starting point I could find is the Travis CI Packer Templates Readme.
In my case I could solve the failing build by using the new debug job feature.
QUESTION
I'm trying to use Packer form Hashicorp to create VMs. The idea is that I can create Windows 10 VMs for for each of my assignments, and run those VMs on my "main" Windows 10. I have access to Hyper-V, and as of late 2016, Packer supports that too.
Grabbing several files from Matt Wrock's Github repository, I have created a json file, an Autounattend and some scripts. When running Packer, I ended up with an error saying "Error getting WinRM host: No ip address". This had gone on for 5+ hours, so something was not going right. Interestingly, the Hyper-V Manger said that the VM was there, and I could even log in. Then I noticed that none of install scripts had been executed. For instance, in my Autounattend I execute Matt's boxstarter.ps1 script to install Boxstarter, but Boxstarter has not been installed.
To get a better visual on the process, I changed the Autounattend.xml to have all WillShowUI properties set to true. Nothing appears. To me this seems like Windows 10 is not booted. Any idea how I can check this? Also, from a different Github repository, I found in a json file for Windows Server 2013 the "boot_command" with value aaa. Without having any idea whether this applies to Windows 10 as well, I put that in my json file too. Maybe this boot command is wrong?
Alternatively, is there anyone out there having a public repository which I can use to create Windows 10 VMs that will run on Hyper-V on a Windows 10 machine?
...ANSWER
Answered 2017-Mar-20 at 11:24There is not enough details to tell what's wrong.
Try using taliesins basebox - Windows 10, he is the main author of the Hyper-V support in Packer and I expect his examples to work.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install packer-templates
keymap for standard US keyboard
UTC timezone
NTP enabled (default configuration)
full-upgrade
unattended-upgrades
/dev/vda1 mounted on / using ext4/xfs filesystem (all files in one partition)
no swap
Some of the images/templates begins with "my_" - they are preconfigured with Ansible role:.
there are usually many customization depends on distribution - all are described in Ansible playbook.
added packages: see the Common list and Debian list or CentOS list
mouse disabled in Midnight Commander + other MC customizations
preconfigured snmpd, vim, screen
logrotate using xz instead of gzip
logwatch is running once per week instead of once per day
sshd is using only the strong algorithms
sysstat (sar) is running every minute instead of every 5 minutes
UTC timezone
IEHarden disabled
Home Page set to "about:blank"
First Run Wizard disabled
Firewall allows Remote Desktop connections
AutoActivation skipped
DoNotOpenInitialConfigurationTasksAtLogon set to true
WinRM (SSL) enabled
New Network Window turned off
Administrator account enabled
EnableLUA
Windows image was finalized using sysprep: unattended.xml
If you have necessary software installed+configured on your local machine you can use the following commands to build the images. You can build the images using the build script build.sh or directly with Packer.
Ubuntu requirements: sudo apt update sudo apt install -y ansible curl git jq libc6-dev libvirt-daemon-system libvirt-dev python3-winrm qemu-kvm sshpass xorriso unzip virtualbox PACKER_LATEST_VERSION="$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')" curl "https://releases.hashicorp.com/packer/${PACKER_LATEST_VERSION}/packer_${PACKER_LATEST_VERSION}_linux_amd64.zip" --output /tmp/packer_linux_amd64.zip sudo unzip /tmp/packer_linux_amd64.zip -d /usr/local/bin/ rm /tmp/packer_linux_amd64.zip VAGRANT_LATEST_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/vagrant | jq -r -M '.current_version') curl "https://releases.hashicorp.com/vagrant/${VAGRANT_LATEST_VERSION}/vagrant_${VAGRANT_LATEST_VERSION}_x86_64.deb" --output /tmp/vagrant_x86_64.deb sudo apt install --no-install-recommends -y /tmp/vagrant_x86_64.deb rm /tmp/vagrant_x86_64.deb sudo gpasswd -a ${USER} kvm ; sudo gpasswd -a ${USER} libvirt ; sudo gpasswd -a ${USER} vboxusers vagrant plugin install vagrant-libvirt
Debian 10+ requirements: VirtualBox is not in Debian 10 or later. If you need it, you will need to figure out a way to install it. echo 'deb http://deb.debian.org/debian bullseye main contrib non-free' | sudo tee /etc/apt/sources.list.d/bullseye.list sudo sed --regexp-extended 's/^([^#].+\s+main)$/\1 contrib non-free/;' --in-place /etc/apt/sources.list ## Ensure required apt components are enabled. cat <<EOF | sudo tee /etc/apt/preferences.d/bullseye.pref 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. Package: * Pin: release o=Debian,n=bullseye Pin-Priority: 50 EOF sudo apt update sudo apt install -y ansible curl git jq libc6-dev libvirt-daemon-system libvirt-dev python3-winrm qemu-kvm sshpass xorriso unzip packer/bullseye vagrant vagrant-libvirt sudo gpasswd -a ${USER} kvm ; sudo gpasswd -a ${USER} libvirt sudo gpasswd -a ${USER} vboxusers ## If you have VirtualBox installed.
Fedora requirements: sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm sudo dnf install -y ansible curl git jq libvirt libvirt-devel qemu-kvm ruby-devel xorriso unzip VirtualBox PACKER_LATEST_VERSION="$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')" curl "https://releases.hashicorp.com/packer/${PACKER_LATEST_VERSION}/packer_${PACKER_LATEST_VERSION}_linux_amd64.zip" --output /tmp/packer_linux_amd64.zip sudo unzip /tmp/packer_linux_amd64.zip -d /usr/local/bin/ rm /tmp/packer_linux_amd64.zip VAGRANT_LATEST_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/vagrant | jq -r -M '.current_version') sudo dnf install -y https://releases.hashicorp.com/vagrant/${VAGRANT_LATEST_VERSION}/vagrant_${VAGRANT_LATEST_VERSION}_x86_64.rpm 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 sudo gpasswd -a ${USER} kvm ; sudo gpasswd -a ${USER} libvirt ; sudo gpasswd -a ${USER} vboxusers systemctl start libvirtd
Ubuntu: # Ubuntu Server ./build.sh ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox} # Ubuntu Desktop ./build.sh ubuntu-{20.04,18.04}-desktop-amd64-{libvirt,virtualbox} # Ubuntu Server - customized ./build.sh my_ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox}
Windows: # Windows Server ./build.sh windows-server-2012_r2-standard-x64-eval-{libvirt,virtualbox} ./build.sh windows-server-2016-standard-x64-eval-{libvirt,virtualbox} ./build.sh windows-server-2019-standard-x64-eval-{libvirt,virtualbox} ./build.sh windows-server-2022-standard-x64-eval-{libvirt,virtualbox} # Windows 10 ./build.sh windows-10-enterprise-x64-eval-{libvirt,virtualbox} # Windows 10 - customized ./build.sh my_windows-10-enterprise-x64-eval-{libvirt,virtualbox}
Ubuntu: # Ubuntu Server NAME="ubuntu-20.04-server-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/" \ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" ubuntu-server.json NAME="ubuntu-18.04-server-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/" \ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" ubuntu-server.json NAME="ubuntu-16.04-server-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/" \ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" ubuntu-server.json # Ubuntu Desktop NAME="ubuntu-20.04-desktop-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/" \ UBUNTU_TYPE="desktop" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" ubuntu-desktop.json # Ubuntu Server - customized NAME="my_ubuntu-20.04-server-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/" \ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" my_ubuntu-server.json NAME="my_ubuntu-18.04-server-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/" \ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" my_ubuntu-server.json NAME="my_ubuntu-16.04-server-amd64" \ UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/" \ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \ packer build -only="qemu" my_ubuntu-server.json
Windows: export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" export TMPDIR="/var/tmp" export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win" curl -L -o "${TMPDIR}/virtio-win.iso" https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso xorriso -report_about WARNING -osirrox on -indev "${TMPDIR}/virtio-win.iso" -extract / "${VIRTIO_WIN_ISO_DIR}" find "${VIRTIO_WIN_ISO_DIR}" -type d -exec chmod u+rwx {} \; # Windows Server ## Windows Server 2022 export NAME="windows-server-2022-standard-x64-eval" export WINDOWS_VERSION="2022" export ISO_URL="https://software-download.microsoft.com/download/sg/20348.169.210806-2348.fe_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso" packer build -only="qemu" windows.json ## Windows Server 2019 export NAME="windows-server-2019-standard-x64-eval" export WINDOWS_VERSION="2019" export ISO_URL="https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso" packer build -only="qemu" windows.json ## Windows Server 2016 export NAME="windows-server-2016-standard-x64-eval" export WINDOWS_VERSION="2016" export ISO_URL="https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO" packer build -only="qemu" windows.json ## Windows Server 2012 export NAME="windows-server-2012_r2-standard-x64-eval" export WINDOWS_VERSION="2012" export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win" export ISO_URL="http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO" packer build -only="qemu" windows.json # Windows 10 export NAME="windows-10-enterprise-x64-eval" export WINDOWS_VERSION="10" export ISO_URL="https://software-download.microsoft.com/download/sg/444969d5-f34g-4e03-ac9d-1f9786c69161/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" packer build -only="qemu" windows.json # Windows 10 - customized export NAME="my_windows-10-enterprise-x64-eval" export WINDOWS_VERSION="10" export ISO_URL="https://software-download.microsoft.com/download/sg/444969d5-f34g-4e03-ac9d-1f9786c69161/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" packer build -only="qemu" my_windows.json
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page