Packer: Boot command over vnc not reliable

Created on 1 Jun 2015  路  6Comments  路  Source: hashicorp/packer

I'm running packer in a Debian guest VM running in vmware fusion on a mac. The vmware-iso builder is being used.
When the VM being created starts up the boot command is passed to the vm over VNC. In the packer log I can see that the correct command is being sent. In the VM itself though it seems that not all keystrokes arrive correctly. Sometimes the http url is truncated, sometimes characters are missing.
Is there perhaps a timing issue here? Is there a way to leave some delay between keystrokes that might make things more reliable?

buildevmware

Most helpful comment

Is there any way to speed up the typing on boot for VMware? It's so slow compared to Virtual Box - I have a very long boot line and it's tedious to wait for it to be all typed on VMware. It takes "forever".

All 6 comments

The problem is that the boot command is typed by entering key code into the keyboard buffer. If they are sent to fast keystrokes will be lost, if they are sent to slow characters will be repeated. Regardless of that this PR might improve the reliability, but it is very hard to verify it.

I think we need bi-directional flow. So after entered character to vnc we need to get framebufferupdate message, if we have updates - when we entered key. And try to add new key.

I had the same issue and ended up rebuilding packer with this PR:
https://github.com/mitchellh/packer/pull/1663/files

Works perfectly ever since. Simple fix.

@pmitoraj yeah something like that is what I had in mind.

@vtolstov framebufferupdate isn't really a direct response to a keyevent message, might have other unintended side effects.

@rickard-von-essen this is VNC server dependent of course and I'm not familiar with the internals of the VMware one, but perhaps leaving a small time delay (say 1/10s ;)) is sufficient to make the server process each key press/release properly. A short delay like that shouldn't cause key repetitions. It's a crude solution, but if it improves reliability it's better than nothing.

Going to mark as "fixed" (in most cases) due to #1663.

Is there any way to speed up the typing on boot for VMware? It's so slow compared to Virtual Box - I have a very long boot line and it's tedious to wait for it to be all typed on VMware. It takes "forever".

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jesse-c picture jesse-c  路  3Comments

znerd picture znerd  路  3Comments

Tensho picture Tensho  路  3Comments

wduncanfraser picture wduncanfraser  路  3Comments

mushon4 picture mushon4  路  3Comments