How To: Install VirtualBox 3 on Fedora 12 [Tutorial]

2009 October 27

Updated: 11/22/2009

This is a step by step tutorial on how to get VirtualBox 3 up and running on Fedora 12. Specifically, this guide was written using the VirtualBox 3.0.8 version and an i386 CPU (32-bit). It can be adapted to upcoming versions and different CPUs (64-bit). The folks at VirtualBox have made it easy to install for Fedora users and I’m going to show you how in a few easy steps. Right, open a terminal window and let’s get to it…

1.) Become privileged
su -

2.) Get the VirtualBox repo installed (you may need to install wget)
wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo && cp virtualbox.repo /etc/yum.repos.d/

3.) Install VirtualBox (along with a few other needed packages)!
yum install -y VirtualBox dkms gcc
Just so you know, DKMS will “ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next kernel update” and gcc is required in order to start the VirtualBox kernel module.

4.) Run the setup file for VirtualBox:
/etc/init.d/vboxdrv setup
If you’re having issues here, try installing “kernel-PAE-devel”

5.) Add yourself to the “vboxusers” group and fix the SELinux Permissions (just in case):
usermod -G vboxusers -a <yourusername>
chcon -t textrel_shlib_t /usr/lib/virtualbox/VirtualBox.so

6.) Run, and enjoy!
VirtualBox

Appendix A: To Properly Backup the VirtualBox Machine (.vdi):

Please refer to my other page here:

How To: Properly Backup a VirtualBox Machine (.VDI)

Appendix B: Setup a Pre-Built VirtualBox Guest Image

Please refer to my other page here:

How To: Setup a Pre-Built VirtualBox Guest Image [Tutorial/Guide]

Appendix C: Shrinking a VirtualBox Guest Image

Please refer to my other page here:

Shrinking a Dynamic VirtualBox Disk Image

Appendix D: To Get Sound Working:

Highlight your virtual machine and click on the “Settings” button. Click on the “Sound” category, and then check the “Enable Sound” option. In the drop-down box, select “PulseAudio”. You should now have sound.

That’s it! If you find yourself with problems, feel free to comment below or ask for assistance on the fedora forum thread that I have created located here. If you have something to add, or need some clarification, let everybody know!

Sources:

http://www.virtualbox.org/wiki/Linux_Downloads

Feel free to buy me a soda if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that I hope you'll be interested in:


Here are some similar posts that you may be interested in:


25 Responses leave one →
  1. 2009 October 28

    You need gcc and make for the module to build too. And is the SELinux change really needed?

    • 2009 October 28

      Thanks for letting me know.

      The SELinux change was needed for Fedora 11 and VirtualBox 2. I’m not 100% sure if it is required, but I figured better safe than sorry…

  2. 2009 November 4

    Now is also available a fedora repo (http://download.virtualbox.org/virtualbox/rpm/fedora/12/i686/)

  3. 2009 November 21
    bob permalink

    you don’t even need make, automake, autoconf, gcc, and probably not even kernel devel….

    and its not VirtualBox, its virtualbox

    • 2009 November 21

      I appreciate any feedback. I’m going to try and revise the guide with a fresh install of Fedora 12. I’ll get back with the exact packages required.

    • 2009 November 22

      @bob:
      Alright, so I spent the afternoon reinstalling Fedora 12 from scratch (had to anyways for my other guide on installing Fedora 12 on a MacBook Aluminum 5,1). I have updated the guide above to reflect what is required.

      I’m not sure what you were doing, but it IS VirtualBox and you do need to install gcc in order to run the VirtualBox setup script. Again, I have updated the guide to reflect the minimal steps required to get VirtualBox running. Thanks for your input. ;)

  4. 2009 November 22

    cool thanx for this it helped alot!!!!

  5. 2009 November 23
    Eric permalink

    I started your tutorial, but the first command line failed. Iv been trying for 4 days to get Fedora 12 to run on VirtualBox guesst addition. Could you please let me know if the first step is typed in just like it looks here i might have not typed it in right

    • 2009 November 23

      @Eric:
      It sounds like your backwards from this tutorial where I’m trying to guide you through on how to install VirtualBox on top of Fedora 12 host, not the other way around as you mentioned.

  6. 2009 November 27
    Steve Cunningham permalink

    Thank you so much
    Fedora 11 running 2.6.30.9-96.fc11.i686.PAE

    Strange VBox error messages
    so I did the yum install VirtualBox dkms gcc
    and then /etc/init.d/vbox setup

    Ahhh this worked it took 1 sec to
    Stopping VirtualBox kernel module [ OK ]
    then about 45 seconds until:

    Recompiling VirtualBox kernel module [ OK ]
    Starting VirtualBox kernel module [ OK ]

    Then VBox runs great

    thanks

    steve

  7. 2009 December 4
    Myki permalink

    For anyone having issues compiling on Fedora12 on a fresh install (I myself did so on an EEE PC from a LiveCD) and getting failure log entries claiming kernel sources aren’t present, do this:

    yum install kernel-devel-2.6.31.5-127.fc12.i686

    After hours of fighting with it I finally got it to compile.

    • 2009 December 4

      Ya know, I actually mentioned that in my original, unedited post but then I took it out because it didn’t seem like it was necessary. Thanks for pointing that out.

      • 2010 February 6
        Chris permalink

        Yeah I was having trouble with this even with your walk through but this worked perfect for me and after I installed gcc VBox works great!!! Thanks!

  8. 2009 December 7
    dvz- permalink

    Thanks for the post. Only thing to change:

    usermod -G vboxusers -a `whoami`

    ^^we’re assumed that we’re still logged in as root from su -
    => `whoami` returns ‘root’…

    move this line above the “VirtualBox” call, preceded by “exit.”

    # exit
    $ sudo usermod -G vboxusers -a `whoami`
    $ VirtualBox

  9. 2009 December 7
    dvz- permalink

    sure thing…as for the fixed code…

    you can keep the chcon -t … while the user is still in as root.

    but don’t forget to specify the `exit` command to get out of su -, otherwise users may still think that all is well when they follow your commands exactly, then have questions when something doesn’t work.

  10. 2009 December 14

    For Version 3.1 just use
    »yum install -y VirtualBox-3.1 dkms gcc«

    (using of upper case letters is importent with yum)

  11. 2009 December 27
    mike permalink

    hello, it worked flawless on fresh installed fedora 12, on nforce shipset…
    gr8 work…..butt i hade to much problems getting it to work on fedora 9 with too much packages installed!
    ..any way 10x 4 the post

  12. 2009 December 28
    Noman permalink

    Thanks for the write-up! Worked great. One thing that needs a last little bit of love: step 4 says ‘If you’re having issues here, try installing “kernel-PAE-devel”’. Shouldn’t this be the *-devel package for whichever kernel you’re running? Also, if you’ve updated your kernel recently be sure you’ve rebooted before doing this step so that the running kernel and the source files are in sync.

  13. 2010 January 3
    biscuits permalink

    Almost all of my usb devices are greyed out in xp under vbox. what to do?

    • 2010 February 14
      azure permalink

      To get USB working, you must add the following to /etc/fstab

      #VirtualBox USB – 122 is the gid of vboxusers group
      none /proc/bus/usb usbfs devgid=122,devmode=664 0 0

      and make sure your user is in the vboxusers group

  14. 2010 March 1
    Hector permalink

    Dereck I follow your instruction with Myki sugection and virtualbox is running nicely. Thank you both.

    Hector

Trackbacks & Pingbacks

  1. VirtualBox 3 en Fedora 11 [Parte 1 Instalación] « Fedoreando
  2. Fedora 12 調整以及安裝軟體 » sshlog

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS