Packer: builder/qemu: packer sends the wrong key code for "<"

Created on 7 Jan 2018  ·  48Comments  ·  Source: hashicorp/packer

packer version: 1.1.3
qemu version: 2.11
Host platform: Arch Linux

Hello,
packer sends the wrong keycode for "<". My vagrant.json line looks like this:

            "boot_command": [
                "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
                "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>",
                "bash install.sh < install-chroot.sh && systemctl reboot<enter>"
            ]

With PACKER_LOG=1 I see this line:

2018/01/07 01:07:07 packer-io: 2018/01/07 01:07:07 Sending char '<', code 60, shift true

but in my VNC session in my qemu I see this line:

bash install.sh > install-chroot.sh && systemctl reboot
buildeqemu question

Most helpful comment

@foutrelis thank you so so much for debugging this!

All 48 comments

Code 60 is the correct keycode for <. Most likely you have a (software) keymap in the VM remapping this key to the > character.

FWIW, with xev I see keycode 59 for < and keycode 60 for >.

This appears to come from xkeyboard-config:

$ grep -A1 'less, lesst' /usr/share/X11/xkb/symbols/us 
    key <AB08> { [     comma,       less, lessthanequal,      dead_macron ] };
    key <AB09> { [    period,    greater, greaterthanequal,    dead_breve ] };
$ grep AB0[89] /usr/share/X11/xkb/keycodes/evdev 
    <AB08> = 59;
    <AB09> = 60;

@rickard-von-essen When I type the "<" manually it works out. So I don't think I have the wrong keymap in the VM.

0x3c => 60 see vnc_keysym.h

If you supply the information requested in the issue template it makes it faster for us to reproduce this:

  • Debug log output from PACKER_LOG=1 packer build template.json.
    Please paste this in a gist.
  • The _simplest example template and scripts_ needed to reproduce the bug.
    Include these in your gist.

@rickard-von-essen

The template: https://github.com/archlinux/arch-boxes/blob/master/vagrant.json
Project: https://github.com/archlinux/arch-boxes/ (master branch)
Link to the Packer log: http://ix.io/DPe
Link to the screenshot of the VNC session: http://ix.io/DPf

The keycode in the vnc session is wrong. The packer_log says that the right code is submitted but the VNC session shows another key on that position. How is that even possible? I guess it has something todo with the qemu version: 2.11

Don't your single quotes (') look like apostrophes (’) too?

@rickard-von-essen mhhh not sure. Maybe the font? I will check this.
Do you have any news about that crazy keycode behaviour?

@foutrelis do you have the same problem? If so what's you OS version (guest and host) qemu, and packer version?

@shibumi haven't had time to read repro this yet.

Any update on this?

@vtolstov It would be great if you could repro this?

In qemu builder i can't reproduce this issue:
qemu 2.11.0-4.fc27.x86_64 fedora 27

packer log:
2018/01/21 23:47:34 packerio: 2018/01/21 23:47:34 Sending char '<', code 60, shift true

guest os: debian jessie 8.10.0

Hi @vtolstov ,
can you try out the newest Arch linux ISO as Guest OS? https://www.archlinux.de/download/iso/2018.01.01/archlinux-2018.01.01-x86_64.iso

And did you verify the right char? It seems for me you looked only on the packer log. I had the same line when running packer..

Here is my packer configuration: https://github.com/archlinux/arch-boxes/blob/master/vagrant.json

Keep in mind that you need to change some variables in vagrant.json

i'm not confirm this issue. fedora 27:
archlinux 2018.01.01
boot_command: "> > > > < < <"
works fine in qemu builder

Is it possible that this has something to do with the host system or the locale settings on the host system?
@foutrelis is running Arch linux as host system as well and has the same issues.

On my Laptop (Arch Linux) I get keycode "60" as well for ">":

KeyRelease event, serial 33, synthetic NO, window 0x1a00001,
    root 0xce, subw 0x0, time 7199217, (202,929), root:(1485,951),
    state 0x1, keycode 94 (keysym 0x3e, greater), same_screen YES,
    XKeysymToKeycode returns keycode: 60
    XLookupString gives 1 bytes: (3e) ">"
    XFilterEvent returns: False

localectl says:

  System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us

Here is an additional screenshot of the problem

You can see at 20:10:48 the key "<" in packer but on the VNC session you can clearly see a ">". Any way I can override the key code?

I have no clue why this behaviour exists only on Arch Linux host systems. Maybe newer software? If so all other distributions will run in the same error in the future.

   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: n/a
< - key press 59
< - key release 59
> - key press 60
> - key release 60

i think that you can experiment with qemu keyboard lang for vnc...

@vtolstov Well on VNC it works pretty well. When I press ">" I will get ">" (same for "<"). The problem is packer.. packer seems to send the wrong keycode. I would need a way to override the keycodes for packer. But I guess thats not possible without changing the go code directly. (If everything fails I think I will just patch the code.. do you mind to show me the mapping in your? Then I will just apply the patch for all packer images in arch linux. I maintain packer on arch linux.)

@shibumi sorry for my question, but does you use qemu builder directly or use vagrant/virtualbox?
Can you try this packer template:

