Eri*_*010 33 windows virtualbox shared-directory vagrant vagrant-windows
我在Windows 10上安装了Vagrant,因此我可以在虚拟机中创建个人本地开发环境.我读到的关于Vagrant的一切都说我甚至可以通过NAT端口转发来启动多个系统并测试它们之间的通信.但首先,我只是希望在我与其余部分进行过多讨论之前创建一个开发环境虚拟机.
我按照SitePoint教程安装了VirtualBox,Vagrant,PuTTy和PuTTYGen: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和内核模块提供.请验证这些客人添加内容是否已在guest虚拟机中正确安装.这不是Vagrant中的错误,通常是由错误的Vagrant框引起的.对于上下文,尝试的命令是:
mount -t vboxsf -o uid = 1000,gid = 1000 vagrant/vagrant
该命令的错误输出是:
: 没有相应的文件和目录
这是我的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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
Vagrant:
- vagrant-share (1.1.6, system)
- vagrant-vbguest (0.13.0)
Run Code Online (Sandbox Code Playgroud)
这篇文章似乎是我研究中最有希望的.
不幸的是,提供的解决方案和提供的任何链接都没有解决问题.我已经尝试了很多东西,但我不是系统管理员(我猜这是你需要对此进行故障排除的技能组合).特别令人不安的是,2013/2014年的许多"解决方案"最近被证明不再有效.这些解决方案涉及与无法正常工作的符号链接有关,安装像vagrant-vbguest这样的插件,以及关于vbox添加不匹配的东西.我并不是真的了解所有这些,但我尽我所能.这是我已经尝试过的尚未解决的问题:
vagrant plugin install vagrant-vbguest
.Vagrant将插件显示为已安装,但我收到相同的错误vagrant up
.
我在研究这个没有提供有效解决方案的问题时读过的链接列表.
我怀疑问题出在VirtualBox上,而不是Vagrant.这是真的?
我该如何解决这个问题,以便继续学习本教程?
自2014年左右以来,Stack Overflow上回答的Vagrant问题似乎有了大幅下降.这是什么原因?Vagrant/VirtualBox不再被视为"最佳实践"吗?是否有更好的解决方案,因此用户忽略了流浪者的问题?
同样,我不是系统管理员,但我技术精湛,可以遵循技术指导.
小智 28
您可以降级VirtualBox或编辑文件中的行:
在我的设置上,这是第206行:
C:\ HashiCorp \流浪\嵌入\宝石\宝石\流浪-1.9.2\lib中\流浪\ UTIL\platform.rb
在我的主机上.
我这样做了,它在Windows 10上运行良好!我想添加我对第206行所做的事情:
编辑前:"\\?\"+ path.gsub("/","\")
编辑后:path.gsub("/","\")
小智 27
vagrant plugin install vagrant-vbguest
Run Code Online (Sandbox Code Playgroud)
这对我来说不起作用,它似乎与vagrant 1.9.2不兼容,我卸载了最新版本的虚拟盒子(5.1.16)并安装了最新版本的vagrant 1.9.2和宅基地版本5.1.12.这个对我有用.
YUS*_*DIZ 13
Guest Additions与VirtualBox的版本不兼容.自动更新VirtualBox Guest Additions将解决可能相关的问题:
vagrant plugin安装vagrant-vbguest
我用这些堆栈解决了这个问题:
可能有多种原因:
vagrant plugin install vagrant-vbguest
我有同样的问题,这只是客户添加不是最新的...
UDPATE:Vagrant with Windows on Windows(第2点)的错误已在5.1.18版中修复,重新出现在版本5.1.20中,并在5.2版中再次修复.
归档时间: |
|
查看次数: |
30976 次 |
最近记录: |