Uhm I'm not sure about stripos, if this path is not exactly '/home/vagrant' there is a risk that this is not a vagrant VM, for example '/home/vagranter' or something like that