{
    "variables": {
        "name": "archlinux-current-x86_64"
    },
    "builders": [
        {
            "accelerator": "kvm",
            "boot_command": [
                "<enter><wait120s>",
                "<enter><wait10s>",
                "echo <<< >>><wait60m>"
            ],
            "boot_wait": "14s",
            "disk_interface": "virtio-scsi",
            "disk_size": 5000,
            "disk_cache": "unsafe",
            "disk_discard": "unmap",
            "disk_compression": true,
            "iso_skip_cache": true,
            "format": "qcow2",
            "headless": true,
            "http_directory": "http",
            "iso_urls": [ "http://mirror.yandex.ru/archlinux/iso/latest/archlinux-2018.01.01-x86_64.iso" ],
            "net_device": "virtio-net",
            "output_directory": "output/{{user `name`}}-qemu/",
            "machine_type": "q35",
            "qemuargs": [
                [
                    "-m",
                    "768"
                ]
            ],
            "shutdown_command": "systemctl poweroff",
            "ssh_password": "packer",
            "ssh_username": "root",
            "ssh_wait_timeout": "1h",
            "type": "qemu",
            "vm_name": "{{user `name`}}.qcow2"
        }
    ]
}

I'm interesting of part of echo in boot_command ...

This is part of my config when i'm build arch image for our vps hosting

also, please send full qemu cmdline from ps command when you running packer build with you config

@vtolstov Same result as my vagrant.json:

You can see the output in the packer log looks ok.. but in the vncviewer you can clearly see again that the result is just: echo >>> >>>

You use packer binary from release page or build by hand? If by hand - what go version you have?

does it possible to unset x11 layout when running packer?
Also what vnc client you are using? My question is - does it sends KeyEvent or it Sends somethink like QemuExtendedKeyEvent or other specific stuff...

@vtolstov
I use the official arch linux package of packer: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/packer-io
This is version 1.1.3 build with go 1.9.3. The build process is running on one of our arch linux buildservers. (We build official arch linux images with it). There is no X11 layout set.

As VNC client I use gvncviewer, but this really doesn't matter. Because I attach the gvncviewer AFTER i saw the debug lines in the PACKER_LOG output. So it's impossible that any key has been sent to the process.

What you see on the screenshot is exactly what packer is producing. As I said.. it seems like the keycode for "<". (When I type "<" normally via VNC in the machine it works btw...)

I am pretty sure that the keycode has changed due to some new version of software. (Arch Linux is running new stable releases of every software). Therefore I am pretty sure that you will run in this behaviour with every other distribution in the future. It's just a matter of time..

I'm try to understand why exactly same packer version sends exactly same keycode that produced on you host different key inside vnc..
If that possible - can you try alpine qemu binary ?

Question about viewer - because i need to know what message sends you client when you see right symbol.

@vtolstov
Sure I can test the qemu binary on alpine linux. Give me some time. I need to install alpine on a machine, install qemu and packer and need to try it again.

I would also like to test some other things (thanks to @bastelfreak for this):

  1. Test your json file with another guest os (maybe debian?)
  2. Download your packer binary and try it with your official binary (maybe there is something wrong in the official arch linux package(?))

@vtolstov
What I can say at the moment is that on Arch Linux the keycode for "<" is definitly not 60. Because on Arch Linux keycode 60 is ">"

@shibumi yes, and this is strange too, because i have 60 for < and 62 for >

@shibumi you can use docker alpine image, i'm build my images from privileged docker container.

any news?

sorry, I haven't time yet. I will probably test it this weekend and can say more.

@vtolstov I have some issues with trying packer on alpine linux. Any idea?

