5

I've just got my guest box running CentOS working perfectly, except for one problem. I'm trying to mount a shared folder. I've followed the instructions for getting the shared folder "Mountable" by using this code:

VBoxManage sharedfolder add "TEST - 250" --name "github" --hostpath "C:\filepath\github"

Where "TEST - 250" is the name of the VM, "github" is the name of the folder as I'd like to call it in my VM, and "C:\filepath\github" is the directory path on the Windows host where I can find the contents I would like to share.

All seems well, and as instructed by Oracle, I am to use this command in the VM:

sudo mount -t vboxsf shared ~/host

I've made a directory off of the root called "host". The problem here is that I'm getting the following message:

mount: unknown filesystem type 'vobxsf'

Looking at this further, I'm told that in the /sbin/ folder, there should be a file called mount.vboxsf, where there is not.

I then read chapter 4 here: http://www.virtualbox.org/manual/ch04.html ... more specifically section 4.2.2.1.6 for Oracle Linux, Red Hat Enterprise Linux and CentOS. I follow ALL commands they ask for:

yum install dkms
yum update
yum install gcc
yum install kernel-devel

And just in case...

yum install kernel-uek-devel

All seem to work fine. I reboot the system to activate the updates. Once I login to the rebooted system, I type:

ls /sbin/mount*

... and I do NOT see the mount.vboxsf file. What am I doing wrong?

Also, is there a way to just get this file, and place it there? If I had that, I could perform my drive mounting, and be done with what I need to do. Any suggestions?

user272735
  • 10,473
  • 9
  • 65
  • 96
Vinnie Saletto
  • 329
  • 2
  • 5
  • 20
  • 1
    This question should have been closed ages ago: Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User. – AStopher Jul 17 '14 at 12:22

4 Answers4

19

You need to install guest editions.

"The VirtualBox Guest Additions for all supported guest operating systems are provided as a single CD-ROM image file which is called VBoxGuestAdditions.iso. This image file is located in the installation directory of VirtualBox."

create mount directory

sudo mkdir -p /media/VirtualBoxGuestAdditions

mount guest additions iso

sudo mount -t iso9660 -o loop /installation/directory/of/VirtualBox/VBoxGuestAdditions.iso /media/VirtualBoxGuestAdditions/

Install guest additions

sudo /media/VirtualBoxGuestAdditions/VBoxLinuxAdditions.run

Then mount.vboxsf file should be in sbin and you can mount with

sudo mount -t vboxsf shared ~/host 

See https://www.virtualbox.org/manual/ch04.html

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
Maux
  • 304
  • 2
  • 6
  • 2
    Here's a scary question: How do I find /installation/directory/of/VirtualBox/VBoxGuestAdditions.iso ? I know where it is on the host machine, and it appears to be virtually IN the guest machine, just not mounted. – Vinnie Saletto Mar 14 '14 at 17:46
  • 12
    You are correct! It appears that after MUCH hunting and pecking, I found the installation directory of VirtualBox to be: /dev/disk/by-label/VBOXADDITIONS_4.3.8_92456 _very intuitive, eh?_ – Vinnie Saletto Mar 14 '14 at 18:37
  • This answer provides a link to more detailed instructions that also includes prerequisites: http://unix.stackexchange.com/a/146384/14436 – bmaupin Sep 26 '14 at 16:10
  • 1
    I used "find / -name VBox*" and searched for the location in the output. For me, it was in /usr/share/virtualbox/ – AatG Oct 31 '14 at 21:58
9

After following the steps described by the given answer and experiencing a kernel header issue i came across this link which has a command that does simplify things.

/etc/init.d/vboxadd  setup

Hope it helps future explorers on this question. :)

David 'the bald ginger'
  • 1,296
  • 3
  • 20
  • 38
  • 1
    Worked great! All in all, I had to do: `sudo yum install kernel-devel-2.6.32-504.16.2.el6.x86_64; sudo yum install gcc; sudo /etc/init.d/vboxadd setup`, in a CentOS 6.5 guest. – Samuel Lampa May 13 '15 at 13:49
0

I got the same error. When I tried to install VBoxGuestAdditions (Devices -> Insert Guest Additions CD Image) on Ubuntu 16.04 x86, it throws error message "Unable to insert the virtual optical disk ..."

SOLUTION: 1. Open a terminal and enter: sudo apt-get install virtualbox-guest-utils

  1. Reboot and enjoy.
Doan Quang Viet
  • 135
  • 1
  • 5
  • 1
    Downvoting: he specifically mentions CentOS in his question, which means apt is not an option (unless he's gone through the trouble of configuring his system to use it). CentOS uses yum, not apt, and it's repositories are different as well. – Sagar Apr 30 '18 at 14:56
0

sudo ./whateverTheArchitectureTypeYouHaveIs.sh worked for me. By default, VBOXAddition folder is in /media/..

Priyanka
  • 39
  • 10