Saturday, April 25, 2009

VirtualBox 2.2.0 Bug: HostKey Can't Be Changed

I recently upgraded my VirtualBox installation to the latest & greatest version 2.2.0, on my Vista Business notebook, just to find that NAT and bridged-networking wouldn't work in my Windows XP Professional guest. Research revealed that this problem could be fixed simply by re-running the installation and choosing "Repair." That's precisely what I did and that fixed the issue, however, only partially. Now I could browse the Internet in my guest OS but I couldn't access any resources on my office's network (my host connects to the office via Cisco VPN). So this time around, I uninstalled VirtualBox, restarted my notebook, and installed VirtualBox 2.2.0 afresh. This resolved all networking-related issues. However, now it wouldn't let me change the HostKey from Right Ctrl to Right Alt, or any other for that matter. After a bit of Googling, I landed at a page describing this was a bug in the newest version (the bug's been fixed and the fix will be available in the upcoming release). Crap! Because I couldn't live with Right Ctrl as my HostKey, I had to figure out a way to change it to Right Alt. Here's how you do it without having to hand-edit any configuration files. Perhaps an easy way of changing the HostKey until the fix is released is to use VBoxManage with the setextradata switch. So if you wanted to change the HostKey to the Right Alt key (numeric code 165), you would execute the following command: VBoxManage.exe setextradata global GUI/Input/HostKey 165 I've posted this solution at the bug page also. You could see details on the bug and this work-around (and others) here.

6 comments:

mattoc said...

Thanks for this, it's a lifesaver! Right Ctrl is especially useful in Dvorak layout when using Ctrl+C.

William Birtchnell said...

Problem solved, thank you so much

Jan said...

I am glad it helped!

Ahmad said...

Hi,
Where can I find the key codes?
I want to set the host key to "Left Ctrl", but does not have any idea on which number I should set to.

Jan said...

A complete list of key codes could be found at MSDN here: http://msdn.microsoft.com/en-us/library/system.windows.forms.keys(vs.71).aspx

Jan said...

Version 2.2.0 of VirtualBox has been released with many bug fixes. I specially hated the following bugs (fixed in this release):

•GUI: properly show the detailed settings dialog of NAT networks (bug #3702)
•GUI: HostKey could not be changed (2.2.0 regression, bug #3689)
•GUI: fixed crash when selecting a shared folder path (Windows hosts only; bugs #3694, #3751, #3756)
VBoxManage modifyhd --compact: implemented again for VDI files, and now supports relative paths (bug #2180, #2833)
•NAT: on some Windows host, the guest didn’t receive a DHCP lease (bug #3655)
•Windows installer: fixed several install and uninstall issues (bugs #3659, #3686, #1730, #3711, #3373, #3382, #3701, #3685, #3710)

For a complete list of items that were fixed and/or added, visit the VirtualBox Changelog page: http://www.virtualbox.org/wiki/Changelog