Keyboard and trackpad not working on Virtualbox Ubuntu VM - mac host

cn flag

The keyboard and mouse/trackpad stop working on virtualbox ubuntu vm. Im running virtualbox on a macbook pro. When I go to USB Devices settings, the "Apple Inc internal keyboard / Trackpad" appears not available and when I select to attach it, I get an error saying "Failed to attached.. it's exclusively used by the host machine".

in flag
You wouldn’t want to give the VM exclusive access to the keyboard and trackpad, otherwise you wouldn’t be able to return to the host OS until after the VM is shut down. VirtualBox generally shares the keyboard and pointing device when you’re working with the VM. Have you changed any of the settings from the VirtualBox Manager on the host?
Agustín Anastasía avatar
cn flag
Actually I have not changed any settings on Virtualbox Manager. When I run VBoxManager list usbhost, the Apple keyboard and trackpad appear "unavailable", the other devices appear "Busy".
in flag

The keyboard and trackpad will always appear as "unavailable" on an Apple device as the rest of the system really doesn't like it when these things disappear from the USB bus.

USB - Devices

Unless there is something specific that you want only the virtual machine to have access to, none of the "Apple Inc." items in the USB list need to be given to the VM. Resources are shared via the virtualisation layer, which VirtualBox takes care of.

Looking at the problem of the lack of input on the VM, it would be good to first check that the input settings have not been changed. Select the "Input" menu and confirm that "Mouse Integration" is checked:

Input - Mouse Integration

If it is not checked, then click the item. You can test its operation by clicking inside the VM to open an application or perform another pointer-based action.

For the keyboard, click "Keyboard" from the input menu item and open the "Keyboard Settings..." option. This will open a modal that sits on top of the VM:

VirtualBox - Input

Verify that "Auto Capture Keyboard" is checked.

If both the "Mouse Integration" and "Auto Capture Keyboard" settings are checked and the VM still does not accept input, then you will probably need to invest some time to track down the issue. One option would be to:

  1. Update the VirtualBox software to ensure you have the latest release
  2. Test the VM to see if the problem persists
  3. If the problem persists, create a new Ubuntu VM to see if the problem is with the first VM, or with VirtualBox itself

If the problem is found to be with the first VM, then you will probably want to boot the VM using the Ubuntu installation .iso file to begin copying any necessary files off, and migrate to a new VM image.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.