/ # PACKER_LOG=1 ./packer build test.json
2018/02/11 02:42:14 [INFO] Packer version: 1.2.0
2018/02/11 02:42:14 Packer Target OS/Arch: linux amd64
2018/02/11 02:42:14 Built with Go Version: go1.9.4
2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 Using internal plugin for cloudstack
2018/02/11 02:42:14 Using internal plugin for docker
2018/02/11 02:42:14 Using internal plugin for file
2018/02/11 02:42:14 Using internal plugin for lxc
2018/02/11 02:42:14 Using internal plugin for lxd
2018/02/11 02:42:14 Using internal plugin for openstack
2018/02/11 02:42:14 Using internal plugin for qemu
2018/02/11 02:42:14 Using internal plugin for amazon-ebssurrogate
2018/02/11 02:42:14 Using internal plugin for oracle-oci
2018/02/11 02:42:14 Using internal plugin for parallels-iso
2018/02/11 02:42:14 Using internal plugin for triton
2018/02/11 02:42:14 Using internal plugin for vmware-vmx
2018/02/11 02:42:14 Using internal plugin for alicloud-ecs
2018/02/11 02:42:14 Using internal plugin for parallels-pvm
2018/02/11 02:42:14 Using internal plugin for amazon-ebsvolume
2018/02/11 02:42:14 Using internal plugin for azure-arm
2018/02/11 02:42:14 Using internal plugin for vmware-iso
2018/02/11 02:42:14 Using internal plugin for hyperv-vmcx
2018/02/11 02:42:14 Using internal plugin for null
2018/02/11 02:42:14 Using internal plugin for oracle-classic
2018/02/11 02:42:14 Using internal plugin for amazon-ebs
2018/02/11 02:42:14 Using internal plugin for amazon-chroot
2018/02/11 02:42:14 Using internal plugin for amazon-instance
2018/02/11 02:42:14 Using internal plugin for digitalocean
2018/02/11 02:42:14 Using internal plugin for googlecompute
2018/02/11 02:42:14 Using internal plugin for hyperv-iso
2018/02/11 02:42:14 Using internal plugin for ncloud
2018/02/11 02:42:14 Using internal plugin for oneandone
2018/02/11 02:42:14 Using internal plugin for scaleway
2018/02/11 02:42:14 Using internal plugin for virtualbox-ovf
2018/02/11 02:42:14 Using internal plugin for profitbricks
2018/02/11 02:42:14 Using internal plugin for virtualbox-iso
2018/02/11 02:42:14 Using internal plugin for puppet-server
2018/02/11 02:42:14 Using internal plugin for shell
2018/02/11 02:42:14 Using internal plugin for shell-local
2018/02/11 02:42:14 Using internal plugin for windows-restart
2018/02/11 02:42:14 Using internal plugin for windows-shell
2018/02/11 02:42:14 Using internal plugin for chef-client
2018/02/11 02:42:14 Using internal plugin for chef-solo
2018/02/11 02:42:14 Using internal plugin for powershell
2018/02/11 02:42:14 Using internal plugin for ansible-local
2018/02/11 02:42:14 Using internal plugin for converge
2018/02/11 02:42:14 Using internal plugin for salt-masterless
2018/02/11 02:42:14 Using internal plugin for ansible
2018/02/11 02:42:14 Using internal plugin for file
2018/02/11 02:42:14 Using internal plugin for puppet-masterless
2018/02/11 02:42:14 Using internal plugin for amazon-import
2018/02/11 02:42:14 Using internal plugin for docker-push
2018/02/11 02:42:14 Using internal plugin for manifest
2018/02/11 02:42:14 Using internal plugin for shell-local
2018/02/11 02:42:14 Using internal plugin for vagrant
2018/02/11 02:42:14 Using internal plugin for vsphere
2018/02/11 02:42:14 Using internal plugin for alicloud-import
2018/02/11 02:42:14 Using internal plugin for artifice
2018/02/11 02:42:14 Using internal plugin for docker-import
2018/02/11 02:42:14 Using internal plugin for docker-save
2018/02/11 02:42:14 Using internal plugin for atlas
2018/02/11 02:42:14 Using internal plugin for checksum
2018/02/11 02:42:14 Using internal plugin for googlecompute-export
2018/02/11 02:42:14 Using internal plugin for compress
2018/02/11 02:42:14 Using internal plugin for docker-tag
2018/02/11 02:42:14 Using internal plugin for vagrant-cloud
2018/02/11 02:42:14 Using internal plugin for vsphere-template
2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 Attempting to open config file: /root/.packerconfig
2018/02/11 02:42:14 [WARN] Config file doesn't exist: /root/.packerconfig
2018/02/11 02:42:14 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[lxc:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxc qemu:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu null:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null oracle-classic:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-classic lxd:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxd oracle-oci:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-oci alicloud-ecs:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-alicloud-ecs parallels-pvm:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm oneandone:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone scaleway:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-scaleway virtualbox-ovf:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf virtualbox-iso:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso file:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file parallels-iso:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso vmware-vmx:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx amazon-instance:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance amazon-chroot:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot hyperv-iso:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso docker:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker amazon-ebsvolume:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume azure-arm:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm vmware-iso:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso amazon-ebs:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs digitalocean:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean googlecompute:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute cloudstack:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack openstack:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack amazon-ebssurrogate:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate triton:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton hyperv-vmcx:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-vmcx ncloud:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-ncloud profitbricks:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks] PostProcessors:map[googlecompute-export:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export amazon-import:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import manifest:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest alicloud-import:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-alicloud-import artifice:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice checksum:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum docker-save:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save vagrant-cloud:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud docker-push:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push shell-local:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local compress:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress vsphere-template:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere-template vagrant:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant vsphere:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere docker-import:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import atlas:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas docker-tag:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag] Provisioners:map[puppet-server:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server salt-masterless:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless ansible:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible file:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file puppet-masterless:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless chef-solo:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo powershell:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell converge:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge shell-local:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local windows-shell:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell ansible-local:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local shell:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell windows-restart:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart chef-client:/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client]}
2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 Setting cache directory: /packer_cache
2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 Loading builder: qemu
2018/02/11 02:42:14 Plugin could not be found. Checking same directory as executable.
2018/02/11 02:42:14 Current exe path: /packer
2018/02/11 02:42:14 Creating plugin client for path: /packer
2018/02/11 02:42:14 Starting plugin: /packer []string{"/packer", "plugin", "packer-builder-qemu"}
2018/02/11 02:42:14 Waiting for RPC address for: /packer
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 [INFO] Packer version: 1.2.0
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Packer Target OS/Arch: linux amd64
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Built with Go Version: go1.9.4
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Attempting to open config file: /root/.packerconfig
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 [WARN] Config file doesn't exist: /root/.packerconfig
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Setting cache directory: /packer_cache
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 args: []string{"packer-builder-qemu"}
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Plugin minimum port: 10000
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Plugin maximum port: 25000
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Detected home directory from env var: /root
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Plugin address: unix /tmp/packer-plugin568161178
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Waiting for connection...
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Serving a plugin connection...
2018/02/11 02:42:14 ui: qemu output will be in this color.
2018/02/11 02:42:14 ui: 
2018/02/11 02:42:14 Build debug mode: false
2018/02/11 02:42:14 Force build: false
2018/02/11 02:42:14 On error: 
2018/02/11 02:42:14 Preparing build: qemu
qemu output will be in this color.

2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 use specified accelerator: kvm
2018/02/11 02:42:14 ui: Warnings for build 'qemu':

2018/02/11 02:42:14 ui: * A checksum type of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.
2018/02/11 02:42:14 ui: 
2018/02/11 02:42:14 Waiting on builds to complete...
2018/02/11 02:42:14 Starting build run: qemu
2018/02/11 02:42:14 Running builder: qemu
2018/02/11 02:42:14 [INFO] (telemetry) Starting builder qemu
Warnings for build 'qemu':

* A checksum type of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.
2018/02/11 02:42:14 packer: 2018/02/11 02:42:14 Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image page: /usr/bin/qemu-img

2018/02/11 02:42:14 ui error: ==> qemu: No byte serving support. The HTTP server must support Accept-Ranges=bytes
==> qemu: No byte serving support. The HTTP server must support Accept-Ranges=bytes
2018/02/11 02:42:14 [INFO] (telemetry) ending qemu
2018/02/11 02:42:14 [INFO] (telemetry) found error: No byte serving support. The HTTP server must support Accept-Ranges=bytes
2018/02/11 02:42:14 ui error: Build 'qemu' errored: No byte serving support. The HTTP server must support Accept-Ranges=bytes
2018/02/11 02:42:14 Builds completed. Waiting on interrupt barrier...
2018/02/11 02:42:14 machine readable: error-count []string{"1"}
2018/02/11 02:42:14 ui error: 
==> Some builds didn't complete successfully and had errors:
2018/02/11 02:42:14 machine readable: qemu,error []string{"No byte serving support. The HTTP server must support Accept-Ranges=bytes"}
2018/02/11 02:42:14 ui error: --> qemu: No byte serving support. The HTTP server must support Accept-Ranges=bytes
2018/02/11 02:42:14 ui: 
==> Builds finished but no artifacts were created.
2018/02/11 02:42:14 [INFO] (telemetry) Finalizing.
Build 'qemu' errored: No byte serving support. The HTTP server must support Accept-Ranges=bytes

==> Some builds didn't complete successfully and had errors:
--> qemu: No byte serving support. The HTTP server must support Accept-Ranges=bytes

==> Builds finished but no artifacts were created.
2018/02/11 02:42:15 waiting for all plugin processes to complete...
2018/02/11 02:42:15 /packer: plugin process exited

I am running into the same symptoms on macOS 10.12.6. Cannot repro on Ubuntu 17.10.

I have qemu from MacPorts on macOS.

$ port installed | grep qemu
  qemu @2.11.0_0+cocoa+target_i386+target_x86_64+usb+vnc (active)

Here's snippet of my config:

{
    "builders": [
        {
            "boot_command": [
                "S<enter>",
                "cat <<EOF >>install.conf<enter>",
                "Choose your keyboard layout = default<enter>",
================== SNIP ==================
                "EOF<enter>",
                "install -af install.conf && reboot<enter>"
            ],
            "boot_wait": "30s",
            "disk_interface": "virtio",
            "disk_size": 80000,
            "format": "qcow2",
            "headless": true,
            "iso_checksum": "b7994d29c7db3087db65158901d700fb7d10500b9b7496c1d86b285cabce0a2b",
            "iso_checksum_type": "sha256",
            "iso_checksum_url": "{{user `iso_mirror`}}/pub/OpenBSD/6.2/amd64/SHA256",
            "iso_url": "{{user `iso_mirror`}}/pub/OpenBSD/6.2/amd64/install62.iso",
            "net_device": "e1000",
            "output_directory": "openbsd62",
            "shutdown_command": "/sbin/halt -p",
            "type": "qemu",
            "ssh_host_port_min": 2222,
            "ssh_host_port_max": 2229,
            "ssh_password": "root",
            "ssh_port": 22,
            "ssh_username": "root",
            "ssh_wait_timeout": "1800s",
            "vm_name": "openbsd62.qcow2"
        }
    ],
    "post-processors": [],
    "provisioners": [],
    "variables": {
        "iso_mirror": "http://ftp.openbsd.org"
    }
}

As can be seen in the screenshot, << does not get printed.

screen

==> qemu: Typing the boot command over VNC...
2018/02/27 13:47:12 packer: 2018/02/27 13:47:12 Sending char 'S', code 83, shift true
2018/02/27 13:47:12 packer: 2018/02/27 13:47:12 Special code '<enter>' found, replacing with: 65293
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char 'c', code 99, shift false
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char 'a', code 97, shift false
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char 't', code 116, shift false
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char ' ', code 32, shift false
2018/02/27 13:47:14 packer: 2018/02/27 13:47:14 Sending char '<', code 60, shift true
2018/02/27 13:47:14 packer: 2018/02/27 13:47:14 Sending char '<', code 60, shift true
2018/02/27 13:47:14 packer: 2018/02/27 13:47:14 Sending char 'E', code 69, shift true
2018/02/27 13:47:15 packer: 2018/02/27 13:47:15 Sending char 'O', code 79, shift true
2018/02/27 13:47:15 packer: 2018/02/27 13:47:15 Sending char 'F', code 70, shift true
2018/02/27 13:47:15 packer: 2018/02/27 13:47:15 Sending char ' ', code 32, shift false
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char '>', code 62, shift true
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char '>', code 62, shift true
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char 'i', code 105, shift false
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char 'n', code 110, shift false
2018/02/27 13:47:17 packer: 2018/02/27 13:47:17 Sending char 's', code 115, shift false
2018/02/27 13:47:17 packer: 2018/02/27 13:47:17 Sending char 't', code 116, shift false
2018/02/27 13:47:17 packer: 2018/02/27 13:47:17 Sending char 'a', code 97, shift false
2018/02/27 13:47:18 packer: 2018/02/27 13:47:18 Sending char 'l', code 108, shift false
2018/02/27 13:47:18 packer: 2018/02/27 13:47:18 Sending char 'l', code 108, shift false
2018/02/27 13:47:18 packer: 2018/02/27 13:47:18 Sending char '.', code 46, shift false


$ env PACKER_LOG=1 ~/bin/packer build openbsd-6.2-x86_64.json
2018/02/27 13:46:39 [INFO] Packer version: 1.2.1
2018/02/27 13:46:39 Packer Target OS/Arch: darwin amd64
2018/02/27 13:46:39 Built with Go Version: go1.10
2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 Using internal plugin for digitalocean
2018/02/27 13:46:39 Using internal plugin for hyperv-iso
2018/02/27 13:46:39 Using internal plugin for vmware-vmx
2018/02/27 13:46:39 Using internal plugin for amazon-instance
2018/02/27 13:46:39 Using internal plugin for virtualbox-ovf
2018/02/27 13:46:39 Using internal plugin for vmware-iso
2018/02/27 13:46:39 Using internal plugin for azure-arm
2018/02/27 13:46:39 Using internal plugin for cloudstack
2018/02/27 13:46:39 Using internal plugin for virtualbox-iso
2018/02/27 13:46:39 Using internal plugin for parallels-pvm
2018/02/27 13:46:39 Using internal plugin for amazon-ebsvolume
2018/02/27 13:46:39 Using internal plugin for googlecompute
2018/02/27 13:46:39 Using internal plugin for oracle-classic
2018/02/27 13:46:39 Using internal plugin for triton
2018/02/27 13:46:39 Using internal plugin for docker
2018/02/27 13:46:39 Using internal plugin for lxd
2018/02/27 13:46:39 Using internal plugin for ncloud
2018/02/27 13:46:39 Using internal plugin for profitbricks
2018/02/27 13:46:39 Using internal plugin for qemu
2018/02/27 13:46:39 Using internal plugin for amazon-chroot
2018/02/27 13:46:39 Using internal plugin for amazon-ebssurrogate
2018/02/27 13:46:39 Using internal plugin for oracle-oci
2018/02/27 13:46:39 Using internal plugin for oneandone
2018/02/27 13:46:39 Using internal plugin for openstack
2018/02/27 13:46:39 Using internal plugin for parallels-iso
2018/02/27 13:46:39 Using internal plugin for scaleway
2018/02/27 13:46:39 Using internal plugin for amazon-ebs
2018/02/27 13:46:39 Using internal plugin for hyperv-vmcx
2018/02/27 13:46:39 Using internal plugin for lxc
2018/02/27 13:46:39 Using internal plugin for alicloud-ecs
2018/02/27 13:46:39 Using internal plugin for file
2018/02/27 13:46:39 Using internal plugin for null
2018/02/27 13:46:39 Using internal plugin for converge
2018/02/27 13:46:39 Using internal plugin for file
2018/02/27 13:46:39 Using internal plugin for powershell
2018/02/27 13:46:39 Using internal plugin for shell
2018/02/27 13:46:39 Using internal plugin for windows-restart
2018/02/27 13:46:39 Using internal plugin for ansible-local
2018/02/27 13:46:39 Using internal plugin for chef-client
2018/02/27 13:46:39 Using internal plugin for puppet-server
2018/02/27 13:46:39 Using internal plugin for windows-shell
2018/02/27 13:46:39 Using internal plugin for ansible
2018/02/27 13:46:39 Using internal plugin for chef-solo
2018/02/27 13:46:39 Using internal plugin for puppet-masterless
2018/02/27 13:46:39 Using internal plugin for salt-masterless
2018/02/27 13:46:39 Using internal plugin for shell-local
2018/02/27 13:46:39 Using internal plugin for artifice
2018/02/27 13:46:39 Using internal plugin for docker-save
2018/02/27 13:46:39 Using internal plugin for docker-push
2018/02/27 13:46:39 Using internal plugin for manifest
2018/02/27 13:46:39 Using internal plugin for shell-local
2018/02/27 13:46:39 Using internal plugin for amazon-import
2018/02/27 13:46:39 Using internal plugin for checksum
2018/02/27 13:46:39 Using internal plugin for compress
2018/02/27 13:46:39 Using internal plugin for docker-tag
2018/02/27 13:46:39 Using internal plugin for vagrant
2018/02/27 13:46:39 Using internal plugin for vagrant-cloud
2018/02/27 13:46:39 Using internal plugin for vsphere-template
2018/02/27 13:46:39 Using internal plugin for alicloud-import
2018/02/27 13:46:39 Using internal plugin for atlas
2018/02/27 13:46:39 Using internal plugin for docker-import
2018/02/27 13:46:39 Using internal plugin for googlecompute-export
2018/02/27 13:46:39 Using internal plugin for vsphere
2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 Attempting to open config file: /Users/REDACTED/.packerconfig
2018/02/27 13:46:39 [WARN] Config file doesn't exist: /Users/REDACTED/.packerconfig
2018/02/27 13:46:39 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[hyperv-iso:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso triton:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton docker:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker alicloud-ecs:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-alicloud-ecs vmware-iso:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso hyperv-vmcx:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-vmcx virtualbox-iso:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso amazon-ebssurrogate:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate lxc:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxc parallels-pvm:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm oracle-classic:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-classic openstack:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack amazon-ebs:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs ncloud:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-ncloud amazon-chroot:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot scaleway:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-scaleway vmware-vmx:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx amazon-instance:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance virtualbox-ovf:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf cloudstack:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack parallels-iso:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso null:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null azure-arm:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm googlecompute:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute lxd:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxd oneandone:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone amazon-ebsvolume:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume profitbricks:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks oracle-oci:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-oci digitalocean:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean qemu:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu file:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file] PostProcessors:map[vagrant:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant shell-local:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local docker-tag:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag googlecompute-export:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export checksum:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum docker-push:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push manifest:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest compress:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress alicloud-import:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-alicloud-import atlas:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas docker-import:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import docker-save:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save amazon-import:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import vagrant-cloud:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud vsphere-template:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere-template vsphere:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere artifice:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice] Provisioners:map[ansible:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible puppet-masterless:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless salt-masterless:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless chef-client:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client windows-shell:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell chef-solo:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo shell:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell puppet-server:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server converge:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge file:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file powershell:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell windows-restart:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart ansible-local:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local shell-local:/Users/REDACTED/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local]}
2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 Setting cache directory: /Users/REDACTED/repos/packer-configs/packer_cache
2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 Loading builder: qemu
2018/02/27 13:46:39 Plugin could not be found. Checking same directory as executable.
2018/02/27 13:46:39 Current exe path: /Users/REDACTED/bin/packer
2018/02/27 13:46:39 Creating plugin client for path: /Users/REDACTED/bin/packer
2018/02/27 13:46:39 Starting plugin: /Users/REDACTED/bin/packer []string{"/Users/REDACTED/bin/packer", "plugin", "packer-builder-qemu"}
2018/02/27 13:46:39 Waiting for RPC address for: /Users/REDACTED/bin/packer
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 [INFO] Packer version: 1.2.1
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Packer Target OS/Arch: darwin amd64
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Built with Go Version: go1.10
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Attempting to open config file: /Users/REDACTED/.packerconfig
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 [WARN] Config file doesn't exist: /Users/REDACTED/.packerconfig
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Setting cache directory: /Users/REDACTED/repos/packer-configs/packer_cache
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 args: []string{"packer-builder-qemu"}
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Plugin minimum port: 10000
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Plugin maximum port: 25000
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Plugin address: unix /var/folders/cd/59vmvhd93_g042_b779256jw00bdld/T/packer-plugin090374948
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Waiting for connection...
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Serving a plugin connection...
2018/02/27 13:46:39 Loading provisioner: shell
2018/02/27 13:46:39 Plugin could not be found. Checking same directory as executable.
2018/02/27 13:46:39 Current exe path: /Users/REDACTED/bin/packer
2018/02/27 13:46:39 Creating plugin client for path: /Users/REDACTED/bin/packer
2018/02/27 13:46:39 Starting plugin: /Users/REDACTED/bin/packer []string{"/Users/REDACTED/bin/packer", "plugin", "packer-provisioner-shell"}
2018/02/27 13:46:39 Waiting for RPC address for: /Users/REDACTED/bin/packer
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 [INFO] Packer version: 1.2.1
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Packer Target OS/Arch: darwin amd64
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Built with Go Version: go1.10
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Attempting to open config file: /Users/REDACTED/.packerconfig
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 [WARN] Config file doesn't exist: /Users/REDACTED/.packerconfig
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Setting cache directory: /Users/REDACTED/repos/packer-configs/packer_cache
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Detected home directory from env var: /Users/REDACTED
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 args: []string{"packer-provisioner-shell"}
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Plugin minimum port: 10000
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Plugin maximum port: 25000
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Plugin address: unix /var/folders/cd/59vmvhd93_g042_b779256jw00bdld/T/packer-plugin087824806
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Waiting for connection...
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Serving a plugin connection...
2018/02/27 13:46:39 ui: qemu output will be in this color.
2018/02/27 13:46:39 ui:
2018/02/27 13:46:39 Build debug mode: false
2018/02/27 13:46:39 Force build: false
2018/02/27 13:46:39 On error:
2018/02/27 13:46:39 Preparing build: qemu
qemu output will be in this color.

