diff --git a/plugins/guests/ubuntu/cap/mount_nfs.rb b/plugins/guests/ubuntu/cap/mount_nfs.rb new file mode 100644 index 000000000..917be8e56 --- /dev/null +++ b/plugins/guests/ubuntu/cap/mount_nfs.rb @@ -0,0 +1,18 @@ +require_relative '../../linux/cap/mount_nfs' + +module VagrantPlugins + module GuestUbuntu + module Cap + class MountNFS < GuestLinux::Cap::MountNFS + def self.mount_nfs_folder(machine, ip, folders) + super + # Emit an upstart events if upstart is available + folders.each do |name, opts| + real_guestpath = machine.guest.capability(:shell_expand_guest_path, opts[:guestpath]) + machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{real_guestpath}") + end + end + end + end + end +end diff --git a/plugins/guests/ubuntu/cap/mount_virtualbox_shared_folder.rb b/plugins/guests/ubuntu/cap/mount_virtualbox_shared_folder.rb new file mode 100644 index 000000000..d72786535 --- /dev/null +++ b/plugins/guests/ubuntu/cap/mount_virtualbox_shared_folder.rb @@ -0,0 +1,14 @@ +require_relative '../../linux/cap/mount_virtualbox_shared_folder' + +module VagrantPlugins + module GuestUbuntu + module Cap + class MountVirtualBoxSharedFolder < GuestLinux::Cap::MountVirtualBoxSharedFolder + def self.mount_virtualbox_shared_folder(machine, name, guestpath, options) + super + machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}") + end + end + end + end +end diff --git a/plugins/guests/ubuntu/plugin.rb b/plugins/guests/ubuntu/plugin.rb index 38e054972..40927f00b 100644 --- a/plugins/guests/ubuntu/plugin.rb +++ b/plugins/guests/ubuntu/plugin.rb @@ -15,6 +15,17 @@ module VagrantPlugins require_relative "cap/change_host_name" Cap::ChangeHostName end + + guest_capability("ubuntu", "mount_virtualbox_shared_folder") do + require_relative "cap/mount_virtualbox_shared_folder" + Cap::MountVirtualBoxSharedFolder + end + + #I don't know if this works or not + #guest_capability("linux", "mount_nfs_folder") do + # require_relative "cap/mount_nfs" + # Cap::MountNFS + #end end end end