- Avoid conflicts between the Host key and AltGr and verify automatic keyboard capture.
- Synchronize Num Lock with VBoxManage to prevent inverted states between host and guest.
- Align the guest keyboard map with the physical one and check the terminal emulator shortcuts.
- Improve stability with Guest Additions and Extension Pack paired to your version.
When the keyboard suddenly stops responding inside a virtual machine, the feeling is one of total lockdown: you can't log in, the mouse doesn't work, and after trying for a while, it seems that the VM freezes. This scenario is more common than it seems in VirtualBoxespecially with specific combinations of hardware, host and guest OS, and certain keyboard configurations.
In this article you will find a complete review of real causes and fixes based on cases such as a Windows 10 host with Oracle VirtualBox 6.1 and a Kali Linux guest that worked fine on the first boot but, after shutting down and restarting, Neither the keyboard nor the mouse responded, and soon the VM froze.We'll also look at the typical headache with the Ctrl key in Debian and the enigma of the backslash on German keyboards (AltGr+ß) within Linux, as well as a classic problem: the Num Lock state being out of sync between host and guest. Let's learn all about it. If your keyboard isn't working in VirtualBox, here are the steps to fix it.
First of all: understand the context and the symptoms
There are several problem profiles collected in real cases: one of them is a Windows 10 host and VirtualBox 6.1.22 r144080 with Kali Linux guest without Guest Additions or Host ExtensionsAfter importing the VM and starting it up, everything was OK; but after the first shutdown, upon restarting, the keyboard doesn't type, the mouse doesn't move, and after a few minutes, the virtual machine freezes.
In that same environment, RAM and video memory settings were changed, input options were tweaked, and USB filters were deleted and added, without success. AMD-V was enabled (if you need guidance for enable virtualization on my PC) and there was no trace of Hyper-V. In parallel, there were doubts with the Host key (the one in VirtualBox that replaces combinations like Ctrl+Alt) and with how to type the backslash \ in the Kali guest using German layout (the user tried Ctrl+Alt+ß, Host+ß and all kinds of combinations).
On another front, users with Debian Squeeze guest running on a Wheezy host reported that The Ctrl key was not working inside the guest.For example, in nano, pressing ^X would display a simple "x" on the screen. Variations such as using left or right Ctrl and changing the Host key to the right logo key, with default keyboard layouts in English (USA), were tested, but the bug persisted in certain sessions.
Check the basics: key capture, host key, and conflicts
VirtualBox has an option called “Auto capture keyboard”. If it is disabled, the keyboard may remain on the host and the pulses do not reach the guestGo to File > Preferences > Input and verify that automatic capture is enabled. Also, check if the VM window border indicates that the focus is inside.
The Host key (by default, Right Ctrl) is key. If you changed it to AltGr (Right Alt) or to a key you need within the guest (for example, to type "\" in German with AltGr+ß), you'll have problems because VirtualBox interprets that key as the Host key. Avoid configuring AltGr as a host key.Use the right Ctrl or right logo key, and make sure that VirtualBox doesn't hijack key combinations that the guest needs.
Another check that seems obvious but helps: try the Left Ctrl and right CtrlThere are documented cases where one of the two responds and the other does not, due to how the guest system maps or how a specific application (nano, X or console) is reading keyboard events.
Num Lock out of sync between host and guest
There is a historical behavior in VirtualBox whereby the Num Lock state can be "reversed" between host and guest: when it is enabled on the host, It appears as disabled in the VMand vice versa. This causes the numeric keypad to behave like cursor arrows on one side while functioning as numbers on the other.
The solution is to force VirtualBox to stop synchronizing the keyboard LEDs with the guest. On Windows, open a command prompt as administrator, navigate to the VirtualBox installation folder (usually «C:\\Program Files\\Oracle\\VirtualBox») and run the following command, adjusting the exact name of your VM:
VBoxManage setextradata "Nombre de la máquina virtual entrecomillado" GUI/HidLedsSync "0"
When this is applied, when Num Lock is turned on on your host computer, It will also be in the guestIt's a quick way to avoid constantly switching between the two systems. If you use the numpad a lot, it will save you a lot of trouble.
The backslash key in Linux with a German keyboard: AltGr, Ctrl and the Host key
In distributions like Kali with German distribution, the backslash \ is usually written with AltGr+ßIn many Linux environments, Ctrl+Alt is interpreted as equivalent to AltGr, so it also works. However, if you've assigned the host key to AltGr in VirtualBox, the combination won't reach the guest.
To fix this, check in File > Preferences > Input what your Host key is and choose one that doesn't conflict with AltGr. The default value (right Ctrl) is usually the most sensible.Next, within the guest operating system, check the keyboard layout: in Kali, you can change it from the graphical interface or with setxkbmap. For example:
setxkbmap de
If you still can't type the backslash, try the "German (nodeadkeys)" map variant in your desktop environment's keyboard options. Avoiding dead keys helps make AltGr more directAnd remember: do not use combinations with the Host key to type; the Host key is for VirtualBox shortcuts, not for the guest.
When Ctrl doesn't work in Debian or nano ignores shortcuts
The fact that in nano, when you press ^X, an "x" appears instead of closing, suggests that Ctrl is not being detected as a modifierThis could be due to an incorrect keyboard map, an X layer that does not pick up the modifier, or a conflict with the Host key.
Practical recommendations based on real cases with Debian Squeeze guest on Wheezy host: verify that the guest map is correct ("us" if your keyboard is USA) with "dpkg-reconfigure keyboard-configuration" or "localectl" on newer systems. Change the Host key to a key other than Ctrl Neither AltGr, for example, nor the right logo key. And try the shortcuts both in a pure console (TTY) and within X to narrow down the problem.
If it only fails in a specific graphical terminal, try another one (for example, replace the default terminal with xterm or gnome-terminal) to see if it's a shortcut capture issue. Some emulators intercept combinations and require disabling them in their preferences.
VirtualBox settings that affect keyboard and mouse
In the VM settings, under System > Motherboard, check the pointing device: "PS/2 Mouse", "USB Tablet" or "USB Multi-Touch Tablet". For many Linux guests, USB Tablet improves pointer integration.If you see mouse freezes, toggle between those options and check.
In System > Processor, avoid enabling more accelerations than necessary if you experience crashes after a few minutes. Even if AMD-V is enabled, You don't need to touch nesting or advanced paravirtualization. To make the keyboard work, focus on the Input section.
On USB, remove any filters you don't use. Incorrectly configured USB filters can... Capture a physical keyboard or mouse outside the hostThis leaves you without control in Windows while the VM tries to "grab" it. If you need USB 2.0/3.0 in the guest, install the Extension Pack corresponding to your exact version of VirtualBox, because without it, advanced USB support won't work properly. To review the VM configuration, use the options in the VirtualBox interface.
Guest Additions and Extension Pack: When do they make a difference?
Not having Guest Additions or Host Extensions (Extension Pack) installed does not prevent the basic keyboard from working, but Integration is greatly improved with Guest AdditionsFor Kali or Debian, install the kernel headers and compile the modules:
sudo apt update && sudo apt install -y build-essential dkms linux-headers-$(uname -r)
sudo sh /media/<usuario>/VBox_GAs_*/VBoxLinuxAdditions.run
After restarting, the integrated mouse and clipboard synchronization usually perform better. Guest Additions do not fix a mischosen Host keyHowever, they do prevent entry errors and speed up the graphics layer, which in some cases caused apparent crashes. If you need specific instructions for update VirtualBox Guest Additions Consult the relevant guide.
Regarding the Extension Pack: install it on the host only if you need it USB 2.0/3.0, VRDP or PXE for Intel. Match the version exactly (e.g., 6.1.22 r144080 with your Extension Pack 6.1.22) to avoid incompatibilities.
If everything breaks after the first restart: tips and fixes
A VM working on its first boot and then failing usually points to state changes that occur during shutdown: LED synchronization (Num Lock), key capture restoration, USB filters that activate, or a specific bug in the particular version of VirtualBox.
Effective guidelines in that scenario (Windows 10 host + Kali guest):
– Temporarily disable all USB filters and boot up. If the keyboard comes back on, you've found the culprit. and you can refine the filter later.
– Switch the pointing device between PS/2 and USB Tablet to see if the mouse stops freezing.
– Ensure automatic key capture and that the Host key is not AltGr.
– Apply the Num Lock setting with GUI/HidLedsSync «0» to prevent inverted states.
– Upgrade to the latest stable subversion of branch 6.1 (or higher) if you are on 6.1.22 r144080; Many bugs are fixed between builds..
If you suspect Hyper-V but believe it is not active, confirm in Windows with "Turn Windows features on or off" and uncheck Hyper-V, Windows Hypervisor Platform, and WSL2 if you do not need them. Hyper-V can interfere with virtualizationeven when AMD-V is active in BIOS.
Keyboard maps and layout between host and guest
It is essential that the guest's keyboard layout matches the physical layout of your keyboard. If your keyboard is German and the guest thinks it's US, The backslash won't be where you expect it.Adjust in Linux using graphical tools or commands:
sudo dpkg-reconfigure keyboard-configuration
# o
setxkbmap de
# variantes útiles
setxkbmap de nodeadkeys
In graphical environments, also check the "Dead keys" option and disable it if you frequently use shortcuts with AltGr. Proper mapping prevents 80% of accidents. with symbols such as \, @ or | that change between distributions.
VirtualBox shortcuts that may interfere

VirtualBox has its own shortcuts using the Host key, for example, to release the cursor or change screen modeIf you inadvertently overlap them with guest shortcuts, VirtualBox will "win." In Preferences > Input > Shortcuts, review and disable any shortcuts that conflict with your workflows, especially if you do a lot of programming or editing in the terminal.
A classic: if you assign Host+Del to "Insert Ctrl+Alt+Del", you might try to use similar combinations in the guest and be surprised by strange behavior. Leave only the essential active to reduce friction.
Rapid diagnosis step by step
When all else fails, apply this mini-decision diagram, which summarizes what we've seen in real-world cases and measures that worked:
– Is the VM window focused and is key capture active? If not, enable it. Without focus, the guest receives nothing..
– Is the Host key AltGr? Change it to right Ctrl or right logo key.
– Is Num Lock reversed between host and guest? Apply GUI/HidLedsSync "0".
– Are USB filters active? Deactivate them and try again.
– Is the keyboard map correct on the guest? Adjust with setxkbmap or dpkg-reconfigure.
Does it only fail in X or only in TTY? Try a different terminal or check the emulator shortcuts.
– Are you using an older version of VirtualBox? Update to the latest version for your branch.
– Do you need USB 2.0/3.0? Install the Extension Pack that corresponds to your version.
If the VM still freezes after all this, create a new VM pointing to the same virtual disk to rule out configuration corruption. Often the disk is fine and it's the .vbox file that's causing the problemTo understand how to open or repair a .vbox file Consult the relevant guide. Re-importing an appliance (OVA) is also a quick solution if that was your starting point.
What we learned from real cases
Regarding the case of Windows 10 + VirtualBox 6.1.22 + Kali: the combination of not having Guest Additions or Extension Pack, plus USB filters and doubts about the Host key, It ended in a scenario of dead keyboard and mouse After the first shutdown, setting the Host key to right Ctrl, disabling USB filters, and enabling automatic key capture restored input. Adjusting Num Lock synchronization prevented misalignment when switching between systems.
In the case of Debian Squeeze: with the default USA map and the Host key moved to the right logo key, some users could not use Ctrl in nano. while others were able to replicate Ctrl+X without issueThe difference? The context (console vs X), the terminal emulator, and the shortcut capture. Taking it to TTY and checking there helped isolate the problem from the graphics side.
And regarding the AltGr+ß issue: VirtualBox is not to blame if the guest map is incorrect or if we steal AltGr for the Host key. On Linux, AltGr is sacred to symbols like \ or | in certain distributions; reserving that key for VirtualBox is like creating a self-imposed block.
Quick FAQ
Do I need to install Guest Additions for the keyboard to work? No, the basic keyboard works without themBut the integration (mouse, screen, clipboard) improves a lot with Additions and often eliminates oddities.
Can Hyper-V break the keyboard in VirtualBox? On Windows computers, Hyper-V may interfere with virtualization In general. Disable it if you don't need it (and restart) to rule out conflicts.
Why does it only fail in nano? Because nano, the terminal, or X can be intercepting or reinterpreting modifiersTry using TTY (Ctrl+Alt+F2) to check if it's a system or graphics layer problem.
What happens to Num Lock when starting a VM? Some versions of VirtualBox They throw off the LED's state between host and guest. The GUI/HidLedsSync setting "0" leaves it under the host's control.
After trying all these avenues, the keyboard usually comes back to life by correcting three points: avoiding AltGr as a Host key, aligning the guest keyboard map with the host's physical keyboard map, and neutralizing the Num Lock desynchronization with the VBoxManage command. If you also clean USB filters, enable automatic capture, and ensure you're using compatible versions of VirtualBox and its Extension PackThe "ghost" mouse and keyboard issues disappear. And if you find yourself stuck with the Ctrl key not working in Debian or the rogue backslash in Kali with German layout, remember: try TTY, check the terminal shortcuts, and don't assign VirtualBox the key that Linux needs to type essential symbols.
Passionate about technology since he was little. I love being up to date in the sector and, above all, communicating it. That is why I have been dedicated to communication on technology and video game websites for many years. You can find me writing about Android, Windows, MacOS, iOS, Nintendo or any other related topic that comes to mind.
