At first, I thought it was a problem in the guest, and I came over to this:
virtualbox.org • View topic - Keyboard debounce issue on Windows 10
https://forums.virtualbox.org/viewtopic.php?t=93272
Then, I realized that the Guest Additions package was not installed. Unlike in previous versions, the package is not automatically installed after inserting the CD. I successfully installed it with the following steps:
- Open "Terminal" inside the guest
- Update the system
$ sudo apt update
$ sudo apt -y upgrade
- Install the compiler and toolchains
$ sudo apt -y install build-essential
- When the guest OS is focused, run this from the VirtualBox menu:
Devices > Insert Guest Additions CD image...
- When the CD icon appears on the left hand side, click on it to mount it.
- Click the "Run Software" button at the top right corner of the Files window. If it does not work, run it from the "Terminal" inside the guest:
$ /media/asukakenji/VBox_GAs_6.1.34/autorun.sh
(Note that "asukakenji" is my username, and "6.1.34" is the version of VirtualBox I am using. Please change them to match your environment.)
- In previous versions, the kernel module was already installed after the steps above. But the following step is required in the current version:
$ sudo /sbin/rcvboxadd quicksetup all
- Reboot the VM to load the kernel modules:
$ sudo reboot
- Check whether the kernel modules were installed properly:
$ sudo /sbin/rcvboxadd status
The VirtualBox Additions are currently running.
There was some improvements, but the VM was still running slowly. Later, I found a solution for Big Sur (macOS 11):
VirtualBox running slow and lag on macOS, MacBook Pro - Mkyong.com
https://mkyong.com/mac/virtualbox-running-slow-and-lag-on-macos-macbook-pro/
When I tried to apply the same solution, I found that the "Open in Low Resolution" functionality was already removed in Monterey (macOS 12). Then, I found this post and applied the solution from @MJP_Italia:
Mac OS Monterey -- Where did low resoluti… - Apple Community
I successfully applied the solution with the following steps:
- Shutdown the guest VM
- Quit VirtualBox
- Open "Terminal.app" on the host and run the following commands:
% cd /Applications/VirtualBox.app/Contents/Resources
% cd VirtualBoxVM.app/Contents
% sudo -e Info.plist
Find the line:
<key>NSHighResolutionCapable</key> <true/>
and modify it to:
<key>NSHighResolutionCapable</key> <false/>
- Save the file by pressing control-o (English letter O), and quit the editor by pressing control-x
The VM now runs at normal speed! Yay!