un altro luogo (il luogo dove radice leggi variabili ENV) è in shared_helpers.rb, linea 71 (v vagrant 1.6.5):
# This returns the path to the ~/.vagrant.d folder where Vagrant's
# per-user state is stored.
#
# @return [Pathname]
def self.user_data_path
# Use user spcified env var if available
path = ENV["VAGRANT_HOME"]
# On Windows, we default to the USERPROFILE directory if it
# is available. This is more compatible with Cygwin and sharing
# the home directory across shells.
if !path && ENV["USERPROFILE"]
path = "#{ENV["USERPROFILE"]}/.vagrant.d"
end
# Fallback to the default
path ||= "~/.vagrant.d"
Pathname.new(path).expand_path
end
Comunque, penso che il modo migliore è usare la variabile d'ambiente VAGRANT_HOME, in caso di aggiornamento della versione vagabonda.
È possibile utilizzare questa funzione come:
disk_path = self.user_data_path().to_s
In realtà ho scoperto che VAGRANT_HOME deve essere impostato e che il la proprietà "machinefolder" in VirtualBox deve essere impostata tramite "VBoxManage setproperty machinefolder" __ Grazie per il suggerimento –
pagid
grazie per questo post !!! – Robert
Le mie scoperte personali: quando rendi la variabile di ambiente permanente (in '~/.bash_profile' o se usi ZSH in' ~/.zshrc', ecc.), Assicurati di scrivere anche 'export'. Controlla se è impostato con 'env' sulla riga di comando. Quando si utilizza virtualbox come provider, c'è anche un'impostazione nella GUI per il suo percorso predefinito. – Urs