Often times we want to run a single command in Vagrant, but doing this seems to take too long:
-> vagrant ssh Last login: Fri Jul 12 14:55:21 2013 from 10.0.2.2 Welcome to your Vagrant-built virtual machine. -> sudo service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] -> exit
Instead, why not send the single command straight to Vagrant. Using the undocumented "-c" flag you can send a command straight to vagrant.
-> vagrant ssh -c 'sudo service httpd restart' Stopping httpd: [ OK ] Starting httpd: [ OK ]