When using the raw image format and attempting to resize it we get the following error message:
```
WARNING: Image format was not specified for 'test.raw' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
```
Specifying the format will remove this warning.
Run now takes a context as well as a statebag. We'll assign the context
to the blank identifier to prevent namespace collisions. We'll let the
step authors opt-in to using the context.
`find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;`
When booting from a disk image, the Qemu builder resizes the disk to 40000
which is not a multiple of 1kB. This causes problems while booting from the image.
Updating the default disk size to 40960 fixes this issue
[A recent breaking change upstream in Golang's crypto
library](e4e2799dd7)
has broken SSH connectivity for a few builders:
```
==> qemu: Waiting for SSH to become available...
2017/05/20 16:23:58 ui: ==> qemu: Waiting for SSH to become available...
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 [INFO] Attempting SSH connection...
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 reconnecting to TCP connection for SSH
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 handshaking with SSH
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 handshake error: ssh: must specify HostKeyCallback
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 [DEBUG] SSH handshake err: ssh: must specify HostKeyCallback
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 [INFO] Attempting SSH connection...
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 reconnecting to TCP connection for SSH
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 handshaking with SSH
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 handshake error: ssh: must specify HostKeyCallback
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 [DEBUG] SSH handshake err: ssh: must specify HostKeyCallback
```
Specifying HostKeyCallback as insecure should make things work again
and would make sense for packer's use case.
If using a builder that has an http server set up for file transfer,
expose the connection info to the shell provisioner through the environment
variable PACKER_HTTP_ADDR.
Closes#2869
- Can now tune delay using PACKER_KEY_INTERVAL
- Added implementation to all of VMware and QEMU
- Removed double delay for QEMU
- Default key delay of 100ms (as before)
- Added docs to QEMU and VMware pages
In case of disk_image: true user can have raw image, but in packer
template specify qcow2 image format.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This option allows to set the extension of the ISO file after download.
Defaults to "iso". It makes sense for building Mac OS X guests, where the
bootable image is actually a DMG, not an ISO.
In particular, it is important for "parallels-iso" builder to set the right extension.
Ensure that all builders include FloppyDirectories in the StepCreateFloppy options.
Changed the way the unit-tests in common/step_create_floppy_test work to use the static test-fixtures directory instead of creating the paths dynamically.
Removed a duplicate line of documentation from parallels-pvm.html.md that occurred during rebasing.
Image format was not specified for XXX and probing
guessed raw.
Automatically detecting the format is dangerous for raw images, write
operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Moved the support for recursive paths from the floppy_files keyword to the new floppy_contents keyword.
Shifted some of the code around to add better logging of what's actually being copied.
Added a couple of unit-tests for the new floppy_contents implementation.
Ensured that all files that were being added were also being included in state.FilesAdded so that the older unit-tests will work.
Add support for using ctrl, shift and alt as key modifiers. So you can now achieve ctrl+c by using "<leftCtrlOn>c<leftCtrlOff>".
Updated documentation for new key stroke tokens.
This commit allows for a user configurable VNC bind IP to be used for
QEMU.
By default this will be 127.0.0.1, alternatively, a user can use
0.0.0.0 which will bind to all interfaces.
This pull request should satisfy concerns of #3570 and #3559. It is
also in-line with the functionality provided by #3566 and #3565
Signed-off-by: Ian Duffy <ian@ianduffy.ie>
When debugging a build (or maintaining an existing packer template), teach `packer build -debug` how to step through individual `boot_command`s in order to triage the packer template.
https://ext4.wiki.kernel.org/index.php/Ext4_VM_Images does not
recommends to dd zero file and deletes it, but in case of enabling
discards and qcow2 image we can recreate qcow2 file with less used
space.
Also qemu-img able to enable compression for qcow2 files, that
sometimes may be useful because it natively supported by qemu.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
The ISO builders (parallels, qemu, virtualbox, and vmware) had too
much common code which needed to be maintained separately. This change
moves that code to a common ISO configuration.
An additional client can be connected during build time for inspection.
We can manually connect and set our VNC clients to ignore all input or
we can connect with vnc2flv to record the build session for later
verification.
I exposed TargetPath as a config file option "target_path". I don't like
the name, but it follows the naming convention. The purpose of TargetPath
stands unmodified, and it enables a fair amount of customization.
Enabling discards for disk can greatly minimize disk size then user
inside vm use fstrim command or trim/discard unneded blocks.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Once we have produced a qemu VM, we now have the option of using
the vagrant post-processor to create a .box file that can be used with
the vagrant-libvirt plugin.
This uses the new State method of the Artifact API to get necessary
information from the builder.
In order that something consuming an artifact can have access to extra
builder specific data add the State method which allows the caller to
ask for arbitary values by name.
On CentOS7, ``pc-1.0'' qemu-kvm machine type are not supported.
Supported machines are:
none empty machine
pc RHEL 7.0.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.0.0)
pc-i440fx-rhel7.0.0 RHEL 7.0.0 PC (i440FX + PIIX, 1996) (default)
rhel6.5.0 RHEL 6.5.0 PC
rhel6.4.0 RHEL 6.4.0 PC
rhel6.3.0 RHEL 6.3.0 PC
rhel6.2.0 RHEL 6.2.0 PC
rhel6.1.0 RHEL 6.1.0 PC
rhel6.0.0 RHEL 6.0.0 PC
q35 RHEL-7.0.0 PC (Q35 + ICH9, 2009) (alias of pc-q35-rhel7.0.0)
pc-q35-rhel7.0.0 RHEL-7.0.0 PC (Q35 + ICH9, 2009)
* Using 'tcg' as accelerator for qemu-system allows packer to run in a
virtual machine as no kvm or xen support is needed.
* Also document the default behavior if no accelerator is given in the
documentation.