54

I installed Ubuntu 12.10 Server AMD 64 with VirtualBox 4.2 latest version. I've installed it successfully. I've to install now Guest Additions but I am getting a error message like the below exactly same

Unable to mount the CD/DVD image
/usr/share/virtualbox/VBoxGuestAdditions.iso on the machine Sandbox. Would you like to force mounting of this medium?

Could not mount the media/drive
'/usr/share/virtualbox/VBoxGuestAdditions.iso'
(VERR_PDM_MEDIA_LOCKED).

Details

Result Code: NS_ERROR_FAILURE (0x80004005)

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}
Callee: IMachine {22781af3-1c96-4126-9edf-67a020e0e858}

I research a lot with Google and other places and I removed the installation disc image from ~/.VirtualBox/VirtualBox.xml file to edit a line but didn't get any luck

I installeddkms too but still didn't get any luck

Can anyone please help me about that? I am stuck now :(

Braiam
  • 67,791
  • 32
  • 179
  • 269
Sumon Khan
  • 757
  • 2
  • 9
  • 9
  • After the error messsage, if you click Ok, does the guest see a CD-ROM? – ignis Jul 18 '13 at 19:57
  • I got the two option with the error message. That is "Leave" and "Force Mount". I did force mount all the time but after nothing is happened – Sumon Khan Jul 18 '13 at 20:15
  • 1
    I'll rephrase my question: if you click in the virtualized system, can you open the CD-ROM? I get that error message every time, however the file manager of the virtualized system (I virtualize Ubuntu) shows me that it has the guest additions CD-ROM, and I can proceed with the guest additions installation. The VirtualBox menu option "Install Guest Additions..." merely inserts a virtual CD-ROM in the guest, which is supposed to auto-mount. If it does not, you can mount it manually (always in the guest). What system are you virtualizing? – ignis Jul 18 '13 at 20:37
  • 1
    Hi, Sorry for my bad. Yes, I've got the CD-ROM option but I can't open it. I am virtualizing Ubuntu Server 12.10 – Sumon Khan Jul 18 '13 at 21:13
  • 1
    It may be mounted in /media/VBOXADDITIONS_xxx or /media/<user>/VBOXADDITIONS_xxx - however except you need USB2.0 support the GA are of little use in a server. – Takkat Jul 18 '13 at 21:25
  • I've gone to the Virtual Media Manager but I didn't find any CD/DVD option on there. So, what should I need to do now? @ignis – Sumon Khan Jul 18 '13 at 21:36
  • @Takkat I've got VirtualBox and VirtualBox VMs file on media directory. What should I need to do next? – Sumon Khan Jul 18 '13 at 21:38
  • I did not write "Virtual Media Manager", and no one mentioned the VirtualBox directory, nor the VirtualBox VMs directory. Just enter inside the virtualized Ubuntu 12.10, open the file manager to discover where the virtualized system has mounted the CD/ROM, open a terminal, move to that directory with the terminal's cd command, then follow the instructions for Linux that are in the VirtualBox manual (for convenience, it's linked in the comment above). – ignis Jul 18 '13 at 22:03
  • On server edition there is no file manager. For command line installation of guest additions see: http://askubuntu.com/questions/22743/how-do-i-install-guest-additions-in-virtualbox/22745#22745 – Takkat Jul 19 '13 at 06:03
  • I've seen the article but I am not getting any Virtual CD/DVD drive into my Desktop here :( – Sumon Khan Jul 19 '13 at 11:15
  • These answers will only work if you have gcc make perl packages from your distribution installed. To install it give the command -> sudo apt install virtualbox-guest-utils virtualbox-guest-dkms in terminal and then try the mentioned method . It will work – O_K Jun 29 '21 at 18:50

13 Answers13

81

I struggled with this for about 2 hours on a Windows 7 host running Ubuntu 13.10 Server guest. In the end, I just copied over the VBoxGuestAdditions.iso to the guest (using WinSCP), mounted it, and then ran VBoxLinuxAdditions.run from the guest.

