39

Running Ubuntu 14.04 on Oracle VirtualBox 4.3.24 and completely stuck with mounting guest additions. I've spent quite a time looking for a solution online, but nothing helped...

enter image description here

As suggested below, I've tried to mount manually and also download ISO from the web (version matching VirtualBox). The same error:

enter image description here

EDIT:

Now some folders became "read-only", which causes big troubles.. Even installing fresh Ubuntu 14.04 image doesn't help... So reinstalling of VirtualBox itself...

6 Answers 6

55

I was able to resolve the mounting issue by the reinstalling the linux image:

sudo apt-get install --reinstall linux-image-$(uname -r)

BTW, it all started with upgrading VirtualBox. Bidirectional clipboard stopped working so I tried to reinsert Guest Additions ISO. This caused above stuff. Now, Guest Additions are mounted back, but clipboard wtill doesn't work...

2
  • 5
    I had the same problems today (clipboard broken, no CD image would mount). Your solution plus reinstalling Guest Additions solves both.
    – Mark Smith
    Apr 24, 2015 at 10:42
  • 1
    Worked for version 5.x also Mar 1, 2016 at 1:36
17

TL;DR this can be quickly fixed by rebooting. DO NOT USE apt-get. See at the bottom, "Just reboot!".


How did this happen? (previous long answer)

Exactly this kind of problem will arise if you:

  • upgrade the kernel (say from .66 to .67)
  • run apt-get autoremove and somehow remove the running kernel, or manually remove the "old" kernel, thus removing all modules from /lib/modules/kernel.66
  • do not reboot, thereby keeping the "old" .66 kernel running. The loaded modules remain in memory and everything works, but no new modules can be loaded since .66 modules have been deleted.
  • try to do anything that requires loading a module that was not yet loaded

And installing the VirtualBox ISO may require exactly that -- loading the ISO9660 support module.

The requested module now can no longer be autoloaded, because the running kernel (.66) does not find anything in /lib/modules/kernel.66 . The module exists, but it is in /lib/modules/kernel.67, of which the current .66 kernel knows nothing about (and it's not recommended to load a mismatching module).

Reinstalling the uname'd kernel will of course reinstall the running kernel modules, thereby making ../.66/.../isofs.ko available again and making a reboot unnecessary. This is a downgrade of the installed kernel and the update issue will remain (see below).

That is, when you run Additions CD, it will install for the running .66 kernel, not the updated .67 kernel (which still isn't running).

If you are in such a situation you can also certainly fix it by rebooting (the new .67 running kernel will find its modules), and probably by loading the module belonging to the new kernel (isofs is pretty stable), which unless you've underwent an important kernel upgrade will still be compatible (this is still not recommended!):

# mount /dev/cdrom /mnt
mount: unknown filesystem type 'iso9660'

This above is the root error you're getting ("unknown filesystem type").

# uname -a
Linux virtual 3.13.0-66-generic ...

So we check which version of the modules is installed. It should be .66:

# ls /lib/modules
3.13.0-67-generic

...but there's only one directory and it's .67 (the .66 directory might be there, but empty; in this case du -sh /lib/modules/* will tell how much space is taken by the various directories, allowing to tell between empty ones and full ones).

Reinstalling the old kernel image with no re-grub will not fix the real problem

You reinstall the running kernel with its modules and headers. Now you have both kernels, with grub set to load the newer kernel.

The ISO CD-ROM can be mounted (because the module is now present) and the VBox modules will compile (because the headers have been installed).

It will compile modules for the running .66 kernel, and they will work... for a while.

At the first reboot, you will find yourself with a .67 kernel with no VirtualBox additions at all.

Reinstalling the kernel will also not fix the real problem

apt-get install --reinstall linux-image-$(uname -r)

As above, at the first reboot you will find yourself with a downgraded (or better "not upgraded") kernel. Very soon, Ubuntu will try to upgrade it... and you'll be back where you started (see below: "downgrading kernel"), and need to reboot and install Virtualbox Additions again.

Patching in the ISO module will also not fix the real problem

Chances are we can force load the ISO9660 module all the same, since no work was done between kernels 66 and 67 and the binary is essentially unchanged, so we try:

# insmod /lib/modules/3.13.0-67-generic/kernel/fs/isofs/isofs.ko

No errors. It worked. Kernel .66 loaded module from kernel .67. Let's try again to mount the CD-ROM:

# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

Hey! It worked!

Yes, but this still won't be any real help, because the CD being installed is VirtualBox Additions, which requires the running kernel headers to be installed. If the running kernel modules are no longer there, chances are that neither will the kernel headers. So the CD-ROM may be mounted, but the installer will fail upon launch.

Also, even if it somehow found the headers and the compilation did not fail, the newly compiled Virtualbox modules won't have anywhere to go, since the .66 modules directory has been cleaned (that's the reason the isofs module was not found in the first place!).

But say you fix all that, by restoring the modules and headers directories for the previous kernel: you've now essentially done an expensive (and partial) kernel downgrade, and the additions will be lost at the next reboot, together with the rest of .66 kernel, when the newly installed .67 kernel comes alive. Because the Virtualbox Additions CD launched from .66 kernel with the .66 headers dutifully installed the .66 kernel modules, not the .67's.

Downgrading the kernel will work... for a while

If we remove the .67 kernel and reinstall the .66 kernel with modules in its stead, things will be hunky dory for a while. No reboot necessary, as in the "force ISO module" solution above.

And a reboot will not lose anything, since no Additions-challenged kernel is installed.

But this way the kernel will still be in the "to be upgraded" list, and this same problem is bound to arise sooner or later (usually the day after, or the next week, depending on the frequency of the automatic updates).

Granted, you can now have it arise in some more appropriate moment of your choice, which might be worth quite a lot. A forced upgrade in the middle of a coding marathon for a project which is running late is the devil.

So: just reboot! (and re-run the Additions CD).

Rebooting, the already installed and more recent .67 kernel will be activated and all its modules and headers are there; among these, the isofs module for reading ISO9660 CD filesystems.

 sudo reboot

After the reboot, the CD-ROM will work and the Guest Additions will be installable.

The "best" sequence to update the kernel on VirtualBox with Additions is:

 apt-get update
 apt-get upgrade              (or apt-get dist-upgrade)
 reboot                       
 (re)install VirtualBox Additions on the new kernel that is now running
 apt-get autoremove

(The next-to-latest old kernel might not be auto-removed for security reasons, to allow you to "go back").

2
  • 2
    This answer should be rated much higher because it is the correct answer. For completeness' sake, you've properly explained the underlying issue and also the 2 step-fix necessary to arrive at the solution.
    – zero2cx
    Sep 18, 2016 at 13:38
  • 1
    @Iserni I do not have enough reputation to edit your answer's tl;dr paragraph at the top. There, we should should mention step #2, i.e. re-installation of the Guest Additions ISO. People might be missing that necessary step by not reading to the answer's end.
    – zero2cx
    Sep 18, 2016 at 13:48
13

As per others answer this can be usually fixed by rebooting.

Somehow "iso9660" module not loaded. depmod scans all modules and create module dependencies.

sudo depmod -a
sudo mount /dev/sr0 /mnt
ls -l /mnt

this will fix the issue.

2
  • 1
    It worked for me. "sudo depmod -a" was enough. Thank you. Oct 28, 2019 at 12:06
  • solved my problem
    – nologin
    Jul 20, 2020 at 15:26
3

In my case next workaround helped:

in guest ubuntu

sudo apt-get install virtualbox-guest-additions-iso

I think some dependencies which was installed solved problem

1
  • Worked like a charm. Thanks a lot. Jun 8, 2022 at 7:30
3

I solved this (on Ubuntu 16.04) by upgrading packages and restarting:

sudo apt-get update
sudo apt-get upgrade
sudo reboot
0

Try manually mounting it:

  • Open a terminal.
  • Type the following commands:

    sudo mount /dev/sr0 /mnt
    ls -l /mnt
    
  • Then if the CD contents was shown, open /mnt in Nautilus (a.k.a File Manager) and intall the Guest Additions.

If those steps didn't work, try this:

  • Download the guest additions ISO from the VM (via virtualbox website).
  • Right click on it --> Open with... --> Disk image mounter.
  • Open the newly mounted disk.
2
  • Hi Helio, I've tried both it didn't work. The same error. Please see edited answer Mar 15, 2015 at 9:03
  • The reason why this does not work is because this procedure will fix most problems arising from Linux not finding the device. Linux here is finding the device, it even recognizes the filesystem ("iso9660"), the problem is that it doesn't know how to read it.
    – LSerni
    Nov 8, 2015 at 11:34

You must log in to answer this question.

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