2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 use detected accelerator: tcg
2018/02/27 13:46:39 Waiting on builds to complete...
2018/02/27 13:46:39 Starting build run: qemu
2018/02/27 13:46:39 Running builder: qemu
2018/02/27 13:46:39 [INFO] (telemetry) Starting builder qemu
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Qemu path: /opt/local/bin/qemu-system-x86_64, Qemu Image page: /opt/local/bin/qemu-img
2018/02/27 13:46:39 ui: ==> qemu: Downloading or copying ISO
==> qemu: Downloading or copying ISO
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Acquiring lock to download: http://ftp.openbsd.org/pub/OpenBSD/6.2/amd64/install62.iso
2018/02/27 13:46:39 packer: 2018/02/27 13:46:39 Verifying checksum of /Users/REDACTED/repos/packer-configs/packer_cache/d56b4f393beacc5c8d3707a93a0226d79854f3380a0352dae1de713f1d02fd3d.iso
2018/02/27 13:46:40 ui: qemu: Found already downloaded, initial checksum matched, no download needed: http://ftp.openbsd.org/pub/OpenBSD/6.2/amd64/install62.iso
qemu: Found already downloaded, initial checksum matched, no download needed: http://ftp.openbsd.org/pub/OpenBSD/6.2/amd64/install62.iso
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 No floppy files specified. Floppy disk will not be made.
2018/02/27 13:46:40 ui: ==> qemu: Creating hard drive...
==> qemu: Creating hard drive...
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Executing qemu-img: []string{"create", "-f", "qcow2", "openbsd62/openbsd62.qcow2", "80000M"}
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 stdout: Formatting 'openbsd62/openbsd62.qcow2', fmt=qcow2 size=83886080000 cluster_size=65536 lazy_refcounts=off refcount_bits=16
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 stderr:
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Looking for available communicator (SSH, WinRM, etc) port between 2222 and 2229
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Trying port: 2229
2018/02/27 13:46:40 ui: ==> qemu: Found port for communicator (SSH, WinRM, etc): 2229.
==> qemu: Found port for communicator (SSH, WinRM, etc): 2229.
2018/02/27 13:46:40 ui: ==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Looking for available port between 5900 and 6000 on 127.0.0.1
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Trying port: 5965
==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Found available VNC port: 5965 on IP: 127.0.0.1
2018/02/27 13:46:40 ui: ==> qemu: Starting VM, booting from CD-ROM
==> qemu: Starting VM, booting from CD-ROM
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Qemu --version output: QEMU emulator version 2.11.0
2018/02/27 13:46:40 packer: Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Qemu version: 2.11.0
2018/02/27 13:46:40 ui: qemu: The VM will be run headless, without a GUI. If you want to
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5965
qemu: The VM will be run headless, without a GUI. If you want to
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Qemu Builder has no floppy files, not attaching a floppy.
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5965
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Executing /opt/local/bin/qemu-system-x86_64: []string{"-m", "512M", "-name", "openbsd62.qcow2", "-machine", "type=pc,accel=tcg", "-netdev", "user,id=user.0,hostfwd=tcp::2229-:22", "-device", "e1000,netdev=user.0", "-cdrom", "/Users/REDACTED/repos/packer-configs/packer_cache/d56b4f393beacc5c8d3707a93a0226d79854f3380a0352dae1de713f1d02fd3d.iso", "-boot", "once=d", "-vnc", "127.0.0.1:65", "-drive", "file=openbsd62/openbsd62.qcow2,if=virtio,cache=writeback,discard=ignore,format=qcow2"}
2018/02/27 13:46:40 packer: 2018/02/27 13:46:40 Started Qemu. Pid: 68847
2018/02/27 13:46:42 ui: ==> qemu: Waiting 30s for boot...
==> qemu: Waiting 30s for boot...
2018/02/27 13:47:12 ui: ==> qemu: Connecting to VM via VNC
==> qemu: Connecting to VM via VNC
2018/02/27 13:47:12 packer: 2018/02/27 13:47:12 Connected to VNC desktop: QEMU (openbsd62.qcow2)
2018/02/27 13:47:12 ui: ==> qemu: Typing the boot command over VNC...
==> qemu: Typing the boot command over VNC...
2018/02/27 13:47:12 packer: 2018/02/27 13:47:12 Sending char 'S', code 83, shift true
2018/02/27 13:47:12 packer: 2018/02/27 13:47:12 Special code '' found, replacing with: 65293
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char 'c', code 99, shift false
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char 'a', code 97, shift false
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char 't', code 116, shift false
2018/02/27 13:47:13 packer: 2018/02/27 13:47:13 Sending char ' ', code 32, shift false
2018/02/27 13:47:14 packer: 2018/02/27 13:47:14 Sending char '<', code 60, shift true
2018/02/27 13:47:14 packer: 2018/02/27 13:47:14 Sending char '<', code 60, shift true
2018/02/27 13:47:14 packer: 2018/02/27 13:47:14 Sending char 'E', code 69, shift true
2018/02/27 13:47:15 packer: 2018/02/27 13:47:15 Sending char 'O', code 79, shift true
2018/02/27 13:47:15 packer: 2018/02/27 13:47:15 Sending char 'F', code 70, shift true
2018/02/27 13:47:15 packer: 2018/02/27 13:47:15 Sending char ' ', code 32, shift false
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char '>', code 62, shift true
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char '>', code 62, shift true
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char 'i', code 105, shift false
2018/02/27 13:47:16 packer: 2018/02/27 13:47:16 Sending char 'n', code 110, shift false
2018/02/27 13:47:17 packer: 2018/02/27 13:47:17 Sending char 's', code 115, shift false
2018/02/27 13:47:17 packer: 2018/02/27 13:47:17 Sending char 't', code 116, shift false
2018/02/27 13:47:17 packer: 2018/02/27 13:47:17 Sending char 'a', code 97, shift false
2018/02/27 13:47:18 packer: 2018/02/27 13:47:18 Sending char 'l', code 108, shift false
2018/02/27 13:47:18 packer: 2018/02/27 13:47:18 Sending char 'l', code 108, shift false
2018/02/27 13:47:18 packer: 2018/02/27 13:47:18 Sending char '.', code 46, shift false
2018/02/27 13:47:19 packer: 2018/02/27 13:47:19 Sending char 'c', code 99, shift false
2018/02/27 13:47:19 packer: 2018/02/27 13:47:19 Sending char 'o', code 111, shift false
2018/02/27 13:47:19 packer: 2018/02/27 13:47:19 Sending char 'n', code 110, shift false
2018/02/27 13:47:20 packer: 2018/02/27 13:47:20 Sending char 'f', code 102, shift false
2018/02/27 13:47:20 packer: 2018/02/27 13:47:20 Special code '' found, replacing with: 65293
2018/02/27 13:47:20 packer: 2018/02/27 13:47:20 Sending char 'C', code 67, shift true

