69

Error when I clicked on Insert GuestAdditions CD Image from "Devices"

Unable to insert the virtual optical disk /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the machine VirtualUbuntu.
Would you like to try to force insertion of this disk?
Could not mount the media/drive    '/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso' (VERR_PDM_MEDIA_LOCKED).

Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
Console
Interface: 
IConsole {8ab7c520-2442-4b66-8d74-4ff1e195d2b6}
Callee: 
IMachine {480cf695-2d8d-4256-9c7c-cce4184fa048}

I can see VBoxGuestAdditions under VirtualBox list

homeuser@ubuntu:/usr/share/virtualbox$ ls -l
drwxr-xr-x 2 root root 4096 Jan 14 12:46 nls
-rw-r--r-- 1 root root 64647168 Apr 7 2014 VBoxGuestAdditions.iso
-rwxr-xr-x 1 root root 2176 Apr 6 2014 VBox.sh
-rwxr-xr-x 1 root root 4161 Apr 7 2014 VBoxSysInfo.sh

Any suggestion(s)?

13 Answers 13

63

I assume your host operating system is Mac OS X and you have installed Ubuntu as the guest operating system.

There is no need to mount the guest additions ISO and install from it if your guest OS is Ubuntu.

Instead, open a terminal and enter the following -

sudo apt-get install virtualbox-guest-utils

This will install the guest additions and is more or less equivalent to installing via the ISO.

  • 6
    Also worked for Windows host! – Hack-R May 26 '16 at 13:32
  • 7
    not available on debian – chovy Oct 15 '16 at 2:53
  • 5
    The statement about "No need to install Guest Additions" is presumptuous and does not actually answer the underlying problem of the CD failing to mount. In my experience, the drivers provided on the Guest Additions CD are newer and offer better performance than those offered in the Ubuntu PPA. Furthermore, as @chovy has explained, this solution does not scale well when received on non-Ubuntu based distributions. Please see dave-rose's answer below for a better solution. – tresf Nov 7 '17 at 14:42
  • 1
    For installing virtualbox guest additions on Debian: virtualboxes.org/doc/installing-guest-additions-on-debian @chovy – Caleb Jay Jan 24 '18 at 5:38
  • The command brew install virtualbox-guest-utils will also work – Arefe Jul 9 '18 at 15:41
30

I ran into this problem recently (Sept 2017) trying to install Guest Additions into Oracle VM VirtualBox Manager version 5.1.28, in a newly-installed VM for Ubuntu version 16.04.3. The host is Win-10. The problem was that the Guest Additions CD image was already mounted. To fix it:

  • In the VM Manager under Settings->Storage, under Controller: Right-click on VBoxGuestAdditions, and select “Remove Attachment." There will be a confirmation box: click “remove.”
  • Click the “+” icon next to “Controller," to add new optical drive. A dialog box will open. Choose “Leave Empty-> Okay”
  • Open the VM and select Devices->Insert Guest Additions. It should install now. Power off the VM (not the VM Manager) and restart the VM. GuestAdditions should now be working.
  • 2
    This is a slightly better version of @jan-hettich's answer. – tresf Nov 7 '17 at 14:15
  • This works. But for me I had to manuall install the guest additions as the OS (Lubuntu in my case) was not starting the "autorun.sh" script. So I had to manually execure this: sudo ./VBoxLinuxAdditions.run This than told me that my system was not set up to compile the kernel moduls for the guest additions. So I had to install them before running the script again: sudo apt install gcc make perl sudo ./VBoxLinuxAdditions.run After a restart the resizing did indead work. Thanks guys! – KFleischer Aug 5 '18 at 13:18
  • “Remove Attachment." is disabled/inaccessible for me, do you perhaps know why? – Les Feb 6 at 9:55
  • @Les it's likely because your VM was still running – Daniel Jamrozik Feb 18 at 21:21
7

For me, the solution was discovering that you have to add an Empty optical drive in the virtual machine settings! If you try to "help" by pre-loading the VBoxGuestAdditions.iso, it doesn't work. The shortcut on the Devices menu "Insert Guest Additions CD image ..." wants to find an empty optical drive to use!

  • 1
    I followed a similar procedure. By powering down the guest, deleting the optical drive and re-adding one, I was able to re-insert the Guest Additions CD. This should be the accepted answer because it is the most user-friendly fix to the problem. Whereas other answers that instruct to use apt-get are a workaround, not a solution. – tresf Nov 7 '17 at 14:14
  • If you're running Oracle-provided VirtualBox, you shouldn't use the apt-get method. The apt-get solution is a bit better for if your host is also Ubuntu and you're using the Ubuntu-provided VirtualBox package. It will keep your guest system running the right version of the guest additions when VirtualBox is updated on the host (they update their guest additions and VirtualBox packages at the same time, so both the host and guest get updated software). – Chai T. Rex Aug 30 '18 at 16:47
5

Hi I was having same issue (copy and paste problem) and I entered following commands from terminal and solved the problem.

  • sudo apt-get upgrade
  • sudo apt-get install virtualbox-guest-additions-iso
  • Go to display setting, under video capture, check enable video capture
  • sudo apt-get install virtualbox-guest-utils
  • restart virtual machine.
  • 3
    "under video capture, check enable video capture" - this is extremely unlikely to help. No offence, but this is probably not a good idea. :-) – Max Murphy Dec 3 '16 at 10:34
3

I had the same problem and manual installation with sudo apt-get didn't work for me. Different Virtual Box has different guests additions version so it's better to install the guest additions that comes with Virtual Box. So I installed it in this way:

  1. From File manager choose "Devices" -> "Insert Guest Additions CD image..."
  2. Login Ubuntu
  3. Unmount the CD (guest addition cd image)
  4. Mount the guest additions iso

    It'll pop up a window asking for confirmation to run it or not. If choosing to run, enter the login password and install it.

  5. Reboot Ubuntu

3

Got same error, get it work as below:

  1. after got that error, unmount VBOXADDITIONS CD in ubuntu;
  2. get out Ubuntu, click Devices - Insert Guest Additions CD Image. This time it will pop up a window asking run it or not,
    • choose to run
    • enter the login password
    • start to install now.
3

I solved by manually mounting the image (after adding the Device and the ISO according to the Dave Rose's answer) and running the installer.

sudo su
cd /media
mkdir cdrom
mount /dev/cdrom /media/cdrom
cd cdrom
sh VBoxLinuxAdditions.run

Check my answer on SuperUser 😉

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – mature Feb 18 at 17:56
  • Not being "better", but also not wrong, deserves a downvote? Last time (yesterday) I wrote the same answer on two different questions I got downvoted too.. 😕 Anyway, I added the relevant commands for the solution. – Kamafeather Feb 18 at 18:08
  • All other solution didn't work for me. Yours's worked. – Abhishek Tyagi Aug 19 at 11:32
0

The problem many times that happens is that the iso file you installed is already mounted. Just go to Devices-Optical Device-Remove Virtual Disk from Guest installation. Then Manually mount the Guestadditions.iso file by going to Devices-Optical Drive-Choose Disk image then go to the folder where you installed ubuntu, find the guestadditions.iso file and then mount it. Once mounted, simply again click the Devices-Install Guest additions, enter your userID password for Ubuntu and the wizard will then continue to install the guest additions :)

0

In my case this happened because I was running Ubuntu server which doesn't have a window manager. Here is how I installed:

First, boot up the Ubuntu VM. Then press Devices > Insert Guest Additions CD. The CD has now inserted but you won't see anything. If you try to press Insert Guest Additions CD again you will get the error.

Next mount the CD:

sudo mount sr0 /media/cdrom

And then cd into the directory (no pun):

cd /media/cdrom

Next, run the install script:

sudo ./VBoxLinuxAdditions.run

And now everything should fine :)

0

I had problems that after mounting ISO the disk was empty in Debian. I made following workaround:

  1. mount addons image in Deamon tools in home Win system
  2. copy files from iso to shared folder to access them from virtual Debian
  3. perform SH installation directly in that folder (you will have access to addons files all the time via this folder)
0

Same error for me with Macos. I was hitting the error Could not mount the media/drive '/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso' (VERR_PDM_MEDIA_LOCKED). The guest additions iso was already downloaded previously. All steps are done within VM.

  1. cd to media/<user>/Vbox_GAs_<version> (there may be multiple folders here so choose the most recent).
  2. ./autorun.sh to install the guest additions iso
  3. sudo reboot
  • There is no useful directory in /media in my case. – Kamafeather Feb 18 at 14:35
0

For windows 10 as host start the VM click on devices --> Optical Devices --> choose disk image --> go to C:\Program Files\Oracle\VirtualBox --> select VBoxGuestAdditions.iso from there -->Click Ok --> A small window will appear Click Force Unmount --> now again click on devices with ubuntu logged in -->Click on insert Guest Additions CD image --> click run --> after the successfull insert your ubuntu will start coming on fullscreen.

  • Welcome to AskUbuntu! This answer would be more useful if you were to explain how VBoxGuestAdditions.iso ended up at C:\Program Files\Oracle\VirtualBox – Elder Geek Feb 23 at 15:45
0

Start your Ubuntu in VirtualBox:

  1. Go to Devices -> Optical Drives -> Remove Disk from Virtual Drive
  2. Go to Devices -> Click on ->Insert Guest Additions CD Image
  3. Enter authentication Details
  4. Shutdown Ubuntu and Close VirtualBox. Open again VirtualBox to see it Working

Also Check Shared Clipboard and Drag & Drop is checked bidirectional

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.