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

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.