@aikchar as i see in you case not << and nor >> passed to vnc

@shibumi you need to recheck you iso url

2018/02/11 02:42:14 [INFO] (telemetry) found error: No byte serving support. The HTTP server must support Accept-Ranges=bytes
2018/02/11 02:42:14 ui error: Build 'qemu' errored: No byte serving support. The HTTP server must support Accept-Ranges=bytes
2018/02/11 02:42:14 Builds completed. Waiting on interrupt barrier...

means that web server on other side returns witout Accept-Range=bytes or not status code 200

@vtolstov Now I get the following error:

2018/02/28 15:17:16 packer: 2018/02/28 15:17:16 Qemu stderr: Could not access KVM kernel module: No such file or directory
2018/02/28 15:17:16 packer: 2018/02/28 15:17:16 Qemu stderr: qemu-system-x86_64: failed to initialize KVM: No such file or directory
2018/02/28 15:17:16 ui error: ==> qemu: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.
==> qemu: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.
2018/02/28 15:17:16 ui: ==> qemu: Deleting output directory...
==> qemu: Deleting output directory...
2018/02/28 15:17:16 [INFO] (telemetry) ending qemu
2018/02/28 15:17:16 [INFO] (telemetry) found error: Build was halted.
2018/02/28 15:17:16 ui error: Build 'qemu' errored: Build was halted.
2018/02/28 15:17:16 Builds completed. Waiting on interrupt barrier...
2018/02/28 15:17:16 machine readable: error-count []string{"1"}
2018/02/28 15:17:16 ui error: 
==> Some builds didn't complete successfully and had errors:
2018/02/28 15:17:16 machine readable: qemu,error []string{"Build was halted."}
2018/02/28 15:17:16 ui error: --> qemu: Build was halted.
2018/02/28 15:17:16 ui: 
==> Builds finished but no artifacts were created.
2018/02/28 15:17:16 [INFO] (telemetry) Finalizing.
Build 'qemu' errored: Build was halted.

Sorry I am really not a docker guy :S. I guess I have to run the container with all privileges to get kernel KVM_Intel support.. although lsmod says it's loaded.

This seems to be caused by https://github.com/qemu/qemu/commit/a7815faffb2bd594b92aa3542d7b799cc89c5414 and thus reproducible only with QEMU 2.11.

Whereas the old en-us keymap would contain (among others):

comma 0x33
less 0x33 shift
period 0x34
greater 0x34 shift

The new one contains:

period 0x34
greater 0x34 shift
...
less 0x56
greater 0x56 shift
bar 0x56 altgr
brokenbar 0x56 shift altgr

Those less 0x56 and greater 0x56 shift lines seem wrong. They are also not included in the en-gb keymap.

I filed a bug against QEMU; hopefully they can figure out what went wrong during the keymap updates:

https://bugs.launchpad.net/qemu/+bug/1754295

Thanks @foutrelis but it's still weird because @vtolstov said he has tested it on fedora with Qemu 2.11

Looks like my QEMU bug is a duplicate and Fedora patches the en-us keymap for this issue.

So not a packer issue, and we can steal Fedora's patch and add it to Arch!

Edit: qemu 2.11.1-2 on Arch includes the Fedora patch and seems to behave correctly (no more >s).

@foutrelis thank you so so much for debugging this!

@foutrelis thanks again! :) I should have searched earlier for this bug.

Thanks for the work, all. Going to close this and add a note to the qemu docs

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings