sudo apt install gnupg2
sudo wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
sudo wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bullseye contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt update
You can use the apt-cache search VirtualBox command to search which package version is available to install.
4. Now, to install VirtualBox on Debian, run the following commands.
sudo apt install linux-headers-$(uname -r) dkms
sudo apt install virtualbox-6.1
Once installed you can launch virtualbox from the terminal, type:
virtualbox
Reference: