keyboardputscancode

Discussions related to using VirtualBox on Linux hosts.
Post Reply
greenpossum
Volunteer
Posts: 98
Joined: 11. Jul 2008, 08:10

keyboardputscancode

Post 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.
greenpossum
Volunteer
Posts: 98
Joined: 11. Jul 2008, 08:10

Re: keyboardputscancode

Post 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. :(
boyd.fletcher
Posts: 3
Joined: 26. Feb 2009, 04:01

Post 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.
aaron.j.anodide
Posts: 3
Joined: 9. Dec 2009, 21:03
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 2003

Re: keyboardputscancode

Post 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>
PhoebusG
Posts: 3
Joined: 21. Feb 2020, 12:38

Re: keyboardputscancode

Post 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).
Post Reply