Switch to your favorite shell in Vagrant
If you are using Vagrant and want to use your favorite shell (I mean zsh of course) inside the box, this is what you need to do:
-
Install zsh package. If you are using Chef:
package 'zsh'
Or Puppet:
package { 'zsh':
ensure => installed
}
-
Change default shell for
vagrant
user. If you are using Chef:execute "set zsh as default shell" do command "chsh -s $(which zsh) vagrant" end
Or Puppet:
user { "vagrant":
ensure => present,
shell => "/bin/zsh", # or "/usr/bin/zsh" depending on guest OS (check it by running `which zsh`)
}
Typically it is written in your "work machine" cookbook (or manifest), so you could use it across different projects.
Written by Anton Kalyaev
Related protips
4 Responses
On Ubuntu, it's usually /usr/bin/zsh
over 1 year ago
·
@vassilevsky, thanks for spotting this! Updated it.
over 1 year ago
·
I'm an occasional / first time Chef user. Where exactly, in what file(s), do I add those lines?
over 1 year ago
·
@dandv for chef it is usually <name_of_your_cookbook>/recipes/default.rb
(e.g. workwm/recipes/default.rb
)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#