使用laravel的人,好象一直都推荐使用homestead,所以我也就尝试了一下。由于默认的vagrant都是用的virtual box,而我一直是嫌弃他繁,而且几年前耗的资源让我心有余悸,再加上我本地本来就有Parallels Desktop,所以我就找找资料,看看能不能使用parallels。
结果是出人意料的好,官方也支持,只是需要安装个插件,戳这里看一下:https://parallels.github.io/vagrant-parallels/docs/getting-started.html,几行命令行可:vagrant plugin install vagrant-parallels,
然后就是初始化了,vagrant init laravel/homestead,这时候会跳出个选择,就象这样:
XML/HTML代码
- ==> box: Loading metadata for box 'laravel/homestead'
- box: URL: https://vagrantcloud.com/laravel/homestead
- This box can work with multiple providers! The providers that it
- can work with are listed below. Please review the list and choose
- the provider you will be working with.
- 1) hyperv
- 2) parallels
- 3) virtualbox
- 4) vmware_desktop
- Enter your choice: 2
- ==> box: Adding box 'laravel/homestead' (v8.0.0) for provider: parallels
选择2 就行了。然后就会开始下载。由于下载地址在github上面,然后实际 是在aws的S3上,痛苦的事情就这样来了。。。不爬梯子动也不动。番了墙也只有400多K,所幸,1个多小时就下载下来了。
然后vagrant up --provider=parallels,这样就好了
XML/HTML代码
- vagrant up --provider=parallels
- /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/util/which.rb:37: warning: Insecure world writable dir /server in PATH, mode 040777
- Bringing machine 'default' up with 'parallels' provider...
- ==> default: Registering VM image from the base box 'laravel/homestead'...
- ==> default: Creating new virtual machine as a linked clone of the box image...
- ==> default: Unregistering the box VM image...
- ==> default: Setting the default configuration for VM...
- ==> default: Checking if box 'laravel/homestead' version '8.0.0' is up to date...
- ==> default: Setting the name of the VM: blessappyzhancom_default_1563640904299_97304
- ==> default: Preparing network interfaces based on configuration...
- default: Adapter 0: shared
- ==> default: Clearing any previously set network interfaces...
- ==> default: Running 'pre-boot' VM customizations...
- ==> default: Booting VM...
- ==> default: Waiting for machine to boot. This may take a few minutes...
- default: SSH address: 10.211.55.9:22
- default: SSH username: vagrant
- default: SSH auth method: private key
- default: Warning: Connection refused. 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 Parallels Tools installed on the VM...
- ==> default: Parallels Tools installed on this VM are outdated! In most cases
- ==> default: this is fine but in rare cases it can cause things such as shared
- ==> default: folders to not work properly. If you see shared folder errors,
- ==> default: please update Parallels Tools within the virtual machine and
- ==> default: reload your VM.
- ==> default: Installing the proper version of Parallels Tools. This may take a few minutes...
- ==> default: Parallels Tools have been installed. Rebooting the VM...
- ==> default: Attempting graceful shutdown of VM...
- ==> default: Running 'pre-boot' VM customizations...
- ==> default: Booting VM...
- ==> default: Waiting for machine to boot. This may take a few minutes...
- ==> default: Machine booted and ready!
- ==> default: Mounting shared folders...
- default: /vagrant => /server/wwwroot/yzhan/test.com
运行一下vagrant ssh ,顺利登录,而且看到 当前项目目录下有一个 .vagrant的目录,里面都是一些配置文件等。
到此,安装结束,看了下进程,占CPU0.x,内存400多M。ssh进去后php-fpm的进程超级多。从5.6~7.3的都有。安心的用了