Installing Virtual Machine Software on Debian Linux
VirtualBox
VirtualBox is relatively simple to install, and it is open-source and free, consuming fewer system resources.
Install the Latest Version of Kernel Headers/Kernel Images
To avoid system issues due to an outdated kernel version, we need to avoid using the following common method:
sudo apt-get install linux-headers-`uname -r`
Instead, use the following commands:
sudo apt update
sudo apt-cache search linux-image
sudo apt-get install linux-headers-xxx linux-image-xxx
# replace xxx with the version number and system architecture from the above commands
init 6 # reboot after installation

apt Install VirtualBox
apt-get install virtualbox virtualbox-guest-additions-iso
VMware Workstation
Compared to VBox, VMware is more cumbersome to set up.
But I have no choice… I have more than 10 VMware virtual machines = =
Ahh.. Just felt too lazy to convert al of them
Install the Latest Version of Kernel Headers/Kernel Images
The first step is the same as installing VBox.
sudo apt update
sudo apt-cache search linux-image
sudo apt-get install linux-headers-xxx linux-image-xxx
# replace xxx with the version number and system architecture from the above commands
init 6 # reboot after installation

Install Various Compilers
sudo apt-get install build-essential

Install VMware Workstation
Download the installer from the official website.
Give execute permission:
chmod x VMware-Workstation-Full-version-number.bundle
# TIP: You can use Tab to auto-complete long file names
Run:
sudo ./VMware-Workstation-Full-version-number.bundle
To run the application, just type
vmwarein the terminal.
Troubleshooting
If everything goes smoothly, you can follow the prompts to finish this happy installation process.
However, I encountered many more strange issues.

VMware had problems compiling and installing the vmmom and vmnet modules. After trying various solutions, I finally decided to manually compile and install the two modules.
Here are the specific solutions. You can refer to this official forum post.
First, download the module’s source code.
Since
git clonedidn’t work for some reason, we choose to download the zip file.

After extracting the source code, navigate to the source code directory:
unzip vmware-host-modules-workstation-16.2.1.zip
cd vmware-host-modules-workstation-16.2.1
Compile and install:
make
sudo make install
Restart the VMware service:
sudo systemctl restart vmware

After completing these steps, you should be able to run VMware Workstation normally:
vmware

References
English translations by GPT-4