主文件夹外的 vagrant.d [英] vagrant.d outside of the home folder

查看:28
本文介绍了主文件夹外的 vagrant.d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是我的主目录实际上位于远程服务器上,而 ~/.vagrant.d 位于该服务器上,vagrant 的性能严重下降(并且文件服务器备份大小增加).

那么有没有办法至少将 ~/vagrant.d/boxes 移出主目录?

干杯.

解决方案

Vagrant 默认使用 ~/.vagrant.d.幸运的是,vagrant 提供了一个名为 VAGRANT_HOME 的环境变量,您可以通过它来设置 vagrant home.

只需执行以下操作即可更改 vagrant home(这只适用于当前会话)

导出 VAGRANT_HOME=/path/to/vagrant

要使其永久化,请将其添加到您的 ~/.bash_profile(用于登录 shell).

更新:VAGRANT_HOME 已添加到文档中 - 环境变量

<块引用>

VAGRANT_HOME 可以设置更改 Vagrant 存储全局状态的目录.默认情况下,它设置为 ~/.vagrant.d.Vagrant 主目录是存储盒子之类的东西的地方,因此它实际上可以在磁盘上变得非常大.

I've the problem that my home directory is actually located on a remote server and with ~/.vagrant.d sitting on that server, the performance of vagrant decreases heavily (and file-server backup size increases).

So is there any way to move at least ~/vagrant.d/boxes out of the home directory?

Cheers.

解决方案

By default Vagrant uses ~/.vagrant.d. Fortunately, vagrant provides an environment variable called VAGRANT_HOME by which you can set vagrant home.

Just do the following to change the vagrant home (this only works in the current session)

export VAGRANT_HOME=/path/to/vagrant

To make it permanent, add this to your ~/.bash_profile (for login shell).

Update: VAGRANT_HOME has been added to the documentation - Environmental Variables

VAGRANT_HOME can be set to change the directory where Vagrant stores global state. By default, this is set to ~/.vagrant.d. The Vagrant home directory is where things such as boxes are stored, so it can actually become quite large on disk.

这篇关于主文件夹外的 vagrant.d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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