How to install VirtualBox on Debian Linux


The following article will describe a simple procedure on how to install Virtual box on Debian Linux.

Operating System and Software Versions

  • Operating System: – Debian 9 Stretch
  • Software: – VirtualBox 5.1


Privileged access to your Debian system will be required.




  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user


Add VirtualBox Repository

In the first step add VirtualBox repository to your local /etc/apt/sources.list file:

# echo "deb stretch contrib" >> /etc/apt/sources.list

Add VirtualBox repository public key:

# wget -q -O- | apt-key add

Update local repository package list:

# apt-get update

Install VirtualBox

List all available VirtualBox version:

$ apt-cache search virtualbox | grep ^virtualbox
virtualbox-5.0 - Oracle VM VirtualBox
virtualbox-5.1 - Oracle VM VirtualBox

Install desired VirtualBox version eg.:

# apt-get install virtualbox-5.1

All done.