Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrl-tab not sent during boot_command #4290

Closed
aairey opened this issue Dec 16, 2016 · 21 comments
Closed

ctrl-tab not sent during boot_command #4290

aairey opened this issue Dec 16, 2016 · 21 comments

Comments

@aairey
Copy link

aairey commented Dec 16, 2016

I am trying to send a ctrl-tab as a boot_command, but cannot get it to work.

I opened an issue about this before (#3028) and thought it would be fixed after PR #3767.
However I don't think the correct scancode is sent.

  "boot_command": "<wait10><leftCtrlOn><tab><leftCtrlOff><tab><tab><tab><tab><tab><enter>"

I need it to ctrl-tab out of a text field in an install wizard.

IMHO, the scancode that should be sent is 94, from this scancodes list.
Maybe an extra 'key' will have to be created in packer that just sends this scancode.
Actually it would be nice to send an arbitrary scancode, if at all possible.

More details in this gist.

Environment:

  • Fedora 25
  • packer v0.12.0
  • builder: virtualbox-iso
@rickard-von-essen
Copy link
Collaborator

Please supply a full template and log. Also it would be great if you can retry with 0.12.1, released yesterday.


Please supply the information requested in the issue template:

  • Packer version (packer version)
  • Host platform (uname -a etc.)
  • 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.

@aairey
Copy link
Author

aairey commented Dec 16, 2016

Updated the gist.

Platform details:

  • packer version
    Packer v0.12.1
  • uname -a
    Linux hostname.domain 4.8.13-300.fc25.x86_64 #1 SMP Fri Dec 9 14:52:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@mwhooker
Copy link
Contributor

interesting. the proper scan code list for virtualbox is at http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html according to the source code https://github.com/mitchellh/packer/blob/master/builder/virtualbox/common/step_type_boot_command.go#L109

and to me it looks like it's correct. I verified on ubuntu with showkey.

I wonder if adding a <wait> in between key ctrlOn and tab would help.

@aairey
Copy link
Author

aairey commented Dec 17, 2016 via email

@aairey
Copy link
Author

aairey commented Dec 20, 2016

@mwhooker the scancodes that are passed are indeed correct but it seems the OS does not react to 1d 0f, but it should react to it's designated scancode 94.

Not 100% sure about this though, it should be tested.

@mwhooker
Copy link
Contributor

mwhooker commented Dec 21, 2016

merged in something with might fix this if you care to try (#4247)

Otherwise I think the best next step is to test your theory and add a new special like

special["<ctrlTab>"] = []string{"94"}

in builder/virtualbox/common/step_type_boot_command.go

@aairey
Copy link
Author

aairey commented Dec 21, 2016

@mwhooker just tested with latest Go code and am now getting the below error.

Command used:
PACKER_LOG=1 ~/go/bin/packer build porteus-kiosk.json

boot_command:

...
                 "<wait10>",
                 "<leftCtrlOn><tab><leftCtrlOff>",
                 "<tab><tab><tab><tab><enter>",
...

log output:

2016/12/21 12:14:03 packer: 2016/12/21 12:14:03 Executing VBoxManage: []string{"controlvm", "packer-virtualbox-iso-1482318789", "keyboardputscancode", "0e", "8e", "23", "a3", "14", "94", "14", "94", "19", "99", "2a", "27", "aa", "a7", "35", "b5", "35", "b5", "02", "82", "0b", "8b", "34", "b4", "0b", "8b", "34", "b4", "03", "83", "34", "b4", "03", "83", "2a", "27", "aa", "a7", "09", "89", "03", "83", "04", "84", "0a", "8a", "35", "b5", "19", "99", "18", "98", "13", "93", "14", "94", "12", "92", "16", "96", "1f", "9f", "0c", "8c", "25", "a5", "17", "97", "18", "98", "1f", "9f", "25", "a5", "34", "b4", "2e", "ae", "21", "a1", "22", "a2", "1c", "9c"}
2016/12/21 12:14:03 packer: 2016/12/21 12:14:03 stdout:
2016/12/21 12:14:03 packer: 2016/12/21 12:14:03 stderr: VBoxManage: error: Could not send all scan codes to the virtual keyboard (VERR_PDM_NO_QUEUE_ITEMS)
2016/12/21 12:14:03 packer: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component KeyboardWrap, interface IKeyboard, callee nsISupports
2016/12/21 12:14:03 packer: VBoxManage: error: Context: "PutScancodes(ComSafeArrayAsInParam(saScancodes), &codesStored)" at line 345 of file VBoxManageControlVM.cpp
2016/12/21 12:14:03 ui error: ==> virtualbox-iso: Error sending boot command: VBoxManage error: VBoxManage: error: Could not send all scan codes to the virtual keyboard (VERR_PDM_NO_QUEUE_ITEMS)
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component KeyboardWrap, interface IKeyboard, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "PutScancodes(ComSafeArrayAsInParam(saScancodes), &codesStored)" at line 345 of file VBoxManageControlVM.cpp
==> virtualbox-iso: Error sending boot command: VBoxManage error: VBoxManage: error: Could not send all scan codes to the virtual keyboard (VERR_PDM_NO_QUEUE_ITEMS)
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component KeyboardWrap, interface IKeyboard, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "PutScancodes(ComSafeArrayAsInParam(saScancodes), &codesStored)" at line 345 of file VBoxManageControlVM.cpp
2016/12/21 12:14:03 packer: 2016/12/21 12:14:03 Executing VBoxManage: []string{"controlvm", "packer-virtualbox-iso-1482318789", "poweroff"}

@rickard-von-essen
Copy link
Collaborator

What's your version of VirtualBox?

@DanHam
Copy link
Contributor

DanHam commented Dec 21, 2016

@aairey @rickard-von-essen I'm seeing this error too. I've tried installing various versions of Virtualbox but it makes no difference.

Virtualbox versions:
5.0.26
5.0.30
5.1.12

@DanHam
Copy link
Contributor

DanHam commented Dec 21, 2016

My boot command looks like this:

      ...
      "boot_command": [
        "<tab> <wait>",
        "text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg <wait>",
        "<enter> <wait>"
      ],
      ...

Looking at the console it seems to be able to type the boot command up to text ks=http:// and then errors

@rickard-von-essen
Copy link
Collaborator

@DanHam That seems like a different issue, as I understand it this is specific for <leftCtrlOn><tab>.

@DanHam
Copy link
Contributor

DanHam commented Dec 21, 2016

@rickard-von-essen Sorry. To clarify, I'm seeing the same error as @aairey with the latest version of the Go code. In other words that error appears to be a general problem with any boot command rather than being specific to a boot command that includes <leftCtrlOn><tab>

From my log output:

2016/12/21 13:22:27 packer: 2016/12/21 13:22:27 Executing VBoxManage: []string{"controlvm", "packer-virtualbox-iso-1482326512", "keyboardputscancode", "14", "94", "12", "92", "2d", "ad", "14", "94", "39", "b9", "25", "a5", "1f", "9f", "0d", "8d", "23", "a3", "14", "94", "14", "94", "19", "99", "2a", "27", "aa", "a7", "35", "b5", "35", "b5", "02", "82", "0b", "8b", "34", "b4", "0b", "8b", "34", "b4", "03", "83", "34", "b4", "03", "83", "2a", "27", "aa", "a7", "09", "89", "08", "88", "02", "82", "05", "85", "35", "b5", "25", "a5", "1f", "9f", "34", "b4", "2e", "ae", "21", "a1", "22", "a2", "39", "b9"}
2016/12/21 13:22:27 packer: 2016/12/21 13:22:27 stdout:
2016/12/21 13:22:27 packer: 2016/12/21 13:22:27 stderr: VBoxManage: error: Could not send all scan codes to the virtual keyboard (VERR_PDM_NO_QUEUE_ITEMS)
2016/12/21 13:22:27 packer: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component KeyboardWrap, interface IKeyboard, callee nsISupports
2016/12/21 13:22:27 packer: VBoxManage: error: Context: "PutScancodes(ComSafeArrayAsInParam(saScancodes), &codesStored)" at line 345 of file VBoxManageControlVM.cpp
2016/12/21 13:22:27 ui error: ==> virtualbox-iso: Error sending boot command: VBoxManage error: VBoxManage: error: Could not send all scan codes to the virtual keyboard (VERR_PDM_NO_QUEUE_ITEMS)
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component KeyboardWrap, interface IKeyboard, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "PutScancodes(ComSafeArrayAsInParam(saScancodes), &codesStored)" at line 345 of file VBoxManageControlVM.cpp
==> virtualbox-iso: Error sending boot command: VBoxManage error: VBoxManage: error: Could not send all scan codes to the virtual keyboard (VERR_PDM_NO_QUEUE_ITEMS)
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component KeyboardWrap, interface IKeyboard, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "PutScancodes(ComSafeArrayAsInParam(saScancodes), &codesStored)" at line 345 of file VBoxManageControlVM.cpp
2016/12/21 13:22:27 packer: 2016/12/21 13:22:27 Executing VBoxManage: []string{"controlvm", "packer-virtualbox-iso-1482326512", "poweroff"}

Clearly my boot command is different to @aairey 's but I'm seeing the same error and have seen it with the Virtualbox versions mentioned above

@aairey
Copy link
Author

aairey commented Dec 21, 2016

@DanHam Yes it is a different issue that I am now stumbling upon and that you are getting.
It is most probably related to the code in PR #4305

@rickard-von-essen I'm on virtualbox 5.1.10 r112026

@DanHam
Copy link
Contributor

DanHam commented Dec 21, 2016

@aairey Right. That was my suspicion too. It looks as though I should have opened a new issue... I had (incorrectly?) assumed those changes were made to try and fix the problem you were having.

@DanHam
Copy link
Contributor

DanHam commented Dec 21, 2016

@aairey @rickard-von-essen I've just reverted the changes made to builder/virtualbox/common/step_type_boot_command.go in #4305 and tested successfully. So there is some issue with the new code that PR introduced.

These changes are very recent - is it possible work is still in progress?

@rickard-von-essen
Copy link
Collaborator

@DanHam Can you open a new issue.

@DanHam
Copy link
Contributor

DanHam commented Dec 21, 2016

@rickard-von-essen Done. Please feel free to delete my comments in this issue if it helps. @aairey Apologies if I've muddied the waters...

@aairey
Copy link
Author

aairey commented Jan 10, 2017

So, any new code I can test? I see #4305 was reverted by #4311.

@mwhooker
Copy link
Contributor

I can't really debug this kiosk product.

If you want help it would be easier if I could have the minimum json to reproduce, a clear explanation of what the expected behavior is and what the actual behavior is, and a way to debug.

according to the faq, a number of hoops must be jumped through to get to the terminal: http://porteus-kiosk.org/faq.html

If you can provide a json that allows me to see the error and step into the terminal so I can investigate, I might be able to provide more help.

I ran the provided json (however the given version of the iso doesn't seem to exist any more), and as far as I could tell it worked, so I need more info about where it's breaking

@aairey
Copy link
Author

aairey commented Jan 12, 2017 via email

@aairey
Copy link
Author

aairey commented Jan 13, 2017

It seems with the latest version, it is working as intended.

The keycodes are passed along using <leftCtrlOn><tab><leftCtrlOff> are now recognised.
Seems that the OS did not support it correctly before.

@aairey aairey closed this as completed Jan 13, 2017
@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants