VirtualBox

Opened 13 years ago

Last modified 5 years ago

#7633 new enhancement

Add an example of scan codes for VBoxManage controlvm

Reported by: Paul Hoffman Owned by:
Component: documentation Version: VirtualBox 3.2.10
Keywords: vboxmanage Cc:
Guest type: other Host type: other

Description

It is not clear from the documentation how to send Ctrl-Alt-Del to a vm using 'VBoxManage controlvm'. The solution is far from obvious, but the utility is high (as witnessed by the fact that there is a command for it in the GUI console. I propose adding the following bullet to 8.11:

  • VBoxManage controlvm keyboardputscancode allows you to send keystrokes to the virtual machine. This is particularly useful for virtual machines that are running headless. The keystrokes are entered as the hex values of the scancodes. To send Ctrl-Alt-Delete, use the sequence "1d 38 53 b8 9d".

Change History (8)

comment:1 by Klaus Espenlaub, 13 years ago

I see little value in adding an incorrect sequence, your suggestion would leave a stuck "Del" key. The sequence would be "1d 38 53 d3 b8 9d". Even with the correct sequence I'm sceptical if it's the job of the user manual to provide a PC keyboard scan code reference.

comment:2 by Paul Hoffman, 13 years ago

You are probably correct that the Del is stuck, but it works fine anyway. That is, create a Ubuntu guest and give the command I proposed: the system goes through a clean reboot. It is "the job of the user manual to provide a PC keyboard scan code reference": it is the job of the manual to be useful. This is a useful, non-obvious sequence.

comment:3 by Klaus Espenlaub, 13 years ago

BTW, the reason for having a menu item for it in the GUI is very different: on Windows Ctrl-Alt-Del doesn't ever reach an application, so the only way of sending this sequence is using "other means".

comment:4 by Paul Hoffman, 13 years ago

Thus my justification of headless vms in the proposed wording. But it sounds like you really don't want this documented; maybe others do.

comment:5 by Nikolay Igotti, 13 years ago

vboxshell.py TUI has scancode table you can use, along with example of guest typing command (see typeGuest).

comment:6 by Paul Hoffman, 13 years ago

Maybe adding a mention of vboxshell.py to the manual would be good too!

comment:7 by matti_paksula, 5 years ago

Thanks to @klaus saying "I see little value" - he helped me to understand my problem 8 years later. Would have been great to see this in the docs, because now only resources are things like https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html

So if anybody else sees this:

"1d 38 53 d3 b8 9d" means "control alt del del alt control" and the release keycodes are calculated like this: keycode_down + 0x80 (128) = keycode_release

in reply to:  7 comment:8 by Socratis, 5 years ago

Replying to matti_paksula:

"1d 38 53 d3 b8 9d" means "control alt del del alt control" and the release keycodes are calculated like this: keycode_down + 0x80 (128) = keycode_release

Not to be too pedantic, but in a sense what you're describing is:

0x1d       0x38          0x53            0x53+0x80=0xd3     0x38+0x80=0xb8   0x1d+0x80=0x9d
Ctrl_down  LeftAlt_down  KeypadDel_down  KeypadDel_release  LeftAlt_release  Ctrl_release

Just to make it even more clearer for others that may stumble upon the ticket, because it took me quite some time myself to figure out what the "KeyRelease" does, and why it's actually as important as the "KeyPress"... ;)

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use