Reputation: 12551
When I first initialized my vagrant box, I added some aliases to /vagrant/aliases
which is automatically copied to /home/vagrant/.bash_aliases
on each provision.
What I added at first worked pretty well for the first few months, then I decided to add some more. The new aliases aren't working at all.
I tried reprovisioning the box, and I SSH'd to the box to check the ~/.bash_aliases
file and I can see all my new aliases are in there as expected...however, trying to use one of the new aliases produces a command not found
error. All the old aliases still work.
What might be going on here?
Upvotes: 1
Views: 1727
Reputation: 1816
You could also try to provission your VM again, you can do this typing
vagrant global-status
This will give you information about your virtual machines, each one of them has an specific ID, find the one that's running homestead, it should look like this
id name provider state directory
--------------------------------------------------------------------------------------
1a2b3c4 default virtualbox running /home/dimitri/.composer/vendor/laravel/homestead
To provision again your VM and make the aliasses work without destroying your VM and creating it agait just run this command
vagrant provision 1a2b3c4
Keep in mind that the number at the end is the ID of your running VM
Upvotes: 0
Reputation: 12551
To solve this, execute . ~/.bashrc
on the command line.
Then add the following to the bottom of ~/.bash_profile
so that the aliases are loaded each time you SSH to the vagrant box:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
Upvotes: 3