Laravel Homestead/Vagrant/Virtualbox在Windows上运行缓慢 [英] Laravel Homestead/Vagrant/Virtualbox is slow on Windows

查看:247
本文介绍了Laravel Homestead/Vagrant/Virtualbox在Windows上运行缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照官方网站上的说明在Windows上安装了Laravel Homestead/Vagrant/Virtualbox

但这真的很慢.页面更新大约需要5秒钟.

这不仅是我的观察. Laracast 对此进行了讨论.

laracast论坛上有一些有趣的想法,但是那里真是一团糟(对不起Jeffery),很难理解哪些想法被接受,哪些想法被拒绝.

在Stackoverflow上,我们有一个很好的投票系统可以对可行的解决方案进行投票,并要求作者分别提供每个解决方案的更多详细信息.请发布您的解决方案和经验.

根据我的经验-曾经有一种情况,即Windows运行更新并强行关闭我的系统,而当它启动时,它的运行速度非常快(至少快10倍),但是在下一次重新启动后,它又变慢了.现在,我知道可以采取一些措施来加快速度,这不是软件配置案例,而是"slow hardware case"!

我正在Intel-Core-i7上使用Windows-10,以及Oracle Virtualbox-5.2.12 ...(一切都是最新的,没有任何更新)

解决方案

NFS代表Network File System,您需要它来提高速度.

Laravel宅基地教程 没有说明NFS是什么以及您为什么需要它,这就是为什么我在初次安装时忽略它的原因.

1)在Windows主机上,安装将NFS支持添加到Windows中的无业游民的插件.

$ vagrant plugin install vagrant-winnfsd

2)转到Homestead.yaml,它通常位于C:\Users\username\Homestead\Homestead.yaml

3)像这样在文件夹部分中添加type: "nfs":

folders:
    - map: ~/code
      to: /home/vagrant/code
      type: "nfs"

4)运行vagrant up --provision

结果:

@phazei's答案一样,每个请求的速度从8秒增加到2秒,但工作量却少得多. @phazei's答案阐明了一些后台过程.

我在Windows 10上使用Oracle Virtualbox-5.2.12,vagrant版本2.1.1对它进行了测试.

请注意: 流浪NFS页面

Windows用户:NFS文件夹在Windows主机上不起作用. Vagrant将忽略您在Windows上对NFS同步文件夹的请求.

但是,如果您拥有该插件,则可以忽略它.

I have installed Laravel Homestead/Vagrant/Virtualbox on Windows as it said on official site

But it is really slow. Page update takes about 5 seconds.

And it is not only my observation. Laracast has a discussion about it.

The laracast forum has some interesting ideas, but it is a mess there (sorry Jeffery), it is hard to understand which ideas are accepted and which is declined.

Here on Stackoverflow we have a good voting system to vote up working solutions, and request authors to give more details for each solution individually. Please post your solutions and experiences.

From my experience - there was a situation once when windows run updates and shut down my system forcefully, and when it started it was incredibly fast (10 times faster at least) but after next restart it went slow again. Now I know that something may be done to speed it up, it is not a "slow hardware case" it is a software config case!

Im using Windows-10 on Intel-Core-i7, with Oracle Virtualbox-5.2.12... (everything is latest and there is nothing to update)

解决方案

NFS stands for Network File System and you need it for speed.

Laravel homestead tutorial does not say what NFS is and why you need it, which is why I ignored it on the initial install.

1) On your Windows host, install the plugin that adds NFS support to vagrant in Windows.

$ vagrant plugin install vagrant-winnfsd

2) Go to Homestead.yaml, it usually sits in C:\Users\username\Homestead\Homestead.yaml

3) Add type: "nfs" in the folders section like so:

folders:
    - map: ~/code
      to: /home/vagrant/code
      type: "nfs"

4) Run vagrant up --provision

Result:

The speed increases, as in @phazei's answer, from 8 to 2 seconds for each request, but it is much less work. @phazei's answer clarifies some background processes.

I tested it on windows 10 with Oracle Virtualbox-5.2.12, vagrant version-2.1.1.

Please note: Vagrant NFS page says

Windows users: NFS folders do not work on Windows hosts. Vagrant will ignore your request for NFS synced folders on Windows.

But if you have the plugin, you can ignore it.

这篇关于Laravel Homestead/Vagrant/Virtualbox在Windows上运行缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