问题
我在 Windows 10 上安装了 Vagrant,这样我就可以在虚拟机中创建个人本地开发环境。我读到的有关 Vagrant 的所有内容都表明我什至可以启动多个系统并通过 NAT 端口转发测试它们之间的通信。但首先,我只想在对其余部分进行过多操作之前创建一个开发环境虚拟机。
我按照此 SitePoint 教程安装了 VirtualBox、Vagrant、PuTTy 和 PuTTYGen:https://www.sitepoint.com/getting-started-vagrant-windows/ https://www.sitepoint.com/getting-started-vagrant-windows/。接下来我在 C: 驱动器上创建了一个 vagrant 项目文件夹,做了vagrant init
,删除了Vagrantfile
,最后,vagrant init ubuntu/trusty64
。然后我做了vagrant up
,但该过程失败并出现错误:
Vagrant 无法挂载 VirtualBox 共享文件夹。这通常是
因为文件系统“vboxsf”不可用。该文件系统是
通过 VirtualBox Guest Additions 和内核模块提供。
请验证这些来宾添加是否已正确安装在
客人。这不是 Vagrant 中的错误,通常是由错误引起的
流浪盒子。对于上下文,尝试的命令是:
挂载-t vboxsf -o uid=1000,gid=1000 流浪者/流浪者
该命令的错误输出是:
: 没有这样的文件或目录
这是我的 Windows 命令行的屏幕截图:
这是文本版本:
C:\vagrant\sitepoint-test-2017-02-05>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> default: have version '20160602.0.0'. The latest is version '20170202.0.0'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: sitepoint-test-2017-02-05_default_1486399403587_55255
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => C:/vagrant/sitepoint-test-2017-02-05
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
: No such file or directory
My Setup
OS: Microsoft Windows [Version 10.0.14393]
VirtualBox Version: 4.3.10 r93012
GuestAdditions Version: ???
Vagrant Version: 1.9.1 (Latest)
PuTTy Version: 0.67
PuTTYGen Version: 0.67
安装的插件和扩展
Vagrant:
- vagrant-share (1.1.6, system)
- vagrant-vbguest (0.13.0)
我已经尝试过的
这个帖子 https://stackoverflow.com/questions/22717428/vagrant-error-failed-to-mount-folders-in-linux-guest在我的研究中似乎是最有前途的。
不幸的是,没有提供任何解决方案,也没有提供任何链接解决该问题。我已经尝试了很多东西,但我不是系统管理员(我猜这是您解决此问题所需的技能)。尤其令人不安的是,2013/2014 年的许多“解决方案”最近被表明不再有效。这些解决方案讨论了与符号链接不起作用、安装 vagrant-vbguest 等插件有关的问题,以及有关 vbox 添加不匹配的问题。我不太明白这一切,但我尽力了。这是我已经尝试过但尚未解决的问题:
vagrant plugin install vagrant-vbguest
。 Vagrant 显示插件已安装,但我遇到了相同的错误vagrant up
.
-
我在研究这个问题时阅读的链接列表,但没有提供有效的解决方案。
- Vagrant 无法在 Windows 7 上使用 VirtualBox Guest Additions 挂载到 Linux guest 虚拟机中 https://stackoverflow.com/questions/26446757/vagrant-unable-to-mount-in-linux-guest-with-virtualbox-guest-additions-on-window
- Vagrant - 如何挂载 virtualbox 共享文件夹? (“vboxsf”不可用) https://stackoverflow.com/questions/41806920/vagrant-how-can-i-mount-the-virtualbox-shared-folder-vboxsf-not-available
- https://github.com/mitchellh/vagrant/issues/3341#issuecomment-144271026 https://github.com/mitchellh/vagrant/issues/3341#issuecomment-144271026
-
https://www.virtualbox.org/ticket/12879 https://www.virtualbox.org/ticket/12879(这张 VirtualBox 票证在其他一些列出的链接中被海报引用。不幸的是,这张票证没有解决问题。它没有修复并且仍然损坏......或者......也许这张票证是相关的,但略有不同比我和其他人仍然遇到的问题)。
- https://gist.github.com/fernandoaleman/5083680 https://gist.github.com/fernandoaleman/5083680
- VAGRANT 共享文件夹无法安装 - Windows 7 - Vagrant 1.7.4 - Ubuntu 12.04 precision64 - VirtualBox 5.0.10 with Guest Additions https://stackoverflow.com/questions/34405436/vagrant-shared-folders-do-not-mount-windows-7-vagrant-1-7-4-ubuntu-12-04-p
我的问题
我怀疑问题出在 VirtualBox,而不是 Vagrant。这是真的?
我该如何解决此问题以便继续学习本教程?
自 2014 年左右以来,Stack Overflow 上回答的 Vagrant 问题似乎急剧下降。这是什么原因? Vagrant/VirtualBox 不再被视为“最佳实践”吗?有没有更好的解决方案让用户忽略 Vagrant 问题?
再说一次,我不是系统管理员,但我精通技术并且可以遵循技术方向。