Page 1 of 1
keyboardputscancode
Posted: 28. Jul 2008, 17:28
by greenpossum
The PDF manual for the Sun 1.6.2 release refers to a VBoxManage subcommand called keyboardputscancode. However it only appears once in the manual, there is no further explanation.
Does anybody know how to use this subcommand? What key codes would one use to send Ctrl-Alt-Del to the guest OS? Is this the right way to shutdown a guest OS, or is there another way? I only see VBoxManage actions for reset, pause, etc but no shutdown.
Re: keyboardputscancode
Posted: 29. Jul 2008, 07:05
by greenpossum
greenpossum wrote:Does anybody know how to use this subcommand? What key codes would one use to send Ctrl-Alt-Del to the guest OS? Is this the right way to shutdown a guest OS, or is there another way? I only see VBoxManage actions for reset, pause, etc but no shutdown.
Ok, I did some experiments and it's really quite simple. The scancodes are those generated by the PC-AT keyboard, which are documented here, among other places.
http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html
So to send Ctrl-Alt-Del to the VM, just do:
Code: Select all
VBoxManage controlvm VMName keyboardputscancode 1d 38 53
substituting the name of your VM for VMName.
Now I have to figure out how to stop the machine from restarting after shutdown.

Posted: 26. Feb 2009, 04:12
by boyd.fletcher
it would be great if we could do keyboard shortcuts for the scancodes. having to switch to another window is a pain-in-the-butt.
Re: keyboardputscancode
Posted: 9. Dec 2009, 21:18
by aaron.j.anodide
I found this post helpful - thank you.
In my case I am using vboxheadless with windows 2003 and I found that I also had to add release codes in order to be able to enter my username and password.
so I ended up with:
C:\Users\aaron>VBoxManage controlvm s03-da3-vss-iis-sql-smsee-eneoffice keyboard
putscancode 1d 38 53
VirtualBox Command Line Management Interface Version 3.1.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Scancode[0]: 0x1D
Scancode[1]: 0x38
Scancode[2]: 0x53
C:\Users\aaron>VBoxManage controlvm s03-da3-vss-iis-sql-smsee-eneoffice keyboard
putscancode b8 9d
VirtualBox Command Line Management Interface Version 3.1.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Scancode[0]: 0xB8
Scancode[1]: 0x9D
C:\Users\aaron>
Re: keyboardputscancode
Posted: 21. Feb 2020, 13:52
by PhoebusG
Used this to calculate most scan codes (those that are addition, not sure of an OR calculator out there):
gigacalculator dot com/calculators/hexadecimal-calculator dot php
Replace dots with actual dots/remove spaces. Since I'm a newbie on the forum I have to do this (spam protection).