Here are the steps I took:

  1. Locate VBoxGuestAdditions.iso on your host (in my case, C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso).

  2. Copy VBoxGuestAdditions.iso to your guest (in my case, I used WinSCP).

  3. In the terminal for the guest mount the ISO using the following:

    sudo mkdir /media/GuestAdditionsISO

    sudo mount -o loop path/to/VBoxGuestAdditions.iso /media/GuestAdditionsISO

  4. At this point you'll probably get a message that the ISO has been mounted as READ-ONLY. That's perfectly fine. If you change into the directory /media/GuestAdditionsISO you should see VBoxLinuxAdditions.run and it should be executable:

    cd /media/GuestAdditionsISO

    ls -l

  5. Now just run VBoxLinuxAdditions.run:

    sudo ./VBoxLinuxAdditions.run

You also have the option of extracting VBoxGuestAdditions.iso in Windows (or whatever host OS you're using) and then SCP'ing (or WinSCP'ing) it over to the Ubuntu guest, and then just running: sudo ./VBoxLinuxAdditions.run

Better doing what I have listed above instead of wasting time and putting faith in methods that may or may not work on your particular configuration.

Hope this helps.

Andy Turfer
  • 1,658
  • 23
    Excellent answer. Instead of copying the ISO to the guest using SCP, you could also easily download it from http://download.virtualbox.org/virtualbox. Select the version of your Virtualbox and copy the link for VBoxGuestAdditions.iso. Go to your home folder in host, wget link. Continue with sudo mkdir.... – mcbetz Jan 27 '15 at 12:42
  • 2
    I preferred to get the "path/to/VBoxGuestAdditions.iso" by attempting to install guest additions via the VirtualBox menu > Insert Guest Additions CD Image... It will fail, but will give you the path to the .ISO image on your host workstation. For the OSX, it will likely be /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso. – l3x Nov 16 '15 at 06:10
  • On (my) Mac OSX the ISO file path is /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso – tamberg Feb 01 '16 at 22:03
  • Works for me in 2017. Debian 8 64 Bits. – Jorge Santos Apr 04 '17 at 14:01
  • @mcbetz : awesome. you should put it as an answer – Shashank Vivek May 22 '19 at 16:39
  • For this to work I had to run prior to the installation: sudo apt install build-essential dkms linux-headers-generic – Vivian De Smedt May 19 '22 at 09:59
49

The trick is to

  1. shut down the guest OS
  2. in the VM manager, right-click the relevant VM and select 'settings'
  3. in the Storage tab, select the cd drive w/ the guest additions in it
  4. in the attributes section click the little CD symbol and select 'remove disk...'

Then, after starting the VM the guest additions should be mountable again. hth

34

In my case (VM ubuntu 14.04 on an WIN7 system), I open /var/log/kern.log, and search for CD-ROM, I find that in ubuntu 14.04, VBOX CD-ROM is recognized as SCSI CD-ROM, and attached to /dev/sr0

kernel:[      1.456xxx] scsi 1:0:0:0: CD-ROM VBOX CD-ROM 1.0 PQ: 0 ANSI: 5

kernel:[      1.460xxx] sr 1:0:0:0: Attached scsi CD-ROM sr0

Now, after click the menu 'Device' -> 'Install Guest Additions', then type the following command:

sudo mount /dev/sr0 /media/cdrom

and the ISO file is mounted on /media/cdrom

so, after this run:

cd /media/cdrom
sudo ./VBoxLinuxAdditions.run
ntg
  • 541
13

Just mount the optical drive, which should be in /dev/cdrom

First, in your VirtualBox main screen, go to Settings -> Storage and make sure VBoxGuestAddidtions.iso shows under Controller: IDE. If it doesn't, add it there. It is in C:\Program Files\Oracle\VirtualBox

Then start the guest machine, open a terminal, and mount the drive like so:

sudo mount /dev/cdrom /media/cdrom0
cd /media/cdrom0
sudo ./VBoxLinuxAdditions.run
cd
sudo umount /media/cdrom0
7

I stuck with the same problem. Removing and adding iso in virtualbox anew didn't help me too either.

The problem is that auto-installation doesn't work. So we can run it manually as:

enter image description here

As result additions were successfully installed (at least terminal said so), but I didn't notice any improvements after installing.
Maybe it'll work for you.
Good luck!

Tebe
  • 271
4

Eject the image while VM is running then retry. Works like a charm.

Apli
  • 41
  • 1
  • It happened to me just now, and was going to enter this same answer. Windows 7 64-bit, with Ubuntu 16.04-LTS guest. – LSerni Aug 20 '17 at 11:31
  • I came back here just to say that, shame on StackOverflow this answer is not on top. – Machado Jun 07 '19 at 18:40
2

This is what worked for me...

  1. Shutdown guest OS
  2. Go to Settings -> Storage
  3. Dismount all drives, including CD drive and Hard drive
    • My hard drive was mounted under SATA
    • CD drive was mounted under IDE
  4. Re-mount hard drive under IDE (not SATA)
    • Browse to C:\Users[your username]\VirtualBox VMs[VM name]
  5. Re-mount an empty CD drive under IDE
  6. Press OK, start VM
  7. Try mounting/installing guest additions again
MakerMax
  • 21
  • 2
1

Right click on the window bottom of the disk icon, and click Remove the virtual disk -> click Insert Guest Additions, and then

sudo mount -r /dev/cdrom /mnt
cd /mnt
sudo ./VBoxLinuxAdditions.run
Fangxing
  • 271
0

I had the same problem as the OP. After many trials I found that the VBOXGuestadditions iso was also mounted in other VMs. I remember after creating the VM, virtualbox automatically attaches the iso to the VM. I unmounted the iso from all other VMs and then from the current one also as suggested by @MakerMax. Restarting the VM resulted in the CD being seen fine. (FYI my guest was Fedora 20, and host Mint 17. Of course had further problems with the Shared Folders when running the install script)

0

Just an update - 14.04 LTS guest on a windows 8.1 host. Display by default was not correctly set on the new machine... I could not change the resolution. I went to install guest additions ( as recommended fix from oracle), but received the same unable to mount error.

I opened the explorer, and noticed that the file was mounted, just autorun did not work. I just went to the drive and ran the program. was prompted for credentials, but everything worked.

Installed for me (:

0

The following works for me:

  1. Shutdown Ubuntu
  2. Go to oracle VM virtual box manage -> settings -> storage. Delete the mounted .iso file under controller: IDE, and then add an empty disk.
  3. Start Ubuntu and go to Device -> Insert Guest Additions CD image -> browse to the .iso file you'd like to mount and then install.
  4. After installation, reboot Ubuntu and the screen should be adjusted.
0

THIS WILL WORK - I hope! Like everyone I scoured the net and tried almost everything

For me - removing CD device under storage/controller, CLONING the VM, adding a NEW/empty IDE CD/DVD drive, starting VM, and restarting worked

It was important to understand - are guest additions working for any 1 VM and not for a particular VM. If yes, then the above will work.

If not, Make sure guest additions are installed under File - Preferences - Extensions

Good luck

Aveesh
  • 170
-1

I got it installed - Go to VM Manager -- select the VM -- Select Storage -- Controll IDE Select the icon with + sign "Add CD/DVD device" Add the VBoxGuestAdditions.iso from Programs\Oracle\VirtualBox Boot into Ubuntu on VM Open files and Select the CD under Devices I had an option to run the CD on top right. But it is same as running the autorun.sh file. Let the installations run. Shutdown ubuntu VM Go to VM Manager and remove the disk. Boot into vm and it should be in full screen mode. Good luck!!!

  • Note select the CD icon left of "VBoxGuestAdditions.iso", then click right mouse button to see a context menu and select "Remove attachments." This is equivalent to ejecting a CD. You don't want to select "Controller: IDE" or the CD icon with a plus sign to the right of it. That would be equivalent to unplugging the CD drive. – bootchk Mar 27 '14 at 13:43
  • My comment above is wrong. "Remove attachments" is more like unplugging the CD (since it is a disk image.) But then you can click on the CD icon with a plus sign to add another disk drive. You can leave it empty. Then when the VM is running, choose VBox>Devices>Insert Guest …, which is similar to inserting a CD. – bootchk Mar 27 '14 at 14:03