gpt4 book ai didi

vagrant - Homestead 2.0、Vagrant 和 VirtualBox 运行速度比 MAMP 慢很多

转载 作者:行者123 更新时间:2023-12-02 01:09:04 27 4
gpt4 key购买 nike

我刚刚为在 OSX 10.10 (Yosemite) 上的 VirtualBox 上运行的 Laravel 5 设置了 Homestead 2.0 vagrant 服务器,它的运行速度比 MAMP 慢很多。

我真的很想使用 Homestead,但是加载页面 1-3 秒的延迟变得非常烦人,但每个加载请求在 MAMP 上都是即时的。

我的设置是否遗漏了某些内容?

Homestead.yaml:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2

authorize: ~/.ssh/id_rsa.pub

keys:
- ~/.ssh/id_rsa

folders:
- map: /Users/jackbarham/Code
to: /home/vagrant/Code

sites:
- map: tasks.mac
to: /home/vagrant/Code/tasks/public

databases:
- homestead

variables:
- key: APP_ENV
value: local

主机:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

192.168.10.10 tasks.mac

127.0.0.1 tasks-mamp.mac # MAMP PRO - Do NOT remove this entry!

最佳答案

我在 reddit/r/laravel 上问了同样的问题并得到了答案:

  1. 在以下位置找到 homestead.rb 文件:/Users/username/.composer/vendor/laravel/homestead/scripts

  2. 关闭虚拟机(homestead shutdown)

  3. 打开 homestead.rb 文件,第 49 行,在“# Register All Of TheConfigured Shared Folders”下进行更改:

来自:

settings["folders"].each do |folder|
config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= nil
end

至:

settings["folders"].each do |folder|
config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= nil, :nfs => true
end
config.vm.network "private_network", type: "dhcp"
  • 启动(宅基地启动),这应该会加快速度
  • 来源:http://www.reddit.com/r/laravel/comments/2vvama/homestead_20_vagrant_and_virtualbox_running_a_lot

    关于vagrant - Homestead 2.0、Vagrant 和 VirtualBox 运行速度比 MAMP 慢很多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28515827/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com