Drush

Drush vagrant site alias

Submitted by superadmin on Mon, 02/15/2016 - 21:22

Took me a while to figure this out so I thought I'd share it here.

 Do not use 127.0.0.1 or localhost in the remote-host field. Instead use a valid hostname that is in your /etc/hosts.

$aliases['mysite'] = array(
  'root' => '/vagrant/docroot',
  'remote-host' => 'mysite.local',
  'remote-user' => 'vagrant',
  'ssh-options' => "-p 2222 -i /var/www/mysite/.vagrant/machines/default/virtualbox/private_key",
  'uri' => 'mysite.local:8001',
);
 

Tags