In VirtualBox you can use metadata with Guest Additions:

On host:
$ VBoxManage guestproperty set tmp_default_1401807955008_18757 Vagrant True

On guest:
vagrant@precise64:~$ sudo VBoxControl guestproperty get Vagrant
Oracle VM VirtualBox Guest Additions Command Line Management Interface 
Version 4.2.0
(C) 2008-2012 Oracle Corporation
All rights reserved.

Value: True

On Saturday, May 31, 2014 1:59:30 AM UTC+3, Stephen Wood wrote:
>
> Is there some immutable I can check to determine if I am in a vagrant 
> virtual environment?
>
> I'd like to set a custom grain with saltstack, but none of my ideas quite 
> hit the spot:
>
> 1. Check if /home/vagrant exists (but what if the user is deleted?)
> 2. grep vboxguest /proc/misc (What if we're using vmware?)
> 3. ??
>
> How would you guys determine if a host is indeed a vagrant virtualized 
> environment.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to