113

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)?

5

17 Answers 17

101

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.

5
  • 10
    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, 2017 at 14:42
  • 1
    For installing virtualbox guest additions on Debian: virtualboxes.org/doc/installing-guest-additions-on-debian @chovy
    – Caleb Jay
    Jan 24, 2018 at 5:38
  • The command brew install virtualbox-guest-utils will also work
    – Arefe
    Jul 9, 2018 at 15:41
  • 5
    This doesn't answer the question... it is about the VERR_PDM_MEDIA_LOCKED error. Feb 18, 2019 at 14:41
  • How do you actually use virtualbox-guest-utils once installed?
    – Xedni
    Sep 1 at 15:15
75

I ran into this problem recently (Sep. 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. The host is Windows 10.

The problem was that the Guest Additions CD image was already mounted. To fix it:

  1. In the VM Manager go to Settings -> Storage.
  2. Under Controller right-click on VBoxGuestAdditions, and select Remove Attachment. There will be a confirmation box. Click Remove.
  3. Click the + icon next to Controller to add a new optical drive. A dialog box will open. Choose Leave Empty -> OK.
  4. Open the VM and select Devices -> Insert Guest Additions. It should power off the VM (not the VM Manager) and restart the VM.

VirtualBox Guest Additions should now be working.

6
  • 1
    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, 2018 at 13:18
  • 1
    “Remove Attachment." is disabled/inaccessible for me, do you perhaps know why?
    – Lesego M
    Feb 6, 2019 at 9:55
  • 7
    @Les it's likely because your VM was still running Feb 18, 2019 at 21:21
  • @Dave ... It works ... Thanks!
    – testuser
    Jan 24, 2021 at 11:52
  • This solution worked for me, however, first I tried to increase video memory from 16 MB to 128 MB, so should I change that again to 16 MB? I just want to do minimal operation on virtual box. Jan 2, 2022 at 9:38
20

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 😉

3
  • 1
    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
    – slava
    Feb 18, 2019 at 17:56
  • 2
    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. Feb 18, 2019 at 18:08
  • 3
    All other solution didn't work for me. Yours's worked. Aug 19, 2019 at 11:32
17

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!

2
  • 3
    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, 2017 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). Aug 30, 2018 at 16:47
9

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
  • 4
    "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, 2016 at 10:34
  • 1
    Enabling video capture has nothing to do with a copy and paste problem. It's about a guest additions loading issue.
    – Volomike
    Aug 31, 2019 at 2:58
  • This works great without the capture part! Thanks! Nov 19, 2020 at 11:56
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.
0
1

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 :)

1

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

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

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
1
  • There is no useful directory in /media in my case. Feb 18, 2019 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.

1
  • 1
    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, 2019 at 15:45
0

go to /media/cdrom/

or files and copy the content from virtualboxguestaddition optical drive

paste anywhere may be into documents in a folder for example into a new directory called vbox

open the directory in terminal

sudo chmod -x VBoxLinuxAddtions.run

sudo sh ./VBoxLinuxAddtions.run

after restart the system will start as in full screen mode.

0

In my case I have found work around to this problem my virtual box version 6.1 and Ubuntu version is 20.0.4LTS

Click on start button in your virtual box Login to your ubuntu machine on top of the machine you'll find controls for your virtual box click on View > Seamless Mode (Right hand side Ctrl + L key) that's all you will be in maximized view If you want to enter in full screen mode click on view > Full-screen mode (Right hand side Ctrl + F key)

0

I had the issue on my Ubuntu VM installed on a Mac. I did the following to resolve the issue:

  1. In Virtual Box Settings -> Advanced -> Controller IDE and make it empty.

  2. Start the Ubuntu VM, open the terminal, run the following two commands, and restart:

    sudo apt update 
    sudo apt install build-essential gcc make perl dkms
    
0

Start your Ubuntu in VM Virtual Box -

  1. open terminal
  2. cd /media
  3. cd sivareddy (in your case it might be your name, check by ls command)
  4. cd VBox_GAs_6.1.36
  5. ls (if VBoxLinuxAdditions.run is present, then do the next steps otherwise you have to install Guest additions)
  1. ./VBoxLinuxAdditions.run
  1. Restart ubuntu and login

This worked for me and my os is windows 11 Thanks!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .