Giter Club home page Giter Club logo

packer-templates's Introduction

Packer Templates mainly for the Vagrant libvirt and VirtualBox

โš ๏ธ Outdated repository

This GitHub repository is outdated and no longer actively maintained. Feel free to fork it if needed.

Things which may still be handy:

  • The packer template build process is using Ansible to configure the Linux/Windows VMs.
  • Packer build process is using GitHub Action + MacOS runners to build the images which are uploaded to Vagrant Cloud.

Anyway - I recommend to use some other alternatives...


Customized+Clean/Minimal boxes for libvirt and VirtualBox

Build Status


GitHub repository for bug reports or feature requests

Vagrant Cloud repository for the images build by these templates

Requirements

Login Credentials

root / Administrator password is vagrant or is not set.

Default login credentials:

  • Username: vagrant
  • Password: vagrant

VM Specifications

Drivers / Devices added for the VMs for specific providers.

Libvirt

  • VirtIO dynamic Hard Disk (up to 50 GiB)
  • VirtIO Network Interface
  • QXL Video Card (SPICE display)
  • Channel Device (com.redhat.spice.0)

VirtualBox

  • SATA Disk

Configuration

Minimal Linux installation

  • 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

Customized Linux installation

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

Minimal Windows installation

  • 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
  • OpenSSH installed and enabled
  • New Network Window turned off
  • Administrator account enabled
  • EnableLUA
  • Windows image was finalized using sysprep: unattended.xml

Customized Windows 10 installation

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-simple.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

Additional Drivers installed for VirtualBox boxes

  • VirtualBox Guest Additions

How to build images

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 dnsmasq freerdp2-x11 git jq libc6-dev libvirt-daemon-system libvirt-dev python3-winrm qemu-kvm qemu-utils 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 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
    
    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 freerdp 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}-1.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

Build process with the build.sh script

git clone --recurse-submodules https://github.com/ruzickap/packer-templates.git
cd packer-templates || exit
  • 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-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}

Build process with the Packer

  • Ubuntu:

    export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
    export LOGDIR="/tmp/"
    
    # Ubuntu Server
    export NAME="ubuntu-20.04-server-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/"
    export UBUNTU_TYPE="server"
    packer build -only="qemu" ubuntu-server.json
    
    export NAME="ubuntu-18.04-server-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/"
    export UBUNTU_TYPE="server"
    packer build -only="qemu" ubuntu-server.json
    
    export NAME="ubuntu-16.04-server-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/"
    export UBUNTU_TYPE="server"
    packer build -only="qemu" ubuntu-server.json
    
    # Ubuntu Desktop
    export NAME="ubuntu-20.04-desktop-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/"
    export UBUNTU_TYPE="desktop"
    packer build -only="qemu" ubuntu-desktop.json
    
    # Ubuntu Server - customized
    export NAME="my_ubuntu-20.04-server-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/"
    export UBUNTU_TYPE="server"
    packer build -only="qemu" my_ubuntu-server.json
    
    export NAME="my_ubuntu-18.04-server-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/"
    export UBUNTU_TYPE="server"
    packer build -only="qemu" my_ubuntu-server.json
    
    export NAME="my_ubuntu-16.04-server-amd64"
    export UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/"
    export UBUNTU_TYPE="server"
    packer build -only="qemu" my_ubuntu-server.json
  • Windows:

    export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
    export TMPDIR="/var/tmp"
    export LOGDIR="/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-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/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-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"
    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 10
    export NAME="windows-10-enterprise-x64-eval"
    export WINDOWS_VERSION="10"
    export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
    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"
    export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
    packer build -only="qemu" windows.json
    
    # Windows 10 - customized
    export NAME="my_windows-10-enterprise-x64-eval"
    export WINDOWS_VERSION="10"
    export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
    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"
    export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
    packer build -only="qemu" my_windows.json

Helper scripts

  • build.sh - build single image specified on command-line
  • build_all.sh - builds all images
  • build_all_remote_ssh.sh - connects to remote Ubuntu server, install the necessary packages for building images and execute build_all.sh
  • vagrant_init_destroy_boxes.sh - tests all *.box images in the current directory using vagrant add/up/ssh/winrm/destroy

GitLab CI configuration (obsolete) can be found here: GitLab_CI_configuration.md

packer-templates's People

Contributors

abbbi avatar anderpups avatar dependabot-preview[bot] avatar dependabot[bot] avatar dragon788 avatar elliotholden avatar felipecrs avatar github-actions[bot] avatar kchou94 avatar my-renovate[bot] avatar renovate-bot avatar ruzickap avatar ypid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

packer-templates's Issues

SSH password ?

I can't connect with SSH vagrant ssh command that's ask for a password obviously vagrant but it doesn't work.

Do I need to do something for SSH setup or it work out of the box ?

I used the peru/my_windows-10-enterprise-x64-eval image which have the OpenSSH server but it's not very clear in the documentation.

Server 2019: Enable OpenSSH Server

hi,

Windows 2019 seems to have OpenSSH server included. It can be installed vai Windows Capability, for example:

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Maybe it would make sense to include it in the image so one could use ssh to access the system instead of the slow WinRM connection during VM config phase?

Shared folder by default

It looks to me that https://app.vagrantup.com/peru/boxes/windows-10-enterprise-x64-eval/versions/20190802.01 does not mount the current folder in the guest.

Vagrant.configure(2) do |config|
  config.vm.define 'windows' do |machine|
    machine.vm.box = 'peru/windows-10-enterprise-x64-eval'
    machine.vm.box_url = machine.vm.box
    machine.vm.provider 'libvirt' do |p|
      p.memory = 1536  # Windows is greedy
      p.cpus = 1
    end
  end
end

