I want certain environment variables from my host system to be visible inside my Vagrant VM, using the config.ssh.forward_env
setting. I'm using Vagrant 1.8.1. Here's my Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
config.ssh.forward_env = ['FOO']
end
After creating it, I ran these commands:
vagrant up
export FOO=bar
vagrant ssh -c 'echo $FOO'
I expected the final line to output bar
, but instead it outputs a blank line (followed by Connection to 127.0.0.1 closed.
). What am I doing wrong?