如何将下载的.box文件添加到Vagrant的可用框列表中?该.box文件位于外部驱动器上.
我尝试过运行vagrant box add my-box d:/path/to/box,但Vagrant将路径解释为URL.
我不想在流浪盒上创建新的SSH密钥对,而是使用代理转发重新使用我在主机上的密钥对.我已经尝试在Vagrantfile中将config.ssh.forward_agent设置为TRUE,然后重新启动VM,并尝试使用:
vagrant ssh -- -A
Run Code Online (Sandbox Code Playgroud)
...但是当我尝试进行git checkout时,我仍然会收到提示输入密码的提示.知道我错过了什么吗?
由于宅基地2.0宅基地laravel没有工作
我不知道为什么'homestead init'在mydirectory/.homestead中创建一个Homestead.yaml文件,而不是在项目目录中.Homestead up OR Vagrant up创建以下消息
已存在名为"homestead"的VirtualBox计算机.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
A VirtualBox machine with the name 'homestead' already exists.
Please use another name or delete the machine with the existing
name, and try again.
Run Code Online (Sandbox Code Playgroud) 我刚开始使用Vagrant,我在理解一些细节方面遇到了一些麻烦.我已阅读了文档,但仍缺少一个基本概念.当我想开始一个Vagrant盒子时,我跑:
vagrant up
这将"基于盒子构建VM"我理解这些盒子存储在〜/ .vagrant.d中,实际上我已经从基础Ubuntu盒子中打包了我自己的盒子.但是,当我运行vagrant并开始向vm添加文件时,存储vm的虚拟硬盘驱动器在哪里?例如,当我运行apt-get install apache2并修改根系统时,这在哪里被修改?
当我在当前目录上执行du时,我看不到任何更改.我也没有在〜/ .vagrant.d目录中看到任何变化.但是,我可以做流浪汉停止,重新启动我的本地机器然后再次运行vagrant并且更改将持续存在.
流浪汉也报道
[default] VM already created. Booting if its not already running...
Run Code Online (Sandbox Code Playgroud)
有人能告诉我VM的创建位置以及更改的位置吗?
我有一个流浪盒正在运行(配置了LAMP堆栈).我需要将它转移到另一台PC.我该如何出口?我想我可以得到一个可以复制到另一台PC的文件(或文件),所以我可以运行一些命令来导入流浪盒.
令人惊讶的是,没有关于Vagrant命令的文档,除了"入门"教程中的参考文献.
到目前为止我已经解决了什么:
box- 管理" 盒子 "destroy - 关闭VM然后删除其存储的图像?gemhalt - 关闭VMinit - 使用新的Vagrantfile准备一个目录package - 关闭VM,然后将其转换为可以变成盒子的"包"?(或者其他的东西)provision - 只运行配置(例如,Chef,Puppet ......)阶段reload - 修改VM配置(例如,重新应用Vagrantfile),重新启动VM,重新配置resume - un-suspend(即unhibernate)ssh - 打开与VM的SSH shell连接ssh-configstatussuspend - 休眠VMup - 部分或全部:复制VM映像以创建新VM,对其应用配置,引导它我有这些权利吗?还有什么?关于reload和destroy/ 之间的确切区别,我仍然有点不清楚up.
我正在尝试使用这些说明设置Discourse开发环境.但是,当我运行Vagrant时,我得到错误:
NFS报告您的导出文件无效.在对文件进行任何更改之前,Vagrant会进行此检查.请更正以下问题并执行"vagrant reload":
无法打开/ etc/exports
我查了一下,而且我没有etc/exports文件夹,所以我创建了一个并运行了vagrant reload.这让我:
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/hosts/bsd/host.rb:146:in
read': Is a directory - /etc/exports (Errno::EISDIR) from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/hosts/bsd/host.rb:146:innfs_prune'来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/ plugins/synced_folders/nfs/synced_folder.rb:68:incleanup' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:24:inblock in call'from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:22:ineach_key' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:22:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:incall' .1/lib/vagrant/action/warden.rb:34:call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:118:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in来电'来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/env_set.rb:19:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4. 1/lib/vagrant/action/warden.rb:34:call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/provision.rb:52:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:incall'来自/ Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/set_name.rb:19:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34 :call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/check_accessible.rb:18:in来自/ Applications/Vagrant/embedded/gems/gems/vagrant -1.4.1/lib/vagrant/action/warden.rb:34:inizeize_actioncall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:95:in' …
我想使用Vagrant为我的团队提供一个共同的开发环境.主机完全不同:
在VM内部我们想要运行Linux.
到目前为止,一切都很好.
现在我们的想法是每个开发人员都应该能够使用他们选择的IDE,因此我们引入了一个同步文件夹,该文件夹共享主机和VM之间的源代码.这基本上也适用......除了符号链接.
在我们的源代码中,我们实际上有一些符号链接,这在VM内部的Linux中不是问题,但在Windows上作为主机,这会导致问题.我们唯一不能做的就是摆脱符号链接,所以我们需要另一种方法来解决这个问题.
到目前为止,我们尝试了许多选择:
symlink has no referent(每个符号链接有一个错误).我无法想象我们是这个星球上唯一或第一个遇到共享文件夹中的多平台主机和符号链接问题的人.
你如何解决这个问题,以便我们可以保持符号链接,但仍然使用不同的主机操作系统?
我是使用Laravel和Homestead的新手,并且非常感谢任何帮助或正确的方向.当我运行"php artisan serve"时,我已经成功地进入了"你已经到达"屏幕但是当我尝试通过Vagrant做同样的事情时,我得到"没有指定输入文件".我的Homestead.yaml文件如下所示:
authorize: /Users/me/.ssh/id_rsa.pub
keys:
- /Users/me/.ssh/id_rsa
folders:
- map: /Users/me/code/exampleproject
to: /home/vagrant/code/exampleproject
sites:
- map: exampleproject.app
to: /home/vagrant/code/exampleproject/public
variables:
- key: APP_ENV
value: local
Run Code Online (Sandbox Code Playgroud)
在我的电脑上,我有以下目录:
/Users/me/code/Homestead
/Users/me/code/exampleproject //this is the directory created with composer
Run Code Online (Sandbox Code Playgroud)
在我的Vagrant Box上我出于某种原因有两个名为"code"和"Code"的目录:
/home/vagrant/code/exampleproject
/home/vagrant/Code
Run Code Online (Sandbox Code Playgroud)
我已经检查过,我可以看到对我的计算机exampleproject文件所做的更改反映在vagrant box文件中.
不太确定如何解决这个问题!我真的很感激任何可能的帮助:)
我用Vagrant安装了一个新的VirtualBox机器,在那个VM里面我安装了Mysql Server.如何在虚拟机之外连接到该服务器?我已经转发了Vagrantfile的端口3306,但是当我尝试连接到mysql服务器时,它会重新发送错误:'读取初始通信包'
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Run Code Online (Sandbox Code Playgroud) vagrant ×10
virtualbox ×5
discourse ×1
export ×1
forwarding ×1
laravel ×1
laravel-4 ×1
mysql ×1
nfs ×1
rsync ×1
ssh ×1
ssh-keys ×1
sync ×1
vagrantfile ×1
windows ×1