• Install the Sun/Oracle VirtualBox in openSUSE 11.4, 12.x or Tumbleweed (most recently tested in 12.3)

    Update 4 April 2013 Tested & working in openSUSE 12.3

    Introduction You can install the fully open source version or the Sun/Oracle version. The latter (Sun/Oracle) is significantly better IMHO. I only talk about the Sun/Oracle version here.

    Install the Oracle VirtualBox RPM Add this repo, it contains the Oracle VirtualBox RPM and it will supply updates over time. It is currently the correct repo for openSUSE 11.4, 12.1, 12,2, 12.3 and Tumbleweed
    Code:
    Oracle VirtualBox openSUSE        http://download.virtualbox.org/virtualbox/rpm/opensuse/11.4/
    Important, read carefully: You will have a series of possible RPMs available in the package management GUI in Yast. Be very sure to install only the Oracle VirtualBox RPM, not the oss virtualbox RPM. GoTo Yast --> Software --> Software management and select the Oracle RPM. If dependency linkages attempt to install additional packages beginning virtualbox-guest or virtualbox-host kernel modules, then you have made a mistake. Install only the single RPM "VirtualBox". Make sure you choose the latest version in the repo.

    Additional RPMs You will also need these RPMs: kernel-devel, gcc, make. Install them in yast or run this zypper command (as root)
    Code:
    zypper in gcc make kernel-devel
    Add your username to the vboxusers group VirtualBox permissions will not work properly until you do this. GoTo Yast --> Security and Users --> User and group management. Highlight and Edit you username. Select the Details tab and tick the box to add yourself to "vboxusers". Then reboot to activate the changes.

    Next: the Extension Pack This pack provides additiopnal functionality like USB and RDP support. GoTo the VirtualBox dot org download site https://www.virtualbox.org/wiki/Downloads and click the link for the Extension Pack. NB be sure to select the extension pack with the same version as your installed version of VirtualBox! Download the pack, a file with a name like Oracle_VM_VirtualBox_Extension_Pack-4.0.14-74382.vbox-extpack. Download the pack, then browse to it and click it with the mouse. That will cause it to be installed (provided the VirtualBox RPM has been installed first).

    Each time you upgrade the VirtualBox RPM, you will have to go back to the Extension Pack download page and acquire and install the new Extension Pack to match the version number of the upgraded RPM.

    Where's the GUI? In KDE GoTo Kicker --> Applications --> System --> Virtual Machine (Oracle VM VirtualBox).

    After a Kernel Upgrade in the openSUSE Host This is arguably a part of the installation of VirtualBox. When you have a kernel upgrade, after you reboot, you must run this command as root to recompile the kernel modules:
    Code:
    /etc/init.d/vboxdrv setup
    If USB support fails: If the Guest VM does not detect USB devices, or if they are detected but "grayed" out in the menu bar, check that you added your username to the vboxusers group. Check that the file xx-vboxdrv.rules exists in the directory /etc/udev/rules.d/

    That's all folks. I only wanted to talk about the installation, which can be a bit tricky in the detail.

    [PS: Tumbleweed only: if you're a Tumbleweeder, you might occasionally install an upgrade of the VirtualBox RPM with "zypper dup". Just check that the earlier version of the RPM has uninstalled. Run "rpm -qa | grep VirtualBox" and make sure the earlier one has gone.]

    ...
    Comments 22 Comments
    1. jdmcdaniel3's Avatar
      jdmcdaniel3 -
      If you would like to have your kernel modules automatically installed for you. Have a look at the following blog.

      VirtualBox Automatic Recompile of kernel modules after a Kernel Update or Replacement - Blogs - openSUSE Forums

      And as always, great article swerdna!

    1. jetchisel's Avatar
      jetchisel -
      This also explain some a bit about the installation.

      Jetchisel's CyberCabin: VirtualBox on openSuSE

      As now 12.1 repo is not up since the package you will install for 12.1 the 11.4 package.
    1. swerdna's Avatar
      swerdna -
      Quote Originally Posted by jetchisel View Post
      This also explain some a bit about the installation.

      Jetchisel's CyberCabin: VirtualBox on openSuSE

      As now 12.1 repo is not up since the package you will install for 12.1 the 11.4 package.
      For the time being it's the same repo, same for 11.4 and 12.1. Don't be confused, just use the address I put there, use it for 11.4 and 12.1, like I said.
    1. jetchisel's Avatar
      jetchisel -
      Quote Originally Posted by swerdna View Post
      For the time being it's the same repo, same for 11.4 and 12.1. Don't be confused, just use the address I put there, use it for 11.4 and 12.1, like I said.

      I agree with you about that package and repo is the same. In my blog it explain howto add the repo via zypper and since the 12.1 repo is still not up there might be a confusion to some users thats all. So as you said, "folks dont be confused the 11.4 package works for 12.1." Maybe the next major Vbox release they will put the repo up well all depends on what Oracle will do
    1. swerdna's Avatar
      swerdna -
      Quote Originally Posted by jdmcdaniel3 View Post
      If you would like to have your kernel modules automatically installed for you. Have a look at the following blog.

      VirtualBox Automatic Recompile of kernel modules after a Kernel Update or Replacement - Blogs - openSUSE Forums

      And as always, great article swerdna!

      James, thank you for that interesting comment. Users may choose to go to those additional lengths, but just so the readers know: folks, simplicity is a good thing and you can stick with the simple tactics that I have outlined here. No need to go installing additional complex scripts.
    1. wrbbt's Avatar
      wrbbt -
      As always, very good and useful article.
      Thanks.
    1. Ebkr's Avatar
      Ebkr -
      Hello, swerdna,
      it was quite simple to install win7 into VB on o.S.11.4.
      Using ssh for data exchange, by adding a small FAT32 partition ( in my case <E> )to win7 data exchange is working into win7 partition <E>,from there to win7 <C>.
      EK
    1. swerdna's Avatar
      swerdna -
      Quote Originally Posted by Ebkr View Post
      Hello, swerdna,
      it was quite simple to install win7 into VB on o.S.11.4.
      Using ssh for data exchange, by adding a small FAT32 partition ( in my case <E> )to win7 data exchange is working into win7 partition <E>,from there to win7 <C>.
      EK
      Nice to see.....
    1. rensg's Avatar
      rensg -
      hmm, I do not quite understand what you mean by this:
      "The latter (Sun/Oracle) is significantly better IMHO."

      the base code is the same, and licensed under GPLV2 so how can that be ?
      (as you can read here ) https://www.virtualbox.org/wiki/Downloads

      It is the extentions that are under a closed license, but you do not have to use them unless you specifically need one of the following:
      - have usb 2.0 /ehci support ( plain usb 1.0 is supported without this)
      - have pxe boot
      - have remote console on the virtual machine, so you can see and interact with the boot-process when the OS doesn't have a remote prompt or desktop yet
    1. jdmcdaniel3's Avatar
      jdmcdaniel3 -
      Quote Originally Posted by rensg View Post
      hmm, I do not quite understand what you mean by this:
      "The latter (Sun/Oracle) is significantly better IMHO."

      the base code is the same, and licensed under GPLV2 so how can that be ?
      (as you can read here ) https://www.virtualbox.org/wiki/Downloads

      It is the extentions that are under a closed license, but you do not have to use them unless you specifically need one of the following:
      - have usb 2.0 /ehci support ( plain usb 1.0 is supported without this)
      - have pxe boot
      - have remote console on the virtual machine, so you can see and interact with the boot-process when the OS doesn't have a remote prompt or desktop yet
      I think the USB 2.0 support is the big one which causes many to use the version directly from Oracle, but in the end, use what you are happy with. That is all that matters here.

      By the way, we have a new forum on this very subject here: Virtualization

      We would love to have your help in building up the posts in this forum so that it can be as useful as possible for all openSUSE users. Your assistance in posting VM related questions and solutions there is requested.

      Thank You,
    1. opensuse121's Avatar
      opensuse121 -
      well swerdna, looks very easy and i hope it would get installed, the only additional package it is saying to install with virtual box is this one, which i am looking for how to solve.
    1. swerdna's Avatar
      swerdna -
      Quote Originally Posted by opensuse121 View Post
      well swerdna, looks very easy and i hope it would get installed, the only additional package it is saying to install with virtual box is this one, which i am looking for how to solve.
      That's a library update, a single small package, incidental. Other readers: these extra dependencies pop up from time to time. You can accept them.
    1. opensuse121's Avatar
      opensuse121 -
      Ok thanks swerdna, your post is the easiest way I guess I have seen so far and virtualization is working great, Cheers.
    1. bizoniusz's Avatar
      bizoniusz -
      Dear User.

      I have problem with this solution on openSUSE 12.1. After command:

      Code:
      /etc/init.d/vboxdrv setup
      Stopping VirtualBox kernel modules                                                                                                                    done
      Uninstalling old VirtualBox DKMS kernel modules                                                                                                       done
      Trying to register the VirtualBox kernel modules using DKMS
      Error! Your kernel headers for kernel 3.1.0-1.2-desktop cannot be found at
      /lib/modules/3.1.0-1.2-desktop/build or /lib/modules/3.1.0-1.2-desktop/source.
                                                                                                                                                            failed
        (Failed, trying without DKMS)
      Recompiling VirtualBox kernel modules                                                                                                                 failed
        (Look at /var/log/vbox-install.log to find out what went wrong)
      What should I do with this ??
    1. jdmcdaniel3's Avatar
      jdmcdaniel3 -
      Quote Originally Posted by bizoniusz View Post
      Dear User.

      I have problem with this solution on openSUSE 12.1. After command:

      Code:
      /etc/init.d/vboxdrv setup
      Stopping VirtualBox kernel modules                                                                                                                    done
      Uninstalling old VirtualBox DKMS kernel modules                                                                                                       done
      Trying to register the VirtualBox kernel modules using DKMS
      Error! Your kernel headers for kernel 3.1.0-1.2-desktop cannot be found at
      /lib/modules/3.1.0-1.2-desktop/build or /lib/modules/3.1.0-1.2-desktop/source.
                                                                                                                                                            failed
        (Failed, trying without DKMS)
      Recompiling VirtualBox kernel modules                                                                                                                 failed
        (Look at /var/log/vbox-install.log to find out what went wrong)
      What should I do with this ??
      Try this first (if you use KDE): Open YaST / Software / Software Management - Select the View Button on the top left and pick Patterns. Now, you will see several Patterns listed and you want to select:

      Code:
         Development 
      
      [X] Base Development
      [X] Linux Kernel Development
      [X] C/C++ Development
      Then Press the Accept button on the bottom right and allow these applications to install.

      Thank You
    1. jetchisel's Avatar
      jetchisel -
      Quote Originally Posted by rensg View Post
      hmm, I do not quite understand what you mean by this:
      "The latter (Sun/Oracle) is significantly better IMHO."

      the base code is the same, and licensed under GPLV2 so how can that be ?
      (as you can read here ) https://www.virtualbox.org/wiki/Downloads

      It is the extentions that are under a closed license, but you do not have to use them unless you specifically need one of the following:
      - have usb 2.0 /ehci support ( plain usb 1.0 is supported without this)
      - have pxe boot
      - have remote console on the virtual machine, so you can see and interact with the boot-process when the OS doesn't have a remote prompt or desktop yet
      If you happen to use the ose and the binary from Oracle then you will know the real difference. The package from the distro does not have vbox-webservice which means no vboxwebsrv to use if you going to install phpVirtualBox. There is no VNC support which is the equivalent for the rdesktop implementation of the binary. From what i have read from the forum other distro's has VNC support for the ose which OpenSuSE is lacking. Dont ask me why i dont know the answer to that question.
    1. jetchisel's Avatar
      jetchisel -
      Quote Originally Posted by bizoniusz View Post
      Dear User.

      I have problem with this solution on openSUSE 12.1. After command:

      Code:
      /etc/init.d/vboxdrv setup
      Stopping VirtualBox kernel modules                                                                                                                    done
      Uninstalling old VirtualBox DKMS kernel modules                                                                                                       done
      Trying to register the VirtualBox kernel modules using DKMS
      Error! Your kernel headers for kernel 3.1.0-1.2-desktop cannot be found at
      /lib/modules/3.1.0-1.2-desktop/build or /lib/modules/3.1.0-1.2-desktop/source.
                                                                                                                                                            failed
        (Failed, trying without DKMS)
      Recompiling VirtualBox kernel modules                                                                                                                 failed
        (Look at /var/log/vbox-install.log to find out what went wrong)
      What should I do with this ??
      If your going to install VirtualBox you need to update and reboot. Now if your going to use the binary blob from Oracle you need to run the following command.

      su root -c'zypper in kernel-source kernel-syms make gcc'

      this will install those needed dependencies
    1. swerdna's Avatar
      swerdna -
      Quote Originally Posted by bizoniusz View Post
      Dear User.

      I have problem with this solution on openSUSE 12.1. After command:

      Code:
      /etc/init.d/vboxdrv setup
      Stopping VirtualBox kernel modules                                                                                                                    done
      Uninstalling old VirtualBox DKMS kernel modules                                                                                                       done
      Trying to register the VirtualBox kernel modules using DKMS
      Error! Your kernel headers for kernel 3.1.0-1.2-desktop cannot be found at
      /lib/modules/3.1.0-1.2-desktop/build or /lib/modules/3.1.0-1.2-desktop/source.
                                                                                                                                                            failed
        (Failed, trying without DKMS)
      Recompiling VirtualBox kernel modules                                                                                                                 failed
        (Look at /var/log/vbox-install.log to find out what went wrong)
      What should I do with this ??
      Install the prerequisite RPMs listed in the tutorial.
    1. bizoniusz's Avatar
      bizoniusz -
      Dear users,

      Now everything is ok. The problem was in the different versions kernel and kernel-devel. It was my mistake.

      rpm -ivh VirtualBox-4.1-4.1.8_75467_openSUSE114-1.x86_64.rpm
      Przygotowywanie... ########################################### [100%]
      1:VirtualBox-4.1 ########################################### [100%]

      Creating group 'vboxusers'. VM users must be member of that group!

      No precompiled module for this kernel found -- trying to build one. Messages
      emitted during module compilation will be logged to /var/log/vbox-install.log.

      Stopping VirtualBox kernel modules done
      Uninstalling old VirtualBox DKMS kernel modules done
      Trying to register the VirtualBox kernel modules using DKMS done
      Starting VirtualBox kernel modules done
      redirecting to systemctl
      redirecting to systemctl
    1. jdmcdaniel3's Avatar
      jdmcdaniel3 -
      For anyone using VirtualBox & openSUSE 12.1, may want to install DKMS (Dynamic Kernel Module Support) to allow autoinstallation of the new VirtualBox kernel module on each kernel update. Check out my blog on DKMS and openSUSE 12.1 here: DKMS, systemd & Virtual Box - How to get Dynamic Kernel Module Support to work in openSUSE 12.1 - Blogs - openSUSE Forums

      Thank You,