Permalink
Browse files

Try to mount guest-additions.iso during provisioning

  • Loading branch information...
1 parent c2c1a3d commit c1b857a61dae9c1cd67b45c2546172624dfd31d0 @hh hh committed Jan 6, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/veewee/session.rb
View
@@ -278,6 +278,7 @@ def self.build(boxname,options)
add_sata_controller(boxname)
attach_disk(boxname)
mount_isofile(boxname,@definition[:iso_file])
+ mount_guest_additions(boxname, '/usr/share/virtualbox/virtualbox/VBoxGuestAdditions.iso') #actually an iso
add_ssh_nat_mapping(boxname)
#Starting machine
@@ -667,6 +668,12 @@ def self.mount_isofile(boxname,isofile)
full_iso_file=File.join(@iso_dir,isofile)
puts "Mounting cdrom: #{full_iso_file}"
#command => "${vboxcmd} storageattach '${vname}' --storagectl 'IDE Controller' --type dvddrive --port 1 --device 0 --medium '${isodst}' ";
+ command ="#{@vboxcmd} storageattach '#{boxname}' --storagectl 'IDE Controller' --type dvddrive --port 0 --device 0 --medium '#{full_iso_file}'"
+ Veewee::Shell.execute("#{command}")
+ end
+
+ def self.mount_guest_additions(boxname,isofile='/usr/share/virtualbox/VBoxGuestAdditions.iso')
+ puts "Mounting guest additions cdrom: #{iso_file}"
command ="#{@vboxcmd} storageattach '#{boxname}' --storagectl 'IDE Controller' --type dvddrive --port 1 --device 0 --medium '#{full_iso_file}'"
Veewee::Shell.execute("#{command}")
end

0 comments on commit c1b857a

Please sign in to comment.