Behat drupal 8 configuration
The login step creates a user via the Drupal API, and logs in by manually submitting the form.

When you run from within the Vagrant machine, the process presumably has access to bootstrap Drupal, and create users. When you're running from your local machine, I think only 'blackbox' tests (eg, ones that don't require API access) will work.

One potential workaround for this would be to specify in your local behat file:

api_driver: drush
drush:
  alias: 'vagrant'


and then ensure your local machine had a drush alias @vagrant setup so that you could access your vagrant Drupal instance from your local machine.