Ubuntu – How to install VirtualBox from command line

command linesoftware installationvirtualbox

I am a newbie. For some reasons, I need to install Virtualbox. I see that I can easily install it using the Software Center, but I trust most the apt-get install way, because I find it safer, less buggy, and it helps me accommodate more with the Terminal.

So, my question is the following: is there a way to install VirtualBox using the command line? I would prefer something easy, like apt-get install not unzipping, archiving, etc, because I still don't know how to do these in the Terminal.

Best Answer

Open a terminal and execute:

sudo apt-get install virtualbox 

which should work.

Once you have installed it you probably want to install guest additions in the guest OS.

Also you probably want the extension pack which you can get from here:

https://www.virtualbox.org/wiki/Downloads

Make sure you get the correct version.

As of Xenial 16.04, you can also get the extension pack from the Canonical repositories. Go to the terminal and execute:

sudo apt install virtualbox-ext-pack 

Therefore, as of Xenial 16.04, you should be able to get virtualbox and the extension pack by typing the following:

sudo apt install virtualbox virtualbox-ext-pack 

Following the instructions on your screen.

To install the user interface to manage your virtual boxes use this command

sudo apt install virtualbox-qt
Related Question