How to Install Virtualbox Guest Additions on Fedora 20

By | September 3, 2020

Fedora 20 (Heisenbug) is currently the latest release and if you want to try it on VirtualBox then install the guest additions for full functionality.

Installation is simple and takes a few steps, but involves download and updates which would require some bandwidth.

The Guest Additions are compiled from source and loaded as a module.

1. Update Fedora

The first thing to do is to upgrade all packages and make the system uptodate.

$ sudo yum distro-sync

2. Install kernel headers and build tools

VirtualBox guest additions are always compiled so they need necessary build tools and kernel libraries. Install them with the following command.

$ yum -y install kernel-devel kernel-headers dkms gcc gcc-c++

Reboot

After upgrading and installing kernel headers, reboot the system.

3. Compile virtualbox guest additions

Click on Devices > Insert guest additions CD image on the VirtualBox window menu.
The cd image is now available in fedora at /dev/cdrom or /dev/sr0.

Create a directory at home and mount the cd in it.

$ mkdir vboxcd
$ sudo mount /dev/cdrom ~/vboxcd
[sudo] password for silver: 
mount: /dev/sr0 is write-protected, mounting read-only
$ ls
32Bit        cert                    VBoxSolarisAdditions.pkg
64Bit        OS2                     VBoxWindowsAdditions-amd64.exe
AUTORUN.INF  runasroot.sh            VBoxWindowsAdditions.exe
autorun.sh   VBoxLinuxAdditions.run  VBoxWindowsAdditions-x86.exe

Next run the VBoxLinuxAdditions.run script. The output should look similar to this

$ sudo ./VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.6 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.6 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules           [  OK  ]
Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
Building the VirtualBox Guest Additions kernel modules     [  OK  ]
Doing non-kernel setup of the Guest Additions              [  OK  ]
Starting the VirtualBox Guest Additions                    [  OK  ]
Installing the Window System drivers
Installing X.Org Server 1.14 modules                       [  OK  ]
Setting up the Window System to use the Guest Additions    [  OK  ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services componen[  OK  ]

$

The line that builds the VirtualBox Guest additions kernel modules is the important one and must not fail

Building the VirtualBox Guest Additions kernel modules     [  OK  ]

Done, Now reboot.

4. Verify that guest additions are loaded

After the reboot the screen resolution of fedora guest should adapt to virtualbox window size which indicates that the guest additions are working. You can additionally verify that the kernel modules are loaded or not, with the following command

$ lsmod | grep -i vbox
vboxsf                 43786  0 
vboxvideo              12658  1 
drm                   283349  2 vboxvideo
vboxguest             231692  8 vboxsf
$

The vboxguest module indicates that virtualbox guest additions kernel module is loaded and working.

5. Configure shared folders

The last thing is to configure shared folders so that you can easily exchange files between the host and guest OS. Click on "Devices > Shared Folder Settings" in the Virtualbox window. Click the icon on right to add a new shared folder.

Select the directory on your host system that is to be shared with the guest Fedora 20.

Make sure to give a proper folder name, since it would be used to mount the directory inside Fedora.

Check "Make Permanent" if you want shared folder setting persistent. Permanent shared folders are listed under Machine Folders, where as the non-permanent ones go under the Transient Folders list.

After selecting the folder to share, now mount the folder inside Fedora using the folder name specified earlier. The command to use is mount

$ sudo mount -t vboxsf enlightened ./vboxshared
OR
$ sudo mount.vboxsf enlightened ./vboxshared

vboxshared is the name of the directory where we mount the shared folder. Make sure that the directory exists. The mount command would now show that the directory is mounted

$ mount | grep vboxsf
none on /home/silver/vboxshared type vboxsf (rw,nodev,relatime)

Conclusion

Finally you have VirtualBox Guest Additions Installed on Fedora. Now you should be able to get the native resolution, and be able to copy paste stuff across Fedora and the host OS.

It will also enable shared folders so that you can automatically share files across host and guest OS.

If you have any questions or feedback, let us know in the comments below.

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

12 Comments

How to Install Virtualbox Guest Additions on Fedora 20
  1. Ahmad Ragab

    you have to add yourself to the vboxsf group in order to mount the windows shared folder
    use
    usermod -a -G vboxsf ahmad
    to add user ahmad to the secondary group vboxsf

    then you can mount the shared folder in linux
    sudo mount -t vboxsf sharedFolder ./shared

  2. 2dy4

    Thanks, it worked almost like a charm on my CentOS 7 server environment. CentOS mounts the ./vboxshared folder as /media/sf_vboxshared. But it works as long as you use the under CentOS created foldername sf_vboxshared name as foldername in the Device->Shared Folder Settings.

  3. Sainath S.R

    Thanks Installed guest additions ,but performance still low
    Specs
    Core2Duo E4500
    1GB Ram for guest
    128 Mb Video Mem

  4. Tj Geezer

    By far the best procedure I’ve found. Worked the first time with a new Fedora xfce install, smooth as can be. Now I can learn the Fedora RPM way of doing things without losing my main Mint based on Ubuntu tagging along with Debian that finally freed me from Windows. Way too much fun for a coot my age. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *