Skip to content

Instantly share code, notes, and snippets.

@anthonywu
Created November 26, 2014 00:13
Show Gist options
  • Save anthonywu/e34847bebcc0a85bb37d to your computer and use it in GitHub Desktop.
Save anthonywu/e34847bebcc0a85bb37d to your computer and use it in GitHub Desktop.
autoenv demo for Vagrant + VirtualBox
python -c "
import json
with open('.vagrant/machines/default/virtualbox/synced_folders') as f:
sf_content = f.read()
synced_folders = json.loads(sf_content)['virtualbox']
print('Your Virtual Machine has {} synced folders\n'.format(len(synced_folders)))
for sf, sf_data in synced_folders.iteritems():
print('Sync: {} --> {}'.format(sf_data['guestpath'], sf_data['hostpath']))
"
@anthonywu
Copy link
Author

Place this .env in your Vagrant directory (same place as your VagrantFile to get a reminder of your sync-ed folders. Useful when returning to the VM after some time away.

Script can be extended to report on other stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment