Skip to content

Instantly share code, notes, and snippets.

@fnordfish
Created January 31, 2012 10:05
Show Gist options
  • Save fnordfish/1709724 to your computer and use it in GitHub Desktop.
Save fnordfish/1709724 to your computer and use it in GitHub Desktop.
Educated guess the VBGuest.iso
def autodetect_iso!
if !@iso_path
iso_path = if Vagrant::Util::Platform.linux?
"/usr/share/virtualbox/VBoxGuestAdditions.iso"
elsif Vagrant::Util::Platform.darwin?
"/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso"
elsif Vagrant::Util::Platform.windows?
"%PROGRAMFILES%/VirtualBox/VBoxGuestAdditions.iso"
end
if !File.exists?(iso_path)
dvd = VirtualBox::DVD.all.find do |d|
!!(d.location =~ /VBoxGuestAdditions.iso$/)
end
iso_path = dvd.location if dvd
end
end
end
@fnordfish
Copy link
Author

  • can we use windows environment variables ?
  • where exactly is the iso located on windows ?
  • do we want to allow an array of possible locations, say ["/usr/share/...", "/opt/..."] for linux ?
  • what about generic darvin, *bsd?

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