I am running Windows inside VirtualBox on Mac OSX. However, I am frequently copying and pasting/undoing etc using keyboard shortcuts.

Because Mac is dumb and tries to be different, common shortcuts such as ctrl+c and ctrl+v are cmd+c and cmd+v on Mac. This creates a problem because I keep trying to use mac-style shortcuts in the VM, or windows-style shortcuts on the Mac (my workflow is, do ASP.NET dev in the VM, but use the Mac hosts browser).

What I would like to be able to do is make VirtualBox send "Command" key presses as "Ctrl" to the VM, so that I dont have to keep remembering which environment I am in and thinking about which key combination I need to use.

Is this possible?


Because Mac is dumb and tries to be different, common shortcuts such as ctrl+c and ctrl+v are cmd+c and cmd+v on Mac.

Macs had copy and paste before Windows. Separating control and command means that you don't need additional keybindings for interrupting a process in a shell or going a page down in emacs.

Anyway, you can do that with KeyRemap4MacBook.

You could also save something like this as private.xml:

<?xml version="1.0"?>
<autogen>--KeyToKey-- KeyCode::Z, VK_COMMAND, KeyCode::Z, VK_CONTROL</autogen>
<autogen>--KeyToKey-- KeyCode::X, VK_COMMAND, KeyCode::X, VK_CONTROL</autogen>
<autogen>--KeyToKey-- KeyCode::C, VK_COMMAND, KeyCode::C, VK_CONTROL</autogen>
<autogen>--KeyToKey-- KeyCode::V, VK_COMMAND, KeyCode::V, VK_CONTROL</autogen>
<autogen>--KeyToKey-- KeyCode::A, VK_COMMAND, KeyCode::A, VK_CONTROL</autogen>

The test folder has an XML file with all the predefined remappings.

  • 2
    Thankyou for your answer. Does this software permanently reassign Command to Control? I only want the reassign to happen while the mouse is over the VirtualBox window (I run VirtualBox in 'auto capture host keyboard' mode). – Erin Drummond Oct 14 '12 at 4:09
  • 1
    Excellent answer, It's preferable to do this on the Mac host rather than mucking w/ Windows registry settings per box. @ErinDrummond the highlighted line in the GUI states, "only in virtual machine" – Jack Frost Sep 18 '14 at 17:44
  • Very useful. I --systematically-- get command and ctrl wrong when I switch from the mac to the VM, and back. Today the soft is called Karabiner. PS: How do we convince VirtualBoxVM's developpers to include this option in their program? – Arnaud Dec 11 '15 at 10:26
  • KeyRemap4MacBook (now called Karabiner) no longer works in MacOS Sierra. Any other options to achieve the same thing? – DiegoDD Apr 11 '17 at 14:32
  • As of July 2019, @DiegoDD's comment above appears no longer valid...Karabiner installs successfully on Sierra (and Mojave) – karfus Jul 20 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.