How to tell if I am inside a Vagrant host?
问题 Whats a bulletproof way to determine if I am running inside a vagrant machine? Guest OS is Debian Linux, though if there are indicators per-os that would be great to have documented as well. 回答1: AFAIK, there isn't a way outside of your own customizations. One idea that comes to mind is to touch a file that you then reference from your apps. Add something like config.vm.provision "shell", inline: "touch /etc/is_vagrant_vm" to the bottom of your Vagrantfile and base your conditionals around