The fastest and easiest way to install Oracle VirtualBox!

I already described this method a couple times in several posts, and ** vboxlive** has its own dedicaded thread already (Running Linux live CDs in disk-less virtual machines under VirtualBox). But I think this short howto might save you (and us) some time. Unfortunately it will also reduce the amount of questions about installing VirtualBox posted in this forum … but it is the side effect of doing things straight correctly.

|
|
This thread is NOT about the best version of VirtualBox (Oracle or OSE) to use. So if you think that installing the virtualbox package from openSUSE Oss repo is the best choice for you, it’s perfectly fine. You might also be right (I don’t know). It’s just not the right thread to discuss it.|

Assuming you want or need to use Oracle VirtualBox, here’s the fastest and safest way to install and get it work.

  • It is the fastest, because all you need to do is to type 4 commands and give the root password twice.
    You don’t need to do anything else (and you should not).
  • It is the safest, because in case you don’t have the latest kernel, it will update the kernel in order to install the right kernel-devel package.
    The reason is that if you don’t run the latest kernel and don’t have the devel package already installed, the one you need for your kernel won’t be available in repo anymore. Thus, in such a case, you’ll have to update the kernel to be able to compile kernel modules. Notice that vboxlive doesn’t care and just updates the kernel. atiupgrade does it in a more clever way and let you compile modules on another but the latest kernel, provided the matching kernel-devel is already installed. Well, I’m afraid things are getting complicated here. It was supposed to be a short and simple howto. So forget about this kernel module stuff. The purpose of this method is to take you straight to the goal.
  • And finally it is also the easiest, because it will create the vboxusers group and add the current user (you) to this group.
    That’s why we don’t open a root shell (su - ) but use ‘sudo’ and finally execute the last command as normal user. Of course we could use ‘su -l’ to add the repo and install vmscripts as root. But we would have to ‘exit’ the root shell afterwards before running the last command, and it would require 6 commands instead or 4 … but, as already mentioned, it is intended to be the “fastest” method as well.

Now here’s all you have to type and all you have to know (it doesn’t mean that knowing more would hurt though):


$ sudo zypper ar  http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.2/  PTA
$ sudo zypper --gpg-auto-import-keys refresh -r PTA
$ sudo zypper -n in vmscripts
$ vboxlive --install

Here’s a screenshot of what it does on a fresh install. You can tell that it’s a fresh install because of the (non fatal) Mounting Media failed error message. It is still looking for the install DVD.

http://imageshack.us/a/img23/43/vboxlivesmall.png](http://imageshack.us/a/img805/2210/vboxlive.png)

If you originally intended to run any other Linux distro live CD in a virtual machine, you could also save time by doing it directly. In this case, you would replace the last command with this one:

$ vboxlive -o ubuntu -D

or that one

$ vboxlive -o fedora -D

or, of course, that one too:

$ vboxlive -o opensuse -D

or many other ones (the list can be displayed with vboxlive -g), and VirtualBox - if missing at this point - would just get installed automatically.

  • Option -D means that the script is going to download the iso image. You only need to use it the first time. Listing (vboxlive -G) and downloading the iso images didn’t work (from the beginning) when the firewall was on … and I just discovered why and fixed the bug (see this post: Opensuse 12.1) You must not have been very many to use this option… or you just never complain. Anyway, it is fixed.

See the vboxlive thread for more info.

This works very nicely. How about an update for 12.3 ?

I tried this with 12.3 and it works perfectly - no changes to the method or scripts, and it downloads the latest versions of software.
Thanks Please_try_again for such future proof scripts.

I have 12.3 installed. Tried this method and ran into a problem.

When I ran vboxlive --install I get the following:

mark@mark:~> vboxlive --install


 - installing VirtualBox. Please wait...
     * make is aready installed
root's password:
Repository 'PTA' is up to date.
Repository 'openSUSE BuildService - KDE:Extra' is up to date.
Repository 'openSUSE BuildService - KDE:UpdatedApps' is up to date.
Repository 'openSUSE BuildService - Games' is up to date.
Repository 'Packman Repository' is up to date.
Repository 'libdvdcss' is up to date.
Repository 'libdvdcss repository' is up to date.
Repository 'muzlocker' is up to date.
Repository 'virtualbox' is up to date.
Repository 'wine' is up to date.
All repositories have been refreshed.
Loading repository data...
Reading installed packages...
'kernel-desktop' is already installed.
Package 'kernel-desktop' is not available in your repositories. Cannot reinstall, upgrade, or downgrade.
Resolving package dependencies...


Nothing to do.
Loading repository data...
Reading installed packages...
Package 'kernel-desktop-devel' not found.
'gcc' not found in package names. Trying capabilities.
No provider of 'gcc' found.
'kernel-syms' not found in package names. Trying capabilities.
No provider of 'kernel-syms' found.
'kernel-source' not found in package names. Trying capabilities.
No provider of 'kernel-source' found.

A popup appeared saying “Currently loaded kernel version (3.7.10-1.4) doesn’t match the kernel source version(). Reboot and run vboxlive -l” (this may not be an exact quote of the popup, but the meaning and kernel versions are 100% as indicated)

I then rebooted and ran vboxlive -l and got this output.


mark@mark:~> vboxlive -l
BT5R3-KDE-64.iso                   
Sabayon_Linux_11_amd64_K.iso       
openSUSE-12.3-DVD-x86_64.iso       
sposkpat-1.05.iso                  
mark@mark:~> 

What is this telling me and how do I resolve the problems?

Thanks,

Mark

On 2013-06-02 15:56, MarkNei wrote:
> What is this telling me and how do I resolve the problems?

Questions are better asked in questions areas. For this one, the
virtualization subforum is appropriate.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)