Install VirtualBox in Debian Stretch

VirtualBox is a free and open-source virtualization product developed by Oracle Corporation. It was first released on January 17, 2007. We may have to use multiple operating systems. And, certainly one may not want to make frequent changes to his/her host machine. The best way is to create a virtual machine and install an operating system in it. That way, if we don’t require an operating system then it can easily be removed by removing the associated virtual machine. Apart from that, we can use VirtualBox extension packs for extra functionality like for USB devices, Remote desktop protocol support, Webcam support, PXE boot ROM etc. Besides, VirtualBox Guest Additions are also available. In this article, we cover how to install VirtualBox in Debian Stretch.

Benefits of using a Virtual Machine

  1. For testing purposes: If we are testing a product on our main Operating system. And, if something goes wrong then it affects our host Operating system. Or, we can just use a virtual machine. Use snapshots to restore it back.
  2. Run Multiple Operating Systems: Our host machine is capable to run only one operating system at a time. But, with virtual machines there are no such limits as long as our hardware supports that.
  3. Reduce costs on Infrastructure: If we don’t utilize virtual machines to run multiple operating systems. Then, one has to buy an additional hardware. As already covered, host machine can run only one operating system at a time.

Install VirtualBox in Debian Stretch

Note: Following operations require superuser privileges. Contact your System Administrator if you don’t understand what you’re executing.

At the time of writing, we can’t use latest .deb package from official website of VirtualBox – In place of that, use the version that supports all Linux distributions. Its available there on the page we mentioned – All Distributions. The package file we got was –

Next, just head to the directory where you have downloaded the package through cd command-line utility –

# cd /path/to/package

And, issue the following command to install VirtualBox –

# sh

We encountered an error. So, we have to install following packages as well –

# apt install linux-headers-amd64 linux-headers-4.9.0-19-amd64

Lastly, run –

# /sbin/vboxconfig

Reboot your system.

In conclusion, we have covered here how to install VirtualBox in Debian Stretch.

Similar Posts