Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

OK, I a 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 blahblah" 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 Virtual box using a command line? I would prefer something easy, like "apt-get install etc" not unzipping, archiving, etc, because this kind of things I still don't know how to do from inside the Terminal.

Thank you in advance for your help!

share|improve this question
2  
For the latest Oracle version 4.3 also see: askubuntu.com/questions/41478/… which includes CLI instructions. Note that there is no repository for 13.10 yet but the 13.04 version should work too. –  Takkat Oct 28 '13 at 11:57
    
@Takkat - For now, is no problem for me if there is no repository for 13.04 as I don't run the latest version. :-) But it is good that you mentioned it. It might help other users. –  Cristiana Nicolae Oct 28 '13 at 13:31

3 Answers 3

up vote 13 down vote accepted

Open a terminal and

sudo apt-get install virtualbox 

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.

share|improve this answer
    
@ Warren Hill - Thanks a lot! To be frank, I have used the easier path - just sudo apt-get install virtualbox - without looking for the correct version. Till now, it works fine. But next time when I will need to install it, I'll be wiser and I'll follow your advice. :-) –  Cristiana Nicolae Oct 28 '13 at 14:16

You can use

apt-cache search virtualbox

to search for packages related to "virtualbox".

Among others this finds a package virtualbox. Use

apt-cache show virtualbox

to get more information about that package.

As the description sounds like what you want use

sudo apt-get install virtualbox

to install the package.

share|improve this answer

If you want to have a latest version of VirtualBox, check this: https://www.virtualbox.org/wiki/Linux_Downloads

Add one of the following lines according to your distribution to your /etc/apt/sources.list:

deb http://download.virtualbox.org/virtualbox/debian trusty contrib
deb http://download.virtualbox.org/virtualbox/debian saucy contrib
deb http://download.virtualbox.org/virtualbox/debian raring contrib
deb http://download.virtualbox.org/virtualbox/debian quantal contrib
deb http://download.virtualbox.org/virtualbox/debian precise contrib
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free

Add secure key:

wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

Install VirtualBox:

sudo apt-get update
sudo apt-get install virtualbox-4.3
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.