By default vagrant linux boxes share the current folder (where Vagrantfile is located) under /vagrant https://www.vagrantup.com/docs/synced-folders/, and windows boxes share it typically under c:\vagrant. The linux distributions that don't include VirtualBox Guest Additions, like Fedora/RHEL, offer other ways of sharing the folder https://fedoramagazine.org/vagrant-sharing-folders-vagrant-sshfs/.

What are the available/preferred solutions for your boxes? Can the vagrant folder be mounted automatically?

vagrant user password expiry on Win2016 server std edition

Hello,

It has happened a few times now, that I use a box that is older than a month or so. At first boot, the system asks me to change the password for the "vagrant" user, and the WinRM config fails.

==> win2016: Waiting for machine to boot. This may take a few minutes...
    win2016: WinRM address: 127.0.0.1:55985
    win2016: WinRM username: vagrant
    win2016: WinRM execution_time_limit: PT2H
    win2016: WinRM transport: negotiate
    win2016: Warning: Authentication failure. Retrying...
    win2016: Warning: Authentication failure. Retrying...
    win2016: Warning: Authentication failure. Retrying...
    win2016: Warning: Authentication failure. Retrying...
    win2016: Warning: Authentication failure. Retrying...
    win2016: Warning: Authentication failure. Retrying...

Suggestion:

  • set "password never expires" on the vagrant user

add swap

My computer has limited resources. Could you consider adding 1024 MB of virtual memory when installing the system? I really need it, thank you

Ansible wsman error

After a recent system update in Arch Linux, when running

./build.sh windows-10-enterprise-x64-eval-libvirt      

I get an ansible communication error:

2019/05/02 19:19:20 packer: 2019/05/02 19:19:20 [INFO] (shell-local communicator): Executing local shell command [/bin/sh -c ANSIBLE_CONFIG='ansible/ansible.cfg' PACKER_BUILDER_TYPE='qemu' PACKER_BUILD_NAME='qemu' PACKER_HTTP_IP='10.0.2.2'  /***/box/packer_cache/packer-shell214238988]
    qemu: PLAY [all] *********************************************************************
    qemu: TASK [Gathering Facts] *********************************************************
    qemu: fatal: [127.0.0.1]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='127.0.0.1', port=2299): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2021ed3048>: Failed to establish a new connection: [Errno 111] Connection refused'))", "unreachable": true}
    qemu: PLAY RECAP *********************************************************************
    qemu: 127.0.0.1                  : ok=0    changed=0    unreachable=1    failed=0
    qemu: ===============================================================================
    qemu: Gathering Facts --------------------------------------------------------- 0.08s
2019/05/02 19:19:21 [INFO] (telemetry) ending shell-local
2019/05/02 19:19:21 packer: 2019/05/02 19:19:21 failed to unlock port lockfile: close tcp 127.0.0.1:5918: use of closed network connection
2019/05/02 19:19:21 packer: 2019/05/02 19:19:21 failed to unlock port lockfile: close tcp 127.0.0.1:5990: use of closed network connection

Note that, after the system update, building did not start without removing the "_comment" entry in windows.json.

post processor on windows broken

    virtualbox-iso (vagrant): Renaming the OVF to box.ovf...
    virtualbox-iso (vagrant): Using custom Vagrantfile: Vagrantfile-linux.template
Build 'virtualbox-iso' errored: 1 error(s) occurred:

* Post-processor failed: mkdir C:\Program Files\Git\var: Access is denied.

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: 1 error(s) occurred:

* Post-processor failed: mkdir C:\Program Files\Git\var: Access is denied.

==> Builds finished but no artifacts were created.

In vagrant long_descriptions, example code bash variables get substituted

This is correct most of the time, but breaks the script showing how to pull the latest version of vagrant.

Specifically,

VAGRANT_LATEST_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/vagrant\
  | jq -r -M '.current_version')
dnf install https://releases.hashicorp.com/vagrant/${VAGRANT_LATEST_VERSION}/vagrant_${VAGRANT_LATEST_VERSION}_x86_64.rpm

gets rendered on vagrantup.com as:

image

I'm not sure how to fix it, but relevant lines:

LONG_DESCRIPTION=$(envsubst < templates/my_centos.md)

https://unix.stackexchange.com/a/294400

VBoxManage: error: Unknown option: --clipboard (peru/ubuntu-18.04-server-amd64)

I just tried to "vagrant up" with "peru/ubuntu-18.04-server-amd64 v20200104.02" and got this error:

VBoxManage: error: Unknown option: --clipboard


OS: Windows 10 Home

> vagrant --version
Vagrant 2.2.6

> VBoxManage --version
6.1.2r135662

I also applied this workaround to run vagrant 2.2.6 with VirtualBox 6.1.2:


I fixed in on my machine by editing "e:.vagrant.d\boxes\peru-VAGRANTSLASH-ubuntu-18.04-server-amd64\20200104.02\virtualbox\Vagrantfile":

virtualbox.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]

Windows 2012R2 reboot loop

Your latest packaging of Windows 2012R2 (20180401.01) cannot be used for building a Domain Controller as it's stuck in a permanent need to reboot any time you attempt to install AD-Domain-Services. Digging around online it sounds like the Windows Internal Database can be corrupted during install some times, and your image might just require a rebuild.

Install-WindowsFeature -Name AD-Domain-Services,DNS -IncludeManagementTools

    dc: Install-WindowsFeature : The request to add or remove features on the
    dc: specified server failed.
    dc: The operation cannot be completed, because the server that you specified
    dc: requires a restart.
    dc: At C:\tmp\vagrant-shell.ps1:3 char:1
    dc: + Install-WindowsFeature -Name AD-Domain-Services,DNS -IncludeManagementTools
    dc: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    dc:     + CategoryInfo          : DeviceError: (@{Vhd=; Credent...Name=localhost}:
    dc:    PSObject) [Install-WindowsFeature], Exception
    dc:     + FullyQualifiedErrorId : DISMAPI_Error__Failed_Reboot_Required,Microsoft.
    dc:    Windows.ServerManager.Commands.AddWindowsFeatureCommand

No amount of rebooting will satisfy the requirement. I've rolled back to the previous version of your image for now.

license eval running out in box image?

hi,

i have been playing around with your windows boxes since a few days and i just noted that the eval license is running out in around 167 days, that should match the date since have released the latest box version.

Was the box once bootet? As far as i know, in a correctly sysprepped image the evaluation should start from 180 days if you freshly deploy the image and it boots for the first time?

Hyper-V synthetic timers (hv-stimer) requires Hypver-V clocksources (hv-time)

I'm on debian testing (well, actually, Kali rolling, which uses debian testing), so libvirt 6.4.0-2, https://packages.debian.org/source/bullseye/libvirt

deargle@localhost:~$ qemu-system-x86_64 --version
QEMU emulator version 5.0.0 (Debian 1:5.0-6)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
==> default: Starting domain.
There was an error talking to Libvirt. The error message is shown
below:                                                                     
                                                                           
Call to virDomainCreateWithFlags failed: internal error: qemu unexpectedly closed the monitor: 2020-08-01T15:54:13.704083Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]                                                           
2020-08-01T15:54:13.704121Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]   
2020-08-01T15:54:13.704160Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48CH).vmx-ept-execonly [bit 0]                   
2020-08-01T15:54:13.704196Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48CH).vmx-eptad [bit 21]                         
2020-08-01T15:54:13.704236Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(491H).vmx-eptp-switching [bit 0]                 
Hyper-V synthetic timers (hv-stimer) requires Hyper-V clocksources (hv-time)                                                                          
2020-08-01T15:54:13.704956Z qemu-system-x86_64: kvm_init_vcpu failed: Function not implemented 

Alas, hv-time is not supported:

Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: unsupported HyperV Enlightenment feature: time

Setting hv-stimer state to off allows boot.

v.hyperv_feature :name => 'stimer', :state => 'off'

IIRC part of qemu more strict checks to see if requested enlightenment features are actually usable, which I guess stimer isn't without time?

Enable WInRM plaintext authentication

Hi,

would it be possible to enable :plaintext authentication for WinRM on Windows images by default?
(winrm set winrm/config/service '@{AllowUnencrypted="true"}')

The default :negotiate method breaks when trying to set up an Active Directory Domain Controller (see here and here).

password for user vagrant expired in widows server

I am using windows server 2016 image, version 20190405.01.
Today, on May 17 2019 when I try to login as user vagrant I get the message that password is expired.
Could you please set password as "never expire" for user vagrant?

Box not working with VirtualBox 6.1+

This parameter name:

virtualbox.customize ["modifyvm", :id, "--clipboard", "bidirectional"]

does not exist in VirtualBox 6.1 and up.

There are two possible solutions:

  1. Remove that line from default customization commands (and allow enduser decide if he should implement this)
  2. Use one of the workaround (for example this: hashicorp/vagrant#4649 (comment) ) in order to determine VirtualBox version, and based on it determine if we should execute:

virtualbox.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
or
virtualbox.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]

bsdtar: truncated gzip input on windows box

Vagrant box add fails on box peru/windows-10-enterprise-x64-eval :

bsdtar -v -x -m -s "|\\\\|/|" -C ./ -f /home/user/.vagrant.d/tmp/box4d12f7d62e35648509248a6ba61a4ce8014d0be3
x Vagrantfile
x box.ovf
x metadata.json
x windows10-desktop-packer-template-1561617170-disk001.vmdk: truncated gzip input
bsdtar: Error exit delayed from previous errors.

checksum issue

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Downloading file: [invalid checksum: no checksum found in: http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/SHA256SUMS]

Fedora libvirt plugin issue

[root@localhost raj]# vagrant plugin install vagrant-libvirt
==> vagrant: A new version of Vagrant is available: 2.1.2!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html

Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Fetching: formatador-0.2.5.gem (100%)
Fetching: excon-0.62.0.gem (100%)
Fetching: fog-core-1.43.0.gem (100%)
Fetching: mini_portile2-2.3.0.gem (100%)
Fetching: nokogiri-1.8.4.gem (100%)
Building native extensions. This could take a while...
Fetching: ruby-libvirt-0.7.1.gem (100%)
Building native extensions. This could take a while...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

ERROR: Failed to build gem native extension.

current directory: /root/.vagrant.d/gems/2.4.3/gems/ruby-libvirt-0.7.1/ext/libvirt

/opt/vagrant/embedded/bin/ruby -r ./siteconf20180808-3963-njo12e.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
--with-libvirt-include
--without-libvirt-include
--with-libvirt-lib
--without-libvirt-lib
--with-libvirt-config
--without-libvirt-config
--with-pkg-config
--without-pkg-config
extconf.rb:73:in `

': libvirt library not found in default locations (RuntimeError)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/root/.vagrant.d/gems/2.4.3/extensions/x86_64-linux/2.4.0/ruby-libvirt-0.7.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /root/.vagrant.d/gems/2.4.3/gems/ruby-libvirt-0.7.1 for inspection.
Results logged to /root/.vagrant.d/gems/2.4.3/extensions/x86_64-linux/2.4.0/ruby-libvirt-0.7.1/gem_make.out

[root@localhost raj]#

Feature `synic` requires `vpindex` which isn't defined in Vagrantfile-windows.template

 INFO interface: error: There was an error talking to Libvirt. The error message is shown
below:

Call to virDomainCreateWithFlags failed: internal error: process exited while connecting to monitor: Hyper-V SynIC (requested by 'hv-synic' cpu flag) requires Hyper-V VP_INDEX ('hv-vpindex')
2020-07-23T14:42:04.725568Z qemu-system-x86_64: kvm_init_vcpu failed: Function not implemented
There was an error talking to Libvirt. The error message is shown
below:

Call to virDomainCreateWithFlags failed: internal error: process exited while connecting to monitor: Hyper-V SynIC (requested by 'hv-synic' cpu flag) requires Hyper-V VP_INDEX ('hv-vpindex')
2020-07-23T14:42:04.725568Z qemu-system-x86_64: kvm_init_vcpu failed: Function not implemented

Feature request for Windows 2012 r2 vagrant box

I'm currently working on some windows 2012 automation with your base box.
But I'm running into issues with the WinRM connection while installing ADFS and using HTTPS.

Is there any way we could choose from SSL and non-SSL for the WinRM settings
(inside the guest)?
I manually had to execute the following commands before provisioning to accomplish that.

winrm set winrm/config/client/auth @{Basic="true"}
winrm set winrm/config/service/auth @{Basic="true"}
winrm set winrm/config/service @{AllowUnencrypted="true"}

Furthermore, I'm unable to install a clean version of the windows 2012 R2 box:

==> vagrant: A new version of Vagrant is available: 2.0.4!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'peru/windows-server-2012-r2-standard-x64-eval' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: 20180429.01
==> default: Loading metadata for box 'peru/windows-server-2012-r2-standard-x64-eval'
    default: URL: https://vagrantcloud.com/peru/windows-server-2012-r2-standard-x64-eval
==> default: Adding box 'peru/windows-server-2012-r2-standard-x64-eval' (v20180429.01) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/peru/boxes/windows-server-2012-r2-standard-x64-eval/versions/20180429.01/providers/virtualbox.box
==> default: Successfully added box 'peru/windows-server-2012-r2-standard-x64-eval' (v20180429.01) for 'virtualbox'!
==> default: Importing base box 'peru/windows-server-2012-r2-standard-x64-eval'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'peru/windows-server-2012-r2-standard-x64-eval' is up to date...
==> default: Setting the name of the VM: win2012_default_1525101786285_9048
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 3389 (guest) => 3389 (host) (adapter 1)
    default: 5986 (guest) => 5986 (host) (adapter 1)
    default: 5985 (guest) => 55985 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: WinRM address: 127.0.0.1:5986
    default: WinRM username: Administrator
    default: WinRM execution_time_limit: PT2H
    default: WinRM transport: ssl
#<Thread:0x00007f8dfa216670@/opt/vagrant/embedded/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:471 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	21: from /opt/vagrant/embedded/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
	20: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'
	19: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:31:in `wait_for_ready'
	18: from /usr/lib/ruby/2.5.0/timeout.rb:108:in `timeout'
	17: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	16: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	15: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `block in catch'
	14: from /usr/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
	13: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:57:in `block in wait_for_ready'
	12: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:106:in `ready?'
	11: from /usr/lib/ruby/2.5.0/timeout.rb:108:in `timeout'
	10: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	 9: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	 8: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `block in catch'
	 7: from /usr/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
	 6: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:107:in `block in ready?'
	 5: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:66:in `cmd'
	 4: from /opt/vagrant/embedded/gems/gems/winrm-2.2.3/lib/winrm/connection.rb:44:in `shell'
	 3: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:67:in `block in cmd'
	 2: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:111:in `execute_with_rescue'
	 1: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:114:in `rescue in execute_with_rescue'
/opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:152:in `raise_winrm_exception': An SSL error occurred while connecting to WinRM. This usually (VagrantPlugins::CommunicatorWinRM::Errors::SSLError)
occurs when you are using a self-signed certificate and have
not set the WinRM `ssl_peer_verification` config setting to false.

Message: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello
#<Thread:0x000055bc978b89a0@/opt/vagrant/embedded/gems/gems/vagrant-2.0.3/lib/vagrant/batch_action.rb:71 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	21: from /opt/vagrant/embedded/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
	20: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'
	19: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:31:in `wait_for_ready'
	18: from /usr/lib/ruby/2.5.0/timeout.rb:108:in `timeout'
	17: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	16: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	15: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `block in catch'
	14: from /usr/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
	13: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:57:in `block in wait_for_ready'
	12: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:106:in `ready?'
	11: from /usr/lib/ruby/2.5.0/timeout.rb:108:in `timeout'
	10: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	 9: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `catch'
	 8: from /usr/lib/ruby/2.5.0/timeout.rb:33:in `block in catch'
	 7: from /usr/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
	 6: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/communicator.rb:107:in `block in ready?'
	 5: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:66:in `cmd'
	 4: from /opt/vagrant/embedded/gems/gems/winrm-2.2.3/lib/winrm/connection.rb:44:in `shell'
	 3: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:67:in `block in cmd'
	 2: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:111:in `execute_with_rescue'
	 1: from /opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:114:in `rescue in execute_with_rescue'
/opt/vagrant/embedded/gems/gems/vagrant-2.0.3/plugins/communicators/winrm/shell.rb:152:in `raise_winrm_exception': An SSL error occurred while connecting to WinRM. This usually (VagrantPlugins::CommunicatorWinRM::Errors::SSLError)
occurs when you are using a self-signed certificate and have
not set the WinRM `ssl_peer_verification` config setting to false.

Message: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello
An SSL error occurred while connecting to WinRM. This usually
occurs when you are using a self-signed certificate and have
not set the WinRM `ssl_peer_verification` config setting to false.

Message: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello

Remote libvirt server and winrm

Thanks for the box it runs perfectly when running on a local libvirt machine. I'm trying to launch it from a client machine to fire up the box on a remote libvirt server but it seems to get stuck trying to winrm. Have you gotten such a configuration working before?

