Packer Templates mainly for the Vagrant libvirt and virtualbox provider
Customized+Clean/Minimal boxes for libvirt and virtualbox provider
https://github.com/ruzickap/packer-templates/
https://app.vagrantup.com/peru
(root/Administrator password is "vagrant" or is not set )
- Username: vagrant
- Password: vagrant
Drivers / Devices added for the VMs for specific providers.
- VirtIO dynamic Hard Disk (up to 50 GiB)
- VirtIO Network Interface
- QXL Video Card (SPICE display)
- Channel Device (com.redhat.spice.0)
- SATA Disk
- 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
- en_US.UTF-8
- 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
- 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
Additional Drivers installed for libvirt boxes - VirtIO
Installed during installation:
- NetKVM: VirtIO Network driver
- qxldod: QXL graphics driver
- viostor: VirtIO Block driver (VirtIO SCSI controller driver)
Installed components via Ansible playbook win.yml for Windows:
- vioscsi: Support for VirtIO SCSI pass-through controller
- Balloon: VirtIO Memory Balloon driver
- viorng: VirtIO RNG Device driver
- vioser: VirtIO Serial Driver
- vioinput: VirtIO Input Driver - support for new QEMU input devices virtio-keyboard-pci, virtio-mouse-pci, virtio-tablet-pci, virtio-input-host-pci
- pvpanic: QEMU pvpanic device driver
- qemu-ga: Qemu Guest Agent
- VirtualBox Guest Additions
If you want to build the images yourself you will need passwordless ssh access to the latest Fedora server and locally installed Ansible. The server should not have IPs from this range 192.168.121.0/24
- this is used by Vagrant + libvirt by default.
Then you just need to modify the REMOTE_IP
and REMOTE_USER
in build_remote_ssh.sh
file.
The build_remote_ssh.sh
script will connect to your Fedora server, downloads necessary packages (initiate reboot if necessary for kernel update) and start building the images using Packer.
It will also test the newly created images by Vagrant.
The whole procedure will take several hours.
You can check the progress by sshing to the server and checking the log files in /tmp/
directory.
If you have necessary software installed+configured on your local machine you can use the following commands to build the images.
Here are the examples with build script build.sh
and "pure packer way":
- Ubuntu:
# Ubuntu Server
./build.sh ubuntu-server-18.04:libvirt
NAME=ubuntu-18.04-server-amd64 UBUNTU_VERSION=18.04 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build ubuntu-server.json
./build.sh ubuntu-server-16.04:libvirt
NAME=ubuntu-16.04-server-amd64 UBUNTU_VERSION=16.04.4 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build ubuntu-server.json
./build.sh ubuntu-server-14.04:libvirt
NAME=ubuntu-14.04-server-amd64 UBUNTU_VERSION=14.04.5 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build ubuntu-server.json
# Ubuntu Desktop
./build.sh ubuntu-desktop-18.04:libvirt
NAME=ubuntu-18.10-desktop-amd64 UBUNTU_VERSION=18.10 UBUNTU_TYPE=desktop UBUNTU_ARCH=amd64 packer build ubuntu-desktop.json
./build.sh ubuntu-desktop-17.10:libvirt
NAME=ubuntu-17.10-desktop-amd64 UBUNTU_VERSION=17.10.1 UBUNTU_TYPE=desktop UBUNTU_ARCH=amd64 packer build ubuntu-desktop.json
# Ubuntu Server - customized
./build.sh my_ubuntu-server-18.04:libvirt
NAME=my_ubuntu-18.04-server-amd64 UBUNTU_VERSION=18.04 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build my_ubuntu-server.json
./build.sh my_ubuntu-server-16.04:libvirt
NAME=my_ubuntu-16.04-server-amd64 UBUNTU_VERSION=16.04.4 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build my_ubuntu-server.json
./build.sh my_ubuntu-server-14.04:libvirt
NAME=my_ubuntu-14.04-server-amd64 UBUNTU_VERSION=14.04.5 UBUNTU_TYPE=server UBUNTU_ARCH=amd64 packer build my_ubuntu-server.json
- Windows:
# Windows Server
./build.sh windows-2012_r2:libvirt windows-2012_r2:virtualbox
NAME=windows-server-2012-r2-standard-x64-eval WINDOWS_VERSION=2012 VIRTIO_WIN_ISO=/var/tmp/packer/virtio-win.iso ISO_CHECKSUM=6612b5b1f53e845aacdf96e974bb119a3d9b4dcb5b82e65804ab7e534dc7b4d5 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
./build.sh windows-2016:libvirt windows-2016:virtualbox
NAME=windows-server-2016-standard-x64-eval WINDOWS_VERSION=2016 VIRTIO_WIN_ISO=/var/tmp/packer/virtio-win.iso ISO_CHECKSUM=1ce702a578a3cb1ac3d14873980838590f06d5b7101c5daaccbac9d73f1fb50f ISO_URL=http://care.dlservice.microsoft.com/dl/download/1/4/9/149D5452-9B29-4274-B6B3-5361DBDA30BC/14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO packer build -only=qemu windows.json
# Windows 10
./build.sh windows-10:libvirt windows-10:virtualbox
NAME=windows-10-enterprise-x64-eval WINDOWS_VERSION=10 VIRTIO_WIN_ISO=/var/tmp/packer/virtio-win.iso ISO_CHECKSUM=3d39dd9bd37db5b3c80801ae44003802a9c770a7400a1b33027ca474a1a7c691 ISO_URL=http://care.dlservice.microsoft.com/dl/download/6/5/D/65D18931-F626-4A35-AD5B-F5DA41FE6B76/16299.15.170928-1534.rs3_release_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso packer build -only=qemu windows.json
# Windows 10 - customized
./build.sh my_windows-10:libvirt my_windows-10:virtualbox
NAME=my_windows-10-enterprise-x64-eval WINDOWS_VERSION=10 VIRTIO_WIN_ISO=/var/tmp/packer/virtio-win.iso ISO_CHECKSUM=3d39dd9bd37db5b3c80801ae44003802a9c770a7400a1b33027ca474a1a7c691 ISO_URL=http://care.dlservice.microsoft.com/dl/download/6/5/D/65D18931-F626-4A35-AD5B-F5DA41FE6B76/16299.15.170928-1534.rs3_release_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso packer build -only=qemu my_windows.json
build.sh
- build single image specified on command linebuild_all.sh
- builds all imagesbuild_all_remote_ssh.sh
- connects to remote Ubuntu server, install the necessary packages for building images and executebuild_all.sh
vagrant_init_destroy_boxes.sh
- tests all*.box
images in the current directory usingvagrant add/up/ssh/winrm/destroy