jakobadam / packer-qemu-templates Goto Github PK
View Code? Open in Web Editor NEWPacker qemu templates
License: Mozilla Public License 2.0
Packer qemu templates
License: Mozilla Public License 2.0
The cdimage.debian.org repo no longer has 8.3.0, they are on 8.6.0. Would be happy to PR a change up with the new image location and the checksum if that's what's needed to bump the versions.
sudo apt-get install packer
git clone https://github.com/jakobadam/packer-qemu-templates.git
cd ubuntu
packer build -var-file=ubuntu1804.json ubuntu-vagrant.json
qemu output will be in this color.
==> qemu: Retrieving ISO
qemu: Error downloading: Error making HTTP GET request: 404 Not Found
==> qemu: ISO download failed.
Build 'qemu' errored: ISO download failed.
sed -Ei 's/(.*)(ubuntu-18.04.2)(.*)/\1ubuntu-18.04.4\3/' ubuntu1804.json
sed -Ei 's/("iso_checksum": ")(.*)(",)/\1e2ecdace33c939527cbc9e8d23576381c493b071107207d2040af72595f8990b\3/' ubuntu1804.json
I have cloned your project and tried to run packer build windows-10-enterprise.json
. After this I have to press Enter
on Windows Setup
to start installing. That was the only manual action to install Windows.
Modify ubuntu1604.json file to pick ubuntu 16.04.3 versions
http://releases.ubuntu.com/16.04/ubuntu-16.04.3-server-amd64.iso
http://releases.ubuntu.com/16.04/SHA256SUMS
Windows templates cannot longer be built due to a new bug in Cygwin OpenSSH.
The SSHd user creation fails, during OpenSSH setup
$ ssh-host-config
...
*** Warning: Expected privileged user 'cyg_server' does not exists.
*** Warning: Defaulting to 'System'
fedora 25, packer 0.12.1
packer build windows-10-enterprise-vagrant.json
seems fine until it hits this,
Typing the boot command over VNC...
Waiting for WinRM to become available...
and then its just stuck there.
Not really an issue specific to this repository, but I have not personally experienced this other than when installing Debian using Packer with qemu and its use of this particular type of network device.
I will write up the changes after an opportunity for other perspectives.
Whether you experience this will depend on your own qemu user networking support for ipv6.
Debian 8 network installation can acquire a site-local address from qemu, and if so, it then installs rdnssd
which overwrites /etc/resolv.conf
with a useless IPv6 DNS address (by default fec0::3)
In /var/log/installer/syslog
you will find..
Jan 13 13:09:47 apt-install: Queueing package rdnssd for later installation
This will overwrite /etc/resolv.conf
on reboot and cause failure of shell update/package scripts.
Solutions:
"qemuargs": [
[ "-netdev", "user,hostfwd=tcp::{{ .SSHHostPort }}-:22,id=user.0,ipv4"],
[ "-device", "virtio-net,netdev=user.0"]
]
Install resolvconf package which is recommended when rdnssd is installed normally (but not when inserted by the installer in this case) which will allow many programs to "manage" /etc/resolv.conf. In preseed.cfg edit pkgsel to add it.
d-i pkgsel/include string openssh-server resolvconf
Disable/remove rdnssd if it was installed when resolvconf was not, e.g. in preseed.cfg
d-i preseed/late_command string \
if [ -x "/target/sbin/rdnssd" -a ! -x "/target/sbin/resolvconf" ] ; then \
in-target systemctl disable rdnssd.service ; \
fi
See also this Debian bug
$ ~/packer build -var-file=ubuntu1404.json ubuntu-vagrant.json
qemu output will be in this color.
==> qemu: Downloading or copying ISO
qemu: Downloading or copying: http://releases.ubuntu.com/14.04/ubuntu-14.04.5-server-amd64.iso
==> qemu: Creating floppy disk...
qemu: Copying files flatly from floppy_files
qemu: Copying file: http/preseed.cfg
qemu: Done copying files from floppy_files
qemu: Collecting paths from floppy_dirs
qemu: Resulting paths from floppy_dirs : []
qemu: Done copying paths from floppy_dirs
==> qemu: Creating hard drive...
==> qemu: Starting HTTP server on port 8450
==> qemu: Found port for communicator (SSH, WinRM, etc): 4282.
==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu: Starting VM, booting from CD-ROM
==> qemu: Overriding defaults Qemu arguments with QemuArgs...
==> qemu: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.
==> qemu: Deleting output directory...
Build 'qemu' errored: Build was halted.
==> Some builds didn't complete successfully and had errors:
--> qemu: Build was halted.
==> Builds finished but no artifacts were created.
My system is Centos 7.
Expected: your templates work.
Actual: your templates are out-of-date but it is easy to fix.
Reproducing:
$ packer build -var-file=ubuntu1804.json ubuntu.json
Error: Failed to prepare build: "qemu"
1 error occurred:
* Deprecated configuration key: 'iso_checksum_type'. Please call `packer fix`
against your template to update your template to be compatible with the current
version of Packer. Visit https://www.packer.io/docs/commands/fix/ for more
detail.
$ packer fix -var-file=ubuntu1804.json ubuntu.json > foo.json
$ mv foo.json ubuntu.json
$ packer build -var-file=ubuntu1804.json ubuntu.json
... skip ahead ...
==> qemu: Gracefully halting virtual machine...
==> qemu: Converting hard drive...
Build 'qemu' finished.
==> Builds finished. The artifacts of successful builds are:
--> qemu: VM files in directory: output-ubuntu1804
I have cloned your project and tried to run packer build windows-10-enterprise.json
. After successful installation packer still wait for WinRM to become available.
Host: Ubuntu Server 16.04
Ran the packer build -var-file=ubuntu1604.json -var headless=true ubuntu-vagrant.json with headless option as it was giving Qemu stderr: Could not initialize SDL(No available video device) - exiting error
But after that getting waiting for ssh to become available.
Logging in with pub/priv keys is unsuccessful:
$ ssh -vvv [email protected] -i ~/.vagrant.d/insecure_private_key
...
debug1: Trying private key: /home/jakob/.vagrant.d/insecure_private_key
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA dd:3b:b8:2e:85:04:06:e9:ab:ff:a8:0a:c0:04:6e:d6
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
...
On the sshd side the windows application log says:
"Authentication refused: bad ownership or modes for directory
/cygdrive/c/Users/vagrant"
Hi,
I'm trying to build ubuntu 16.04 vagrant image forvagrant libvirt.
The only change I made was adding:
ubuntu1604.json:
"version" : "1",
"headless": "true"
as I'm building on a server. The build fails with the following reason:
==> qemu: Gracefully halting virtual machine...
==> qemu: Converting hard drive...
==> qemu: Running post-processor: vagrant
==> qemu (vagrant): Creating Vagrant box for 'libvirt' provider
qemu (vagrant): Copying from artifact: output-ubuntu1604/ubuntu1604
Build 'qemu' errored: 1 error(s) occurred:
* Post-processor failed: Unknown libvirt domain type: tcg
Any help will be much appreciated:)
Cheers,
qmacpit
Hoping I can just ask a quick question while I debug my problem.
I notice that lots of vagrant-related things are in the ubuntu.json
file. For example, that file appears to execute scripts\vagrant.sh
(which may or may not be causing my problem). Why would that be in ubuntu.json
as opposed (or in addition) to ubuntu-vagrant.json
? Maybe I'm missing some variables or keywords that control a vagrant/non-vagrant execition path through that file?
Please include latest virtio drivers for all OSes from here:
https://fedoraproject.org/wiki/Windows_Virtio_Drivers
Otherwise, installation of Windows fails on Ubuntu 14.04.
according to vagrant doc, vagrant should be able to sudo command on behalf of other users.
The config line should be:
vagrant ALL=(ALL) NOPASSWD: ALL
in debian/scripts/vagrant.sh it's:
vagrant ALL=NOPASSWD:ALL
some ansible role like ANXS.Postgresql use this feature and will fail on box generated with current template.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.