Here's my Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "peru/windows-10-enterprise-x64-eval"
  config.vm.guest = :windows

  config.vm.network :forwarded_port, guest: 5986, host: 5986, id: "winrm-ssl", auto_correct:true
  config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct:true

  config.vm.boot_timeout      = 1000
  config.vm.communicator      = "winrm"
  config.vm.guest             = :windows
  config.windows.halt_timeout = 15
  config.winrm.password       = "vagrant"
  config.winrm.retry_limit    = 30
  config.winrm.username       = "vagrant"

  config.vm.synced_folder ".", "/vagrant", disabled: true

  config.vm.provider :libvirt do |libvirt|
    libvirt.driver = "kvm"
    libvirt.host = "vms0"
    libvirt.memory = 1024
    libvirt.cpus = 2
    libvirt.nested = true
    libvirt.uri = "qemu+ssh://root@vms0/system"
  end
end

I keep getting winrm trying to connect to the private management network IP:

DEBUG winrmshell: initializing WinRMShell
 INFO winrmshell: Attempting to connect to WinRM...
 INFO winrmshell:   - Host: 192.168.121.198
 INFO winrmshell:   - Port: 5985
 INFO winrmshell:   - Username: vagrant
 INFO winrmshell:   - Transport: negotiate
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.198:5985/wsman
... several more

Trying to figure out how to get winrm to use the forwarded port. Any ideas?

Windows 10 (libvirt provider): hanging at 'Waiting for SSH to become available...'

Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "peru/windows-10-enterprise-x64-eval"
end

Then vagrant up seems to work until ==> default: Waiting for ssh to become available...

At this point, even after waiting 30 minutes, nothing happens. Running winrm quickconfig on the machine via virt-manager shows that WinRM is running, but warns that the WinRM firewall exception will not work because one of the network connection types is set to Public.

Manually setting the network type to Private makes winrm quickconfig no longer complain. I'm not sure how to test further.

System info:

  • Ubuntu 18.04 (Server)
  • Vagrant 2.2.9
  • Vagrant plugins:
    • vagrant-libvirt (0.1.2, global)
    • vagrant-share (1.1.10, global)

vagrant up startup messages:

Bringing machine 'default' up with 'libvirt' provider...
==> default: Checking if box 'peru/windows-10-enterprise-x64-eval' version '20200707.01' is up to date...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default:  -- Name:              windows-vagrant_default
==> default:  -- Domain type:       kvm
==> default:  -- Cpus:              1
==> default:  -- Feature:           acpi
==> default:  -- Feature:           apic
==> default:  -- Feature:           pae
==> default:  -- Feature (HyperV):  name=relaxed, state=on
==> default:  -- Feature (HyperV):  name=stimer, state=on
==> default:  -- Feature (HyperV):  name=synic, state=on
==> default:  -- Feature (HyperV):  name=vapic, state=on
==> default:  -- Memory:            2048M
==> default:  -- Management MAC:
==> default:  -- Loader:
==> default:  -- Nvram:
==> default:  -- Base box:          peru/windows-10-enterprise-x64-eval
==> default:  -- Storage pool:      default
==> default:  -- Image:             /var/lib/libvirt/images/windows-vagrant_default.img (50G)
==> default:  -- Volume Cache:      default
==> default:  -- Kernel:
==> default:  -- Initrd:
==> default:  -- Graphics Type:     spice
==> default:  -- Graphics Port:     -1
==> default:  -- Graphics IP:       127.0.0.1
==> default:  -- Graphics Password: Not defined
==> default:  -- Video Type:        qxl
==> default:  -- Video VRAM:        9216
==> default:  -- Sound Type:    ich6
==> default:  -- Keymap:            en-us
==> default:  -- TPM Path:
==> default:  -- INPUT:             type=mouse, bus=ps2
==> default:  -- CHANNEL:             type=spicevmc, mode=
==> default:  -- CHANNEL:             target_type=virtio, target_name=com.redhat.spice.0
==> default:  -- CHANNEL:             type=unix, mode=
==> default:  -- CHANNEL:             target_type=virtio, target_name=org.qemu.guest_agent.0
==> default:  -- RNG device model:  random
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...

How to execute elevated inline powershell?

In other windows vagrant boxes (e.g. https://app.vagrantup.com/gusztavvargadr/boxes/windows-10) I used to do:

Vagrant.configure(2) do |config|
  config.vm.define 'windows' do |machine|
    machine.vm.box = 'peru/windows-10-enterprise-x64-eval'
    machine.vm.box_url = machine.vm.box
    machine.vm.provider 'libvirt' do |p|
      p.memory = 1536  # Windows is greedy
      p.cpus = 1
    end
    machine.ssh.shell = 'powershell'
  end
  config.vm.define 'windows' do |machine|
    # install chocolatey
    machine.vm.provision :shell:, :inline => 'powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString(\'https://chocolatey.org/install.ps1\'))"'
  end
end

Where machine.vm.provider 'libvirt' do |p| is replaced with machine.vm.provider 'virtualbox' do |p|.

However with the above Vagranfile I'm getting

VAGRANT_DEFAULT_PROVIDER=libvirt vagrant up
...
==> windows: Running provisioner: shell...
    windows: Running: inline PowerShell script
    windows: (10,8):UserId:
    windows: At line:72 char:1
    windows: + $folder.RegisterTaskDefinition($task_name, $task, 6, $username, $pass ...
    windows: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    windows:     + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    windows:     + FullyQualifiedErrorId : System.ArgumentException
    windows: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
    windows: At line:74 char:1
    windows: + $registered_task = $folder.GetTask("\$task_name")
    windows: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    windows:     + CategoryInfo          : OperationStopped: (:) [], FileNotFoundException
    windows:     + FullyQualifiedErrorId : System.IO.FileNotFoundException
    windows: You cannot call a method on a null-valued expression.
    windows: At line:75 char:1
    windows: + $registered_task.Run($null) | Out-Null
    windows: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    windows:     + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    windows:     + FullyQualifiedErrorId : InvokeMethodOnNull

I've tried also https://blog.ipswitch.com/running-powershell-in-vagrant, without luck:

achine.vm.provision :shell, privileged: "true", powershell_elevated_interactive: "true", :inline => 'powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString(\'https://chocolatey.org/install.ps1\'))"'

I'm using https://app.vagrantup.com/peru/boxes/windows-10-enterprise-x64-eval/versions/20190802.01 and

cat /etc/*release | grep VERSION=
VERSION="18.04.3 LTS (Bionic Beaver)"
vagrant version
Installed Version: 2.2.5
vagrant plugin list
vagrant-libvirt (0.0.45, global)
vboxmanage --version
5.2.32r132073

Ubuntu 18.04 Server - Broken url

I tried to create a LAMP server from your 'peru/ubuntu-18.04-server-amd64' (v20190218.01) box but seems that the link is broken:

==> default: Adding box 'peru/ubuntu-18.04-server-amd64' (v20190218.01) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/peru/boxes/ubuntu-18.04-server-amd64/versions/20190218.01/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

The requested URL returned error: 404 Not Found

remove ubuntu16 _comment line?

I know the repo does not list ubuntu1604 as supported, but nevertheless this line suggests it might be supported, but networking is not working I think because sysprep etc assumes that netplan is being used, which is default in ubuntu > 16, but not used for 16. << Long sentence!

fails to find checksum for ubuntu libvirt build

waboring@hpvirt1:~/devel/test/packer-templates:(git::master) $ ./build.sh ubuntu-18.04-server-amd64-libvirt

*** ubuntu | ubuntu-18.04-server-amd64 | ubuntu-18.04-server-amd64-libvirt - libvirt/qemu

  • NAME: ubuntu-18.04-server-amd64, UBUNTU_TYPE: server, UBUNTU_CODENAME: bionic, PACKER_FILE: ubuntu-server.json
  • '[' '!' -f /var/tmp/packer-templates-images/ubuntu-18.04-server-amd64-libvirt.box ']'
  • '[' false = true ']'
  • packerio build -only=qemu -color=false -var headless=true ubuntu-server.json
  • tee /var/tmp/packer-templates-images/ubuntu-18.04-server-amd64-libvirt-packer.log
    1 error(s) occurred:

Disable Windows Auto Update?

hi there,

recently i wondered about a bit how much Memory my Windows boxes are using, up to the point where a Vagrant VM with 3.5 GB of RAM went OOM with some applications.

Apparently it was the "svchost.exe" Process within the Vagrant VM which consumed 2.6 GB of my Main memory.

It turns out the automatic update process from windows seems to be the one running wild, while scanning the system for updateable components. I managed to get the system down to a regular Memory usage by disabling the windows auto update service:

sc.exe config wuauserv start= disabled
sc.exe stop wuauserv

I think this is also possible using registry, see:

https://www.experts-exchange.com/questions/27652474/how-to-prevetn-sysprep-to-turn-automatic-update-back-on.html

maybe it would make sense to disable it during sysprep phase?

eval license runs out from the date the image is released

hi,

it seems this issue is back since some time, i noticed a few months ago but just came around it again. If a freshly added libvirt box is spinned up, the license eval has already started to run out, showing the days since you have released the image to be gone .. It works out as you are releasing a new version within that timeframe, but once you stop, the boxes will become unusable after 180 days :)

I just tried with the last released 2019 box ('peru/windows-server-2019-standard-x64-eval' (v20200801.01) for libvirt
For those boxes the evaluation license already down to 177 days, if freshly spinned up.

I havent checked with the latest release you did today, (v20200803.01) but seems likey those will show the same situation after a few days have passed by.

I guess somethings going wrong during sysprep ..
Originally posted by @abbbi in #3 (comment)

Windows 2012r2 not working Fedora 27

I can't seem to figure out the issue, see the logs below:

[frezbo@RINPNDLL10 testcomplete]$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default:  -- Name:              testcomplete_default
==> default:  -- Domain type:       kvm
==> default:  -- Cpus:              1
==> default:  -- Feature:           acpi
==> default:  -- Feature:           apic
==> default:  -- Feature:           pae
==> default:  -- Memory:            2048M
==> default:  -- Management MAC:    
==> default:  -- Loader:            
==> default:  -- Base box:          peru/windows-server-2012-r2-standard-x64-eval
==> default:  -- Storage pool:      default
==> default:  -- Image:             /var/lib/libvirt/images/testcomplete_default.img (50G)
==> default:  -- Volume Cache:      default
==> default:  -- Kernel:            
==> default:  -- Initrd:            
==> default:  -- Graphics Type:     spice
==> default:  -- Graphics Port:     5900
==> default:  -- Graphics IP:       127.0.0.1
==> default:  -- Graphics Password: Not defined
==> default:  -- Video Type:        qxl
==> default:  -- Video VRAM:        9216
==> default:  -- Sound Type:	
==> default:  -- Keymap:            en-us
==> default:  -- TPM Path:          
==> default:  -- INPUT:             type=mouse, bus=ps2
==> default:  -- CHANNEL:             type=unix, mode=
==> default:  -- CHANNEL:             target_type=virtio, target_name=org.qemu.guest_agent.0
==> default:  -- CHANNEL:             type=spicevmc, mode=
==> default:  -- CHANNEL:             target_type=virtio, target_name=com.redhat.spice.0
==> default:  -- RNG device model:  random
Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: internal error: Unknown source mode ''

I think this is an issue with the image itself, I pulled the 2016 image and it works superfine

wrong usename

facing with issue with https://app.vagrantup.com/peru/boxes/windows-10-enterprise-x64-eval
after
vagrant up
....
default: WinRM transport: ssl
default: Warning: Authentication failure.

You are using
config.winrm.username = "Administrator"

but is Windows this user is disabled, after changing to config.winrm.username = "vagrant"
i managed to boot without errors
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'peru/windows-10-enterprise-x64-eval' version '20190220.01' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 3389 (guest) => 3389 (host) (adapter 1)
default: 5986 (guest) => 5986 (host) (adapter 1)
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:5986
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: ssl
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.2.18
default: VirtualBox Version: 6.0

Windows boxes need to be sysprep'ed

Hi, thank you for your work around windows boxes for vagrant. We appreciate it.

I choose your boxes to prepare Active Directory machines as part of our sssd test suite [1]. We need to setup more then one Active Directory domain in a forest which is currently problematic. Images in your boxes were not prepared with sysprep (as I see in the other issue [2]), therefore they all have the same SID and we have to use different images if we want to create more domains, which is inconvenient.

Now, I tried to do it myself before creating this ticket but I end up with the same error message as you got in [2]. I don't have time to focus on this now but I will try to solve it every now and then. But if you can spent some time on it and prepare new boxes, please do.

Thank you.

[1] https://github.com/pbrezina/sssd-test-suite
[2] #3

Windows 10 builds fail during Ansible provisioning due to missing Packer connection plugin

2017/12/31 12:48:39 ui:     windows-10-enterprise-x64-eval: fatal: [default]: FAILED! => {"msg": "the connection plugin 'packer' was not found"}
    windows-10-enterprise-x64-eval: fatal: [default]: FAILED! => {"msg": "the connection plugin 'packer' was not found"}
    windows-10-enterprise-x64-eval:     to retry, use: --limit @/home/\<redacted\>/workspace/github/ruzickap/packer-templates/ansible/win.retry
2017/12/31 12:48:39 ui:     windows-10-enterprise-x64-eval:     to retry, use: --limit @/home/nrvale0/workspace/github/ruzickap/packer-templates/ansible/win.retry

I'm not familiar enough with Ansible to know what might be the problem here. Any ideas? More than willing to submit a PR if I can figure it out.

Unable to build windows 2019 standard: ansible timout value issues

hi,

im trying to build the windows 2019 standard image and it fails due to ansible timeouts while winrm connection, even tho it manages to connect winrm beforehand:

==> qemu: System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 1Preparing modules for first use.0-1-1Completed-1
==> qemu: Connected to WinRM!

ansible fails with the following error:

ssl: read_timeout_sec must exceed operation_timeout_sec, and both must be non-zero

i had to remove the options in the ansible call to make it work, not sure if this is related to the ansible version i am using (ansible 2.8.1)

diff --git a/windows.json b/windows.json
index 9b898bc..35cc4d0 100644
--- a/windows.json
+++ b/windows.json
@@ -129,7 +129,7 @@
     {
       "type": "shell-local",
       "environment_vars": "ANSIBLE_CONFIG=ansible/ansible.cfg",
-      "command": "ansible-playbook --connection=winrm --extra-vars='ansible_winrm_read_timeout_sec=1000 ansible_winrm_operation_timeout_sec=900 ansible_winrm_server_cert_validation=ignore packer_build_name={{ user `name` }} ansible_user='{{ user `winrm_username` }}' ansible_ssh_pass='{{ user `winrm_password` }}' ansible_port={{ user `ssh_winrm_host_port` }}' -i 127.0.0.1, ansible/win-simple.yml"
+      "command": "ansible-playbook --connection=winrm --extra-vars='ansible_winrm_server_cert_validation=ignore packer_build_name={{ user `name` }} ansible_user='{{ user `winrm_username` }}' ansible_ssh_pass='{{ user `winrm_password` }}' ansible_port={{ user `ssh_winrm_host_port` }}' -i 127.0.0.1, ansible/win-simple.yml"
     },
     {
       "type": "windows-shell",

Libvirt: Set HyperV Related Feature settings for windows by default?

hi,

libvirt has some settings that can have good impact on windows performance on libvirt. I have been looking into these and after investigation i can tell that these options do indeed bring some performance speedup. Currently vagrant-libvirt has an issue where setting of multiple options in regards to hyperv features fails, see:

vagrant-libvirt/vagrant-libvirt#1039

but as this is sorted out i think it would make sense to define the following options in the default
Vagrantfile for all windows boxes:

       domain.hyperv_feature :name => 'stimer', :state => 'on'
         domain.hyperv_feature :name => 'relaxed', :state => 'on'
         domain.hyperv_feature :name => 'vapic', :state => 'on'
         domain.hyperv_feature :name => 'synic', :state => 'on'
 

During my tests these settings could speed up a first bootup of the windows VM at roughly about 10 seconds

with settings (vagrant up of windows 2016 standard image)
real    1m49,131s
real    1m42,969s
real    1m42,747s
without:
real    2m4,707s
real    2m8,940s
real    2m4,755s

is the combination of libvirt and using *shared folder* compatible?

It seems the combination of using shared folders when using libvirt, some unix shell is thrown to the windows VM:

...
config.vm.synced_folder "./", "/vagrant"
...
"./docker-vagrant" up
Starting with UID: 1000, GID: 1000
Bringing machine 'default' up with 'libvirt' provider...
==> default: Checking if box 'peru/windows-10-enterprise-x64-eval' version '20210222.01' is up to date...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default:  -- Name:              esxi-updater_default
==> default:  -- Domain type:       kvm
==> default:  -- Cpus:              1
==> default:  -- Feature:           acpi
==> default:  -- Feature:           apic
==> default:  -- Feature:           pae
==> default:  -- Feature (HyperV):  name=relaxed, state=on
==> default:  -- Feature (HyperV):  name=synic, state=on
==> default:  -- Feature (HyperV):  name=vapic, state=on
==> default:  -- Feature (HyperV):  name=vpindex, state=on
==> default:  -- Memory:            2048M
==> default:  -- Management MAC:    
==> default:  -- Loader:            
==> default:  -- Nvram:             
==> default:  -- Base box:          peru/windows-10-enterprise-x64-eval
==> default:  -- Storage pool:      default
==> default:  -- Image:             /var/lib/libvirt/images/esxi-updater_default.img (50G)
==> default:  -- Volume Cache:      default
==> default:  -- Kernel:            
==> default:  -- Initrd:            
==> default:  -- Graphics Type:     spice
==> default:  -- Graphics Port:     -1
==> default:  -- Graphics IP:       127.0.0.1
==> default:  -- Graphics Password: Not defined
==> default:  -- Video Type:        qxl
==> default:  -- Video VRAM:        9216
==> default:  -- Sound Type:	ich6
==> default:  -- Keymap:            en-us
==> default:  -- TPM Path:          
==> default:  -- INPUT:             type=mouse, bus=ps2
==> default:  -- CHANNEL:             type=spicevmc, mode=
==> default:  -- CHANNEL:             target_type=virtio, target_name=com.redhat.spice.0
==> default:  -- CHANNEL:             type=unix, mode=
==> default:  -- CHANNEL:             target_type=virtio, target_name=org.qemu.guest_agent.0
==> default:  -- RNG device model:  random
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
j==> default: Forwarding ports...
==> default: 3389 (guest) => 3389 (host) (adapter eth0)
==> default: 5986 (guest) => 5986 (host) (adapter eth0)
==> default: 5985 (guest) => 5985 (host) (adapter eth0)
==> default: Clearing any previously set forwarded ports...
==> default: Removing domain...
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ip=$(which ip); ${ip:-/sbin/ip} addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1

Stdout from the command:



Stderr from the command:

At line:1 char:33
+ ip=$(which ip); ${ip:-/sbin/ip} addr show | grep -i 'inet ' | grep -v ...
+                                 ~~~~
Unexpected token 'addr' in expression or statement.
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand


error after vm rename

Vagrantfile.txt

I'm using windows 10 as host machine, after vagrant up machine reboots one time after renaming and everything is fine. When I reload or halt machine i get error during connection after rename and reboot
issue.txt

Workaround for this case is to change file:
C:\Users\pear.vagrant.d\boxes\peru-VAGRANTSLASH-windows-10-enterprise-x64-eval\20190405.01\virtualbox\Vagrantfile
config.winrm.username = "Administrator"
#config.winrm.username = "vagrant"

and then no errors

c:\vm\w10clean>vagrant halt
==> w10VM: Attempting graceful shutdown of VM...

c:\vm\w10clean>vagrant up
Bringing machine 'w10VM' up with 'virtualbox' provider...
==> w10VM: Checking if box 'peru/windows-10-enterprise-x64-eval' version '20190405.01' is up to date...
==> w10VM: Clearing any previously set forwarded ports...
==> w10VM: Clearing any previously set network interfaces...
==> w10VM: Preparing network interfaces based on configuration...
w10VM: Adapter 1: nat
w10VM: Adapter 2: bridged
==> w10VM: Forwarding ports...
w10VM: 3389 (guest) => 3389 (host) (adapter 1)
w10VM: 5986 (guest) => 5986 (host) (adapter 1)
w10VM: 4444 (guest) => 4444 (host) (adapter 1)
w10VM: 5986 (guest) => 4545 (host) (adapter 1)
w10VM: 5985 (guest) => 55985 (host) (adapter 1)
w10VM: 22 (guest) => 2222 (host) (adapter 1)
==> w10VM: Running 'pre-boot' VM customizations...
==> w10VM: Booting VM...
==> w10VM: Waiting for machine to boot. This may take a few minutes...
w10VM: WinRM address: 127.0.0.1:4545
w10VM: WinRM username: Administrator
w10VM: WinRM execution_time_limit: PT2H
w10VM: WinRM transport: ssl
==> w10VM: Machine booted and ready!
==> w10VM: Checking for guest additions in VM...
==> w10VM: Setting hostname...
==> w10VM: Waiting for machine to reboot...
==> w10VM: Configuring and enabling network interfaces...
==> w10VM: Machine already provisioned. Run vagrant provision or use the --provision
==> w10VM: flag to force provisioning. Provisioners marked to run always will still run.`

The box you're attempting to add doesn't support the provider

The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: peru/windows-server-2012_r2-standard-x64-eval
Address: https://vagrantcloud.com/peru/windows-server-2012_r2-standard-x64-eval
Requested provider: [:virtualbox]

As far as i can see in the readme the virtualbox provider should work . Am i missing something here?

Windows10s

Could you add the new windows10s ?

At the moment it's painful because you have to first install windiws10 and then tell it to self upgrade to Windows 10s and delete itself.

elevated cmd / powershell

could you please describe how you enable elevated apps start in win 10, i cant manage start cmd, power shell start with admin privileges

Windows 10: Winrm not configured

hi,

The windows 10 evaluation image on vagrantcloud does not come up with vagrant because the winrm service is not configured within the image. I was starting up the VM via vagrant but it times out during winrm connection setup.

I then logged into the VM (which was obviously finished and up running just fine) and started winrm quickconfig and got:

C:\Users\vagrant>winrm quickconfig
WinRM is not set up to receive requests on this machine.
The following changes must be made:

Start the WinRM service.

Make these changes [y/n]? y

so it seems the image was missing the winrm configuration and as such vagrant tries endlessly to connect the vm:

INFO winrm: Checking whether WinRM is ready...
DEBUG provider: Searching for cap: winrm_info
DEBUG provider: Checking in: libvirt
DEBUG ssh: Checking key permissions: /home/abi/.vagrant.d/insecure_private_key
DEBUG winrmshell: initializing WinRMShell
INFO winrmshell: Attempting to connect to WinRM...
INFO winrmshell: - Host: 192.168.121.46
INFO winrmshell: - Port: 5985
INFO winrmshell: - Username: vagrant
INFO winrmshell: - Transport: negotiate
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman
DEBUG winrmshell: [WinRM] opening remote shell on http://192.168.121.46:5985/wsman

It seems like other services such as RDP are not configured either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.