简体   繁体   中英

Vagrant unable to mount in Linux guest with VirtualBox Guest Additions on Windows 7

I'm trying to get a Linux VM using Virtual Box, Virtual Box Guest Additions, and Vagrant running and to mount a folder on my Windows 7 machine. I've tried the suggestions in this question , but still get the same error.

I'm running the following versions:

Virtual Box: 4.3.18 r96516

Virtual Box Guest Additions: 4.3.18

Vagrant: 1.6.5

Vagrant Plug-ins:

vagrant-login: 1.0.1

vagrant-share: 1.1.2

vagrant-vbguest: 0.10.0

When I run vagrant reload I get the following error:

    Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`,
nolock,vers=3,udp,noatime core /tbm
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant`,nolock,vers=3,udp,noa
time core /tbm

The error output from the last command was:

stdin: is not a tty
unknown mount option `noatime'
valid options:
  rw         mount read write (default)
  ro         mount read only
  uid       =<arg> default file owner user id
  gid       =<arg> default file owner group id
  ttl       =<arg> time to live for dentry
  iocharset =<arg> i/o charset (default utf8)
  convertcp =<arg> convert share name from given charset to utf8
  dmode     =<arg> mode of all directories
  fmode     =<arg> mode of all regular files
  umask     =<arg> umask of directories and regular files
  dmask     =<arg> umask of directories
  fmask     =<arg> umask of regular files

I've tried un-installing, installing, updating the vagrant-vbguest plugin:

vagrant plugin install vagrant-vbguest

I've tried running the following command after running vagrant ssh, but still get the same error message:

sudo ln -s /opt/VBoxGuestAdditions-4.3.18/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

I'm not super familiar with mount options, but I tried executing your command in a similar VM I'm running and got the same error regarding the noatime option.

I read through the documentation ( man 8 mount ) which states somewhere after line 300 or so, in the FILESYSTEM INDEPENDENT MOUNT OPTIONS that: Some of these options are only useful when they appear in the /etc/fstab file.

I suspect this is your problem. I edited my /ect/fstab file to change one of my mounts to /dev/mapper/precise64-root / ext4 noatime,errors=remount-ro 0 1 this option and then ran the following:

sudo mount -oremount /
vagrant@precise64:~$ mount
/dev/mapper/precise64-root on / type ext4 (rw,noatime,errors=remount-ro)
...

I edited the file again to remove the option and:

vagrant@precise64:~$ sudo mount -oremount /
vagrant@precise64:~$ mount
/dev/mapper/precise64-root on / type ext4 (rw,errors=remount-ro)
...

I don't know if you're providing these mount commands or if they come from a plugin, but it seems like (at least in your environment), the option works fine, but can't be specified on the command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM