Vagrant 无法使用 Windows 7 上的 VirtualBox Guest Additions 在 Linux 客户机中挂载
我正在尝试使用 Virtual Box、Virtual Box Guest Additions 和 Vagrant 运行 Linux VM,并在我的 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.
我正在运行以下版本:
虚拟盒子:4.3.18 r96516
Virtual Box: 4.3.18 r96516
Virtual Box Guest 添加:4.3.18
Virtual Box Guest Additions: 4.3.18
流浪者:1.6.5
Vagrant 插件:
Vagrant Plug-ins:
流浪登录:1.0.1
无业游民共享:1.1.2
vagrant-share: 1.1.2
流浪者-vbguest:0.10.0
vagrant-vbguest: 0.10.0
当我运行 vagrant reload 时,出现以下错误:
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
我尝试卸载、安装、更新 vagrant-vbguest 插件:
I've tried un-installing, installing, updating the vagrant-vbguest plugin:
vagrant plugin install vagrant-vbguest
我在运行 vagrant ssh 后尝试运行以下命令,但仍然收到相同的错误消息:
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
我对挂载选项不是很熟悉,但我尝试在我正在运行的类似 VM 中执行您的命令,但在 noatime 选项方面遇到了相同的错误.
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.
我通读了文档 (man 8 mount
),该文档在 FILESYSTEM INDEPENDENT MOUNT OPTIONS
中的第 300 行左右之后说明: 其中一些选项仅在出现在/etc/fstab 文件中时才有用.
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.
我怀疑这是你的问题.我编辑了我的/ect/fstab 文件以将我的一个挂载更改为 /dev/mapper/precise64-root/ext4 noatime,errors=remount-ro 0 1
这个选项,然后运行以下命令:
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.