Install VirtualBox guest additions

To use “Shared Folders” in VirtualBox, the user should install VirtualBox guest additions:

(1) Select Devices -> Insert Guest Additions CD image. If the VirtualBox prompts:

Unable to insert the virtual optical disk C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the machine CentOS.

Would you like to try to force insertion of this disk?

Count not mount the media/drive 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso' (VERR_PDM_MEDIA_LOCKED).

It means the Devices -> CD/DVD DEvices already has ISO file. Please inject it, and try Insert Guest Additions CD image again.

(2) Mount the ISO file:

mount /dev/cdrom /mnt

(3) Install the VirtualBox guest additions (Take Linux as an example):

cd /mnt

You may also need to install bzip2, gcc and kernel files to install guest additions successfully. When meeting errors, please refer /var/log/vboxadd-install.log for detail info.

9 thoughts on “Install VirtualBox guest additions”

  1. Straight to the point.

    Many thanks.

    (Something is happening at virtualbox. 3 people asking the same in a row in just 2 weeks and this post is 2 yrs old).

  2. Thank you! It wasn’t obvious that the guest additions was mounted (as I’m using the CLI and didn’t consider it was already in /dev/cdrom) so I did the following first (In Ubuntu)

    1. Ran : sudo apt-get install linux-headers-$(uname -r) build-essential dkms bzip2 perl
    2. Reboot:
    3. Above instructions to mount and run the Guest Additions installer
    4. Profit 😉

    1. For CentOS this worked for me as well
      1. yum groupinstall “Development Tools”
      2. yum install kernel-devel epel-release dkms
      3. Restart
      4. Above instructions to mount and run the Guest Additions installer
      5. Profit 😉

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.