diff --git a/lib/vagrant/command/package.rb b/lib/vagrant/command/package.rb index 349c576b0..5662f8a7d 100644 --- a/lib/vagrant/command/package.rb +++ b/lib/vagrant/command/package.rb @@ -44,7 +44,7 @@ module Vagrant protected def package_base(options) - vm = VM.find(options[:base], @env) + vm = VM.new(options[:base], @env, @env.config.global, :base => true) raise Errors::BaseVMNotFound, :name => options[:base] if !vm.created? @logger.debug("Packaging base VM: #{vm.name}") package_vm(vm, options) diff --git a/lib/vagrant/vm.rb b/lib/vagrant/vm.rb index d9f88a63f..83ddccd66 100644 --- a/lib/vagrant/vm.rb +++ b/lib/vagrant/vm.rb @@ -12,7 +12,7 @@ module Vagrant attr_reader :config attr_reader :driver - def initialize(name, env, config) + def initialize(name, env, config, opts=nil) @logger = Log4r::Logger.new("vagrant::vm") @name = name @@ -21,9 +21,15 @@ module Vagrant @config = config @box = env.boxes.find(config.vm.box) - # Load the UUID if its saved. - active = env.local_data[:active] || {} - @uuid = active[@name.to_s] + opts ||= {} + if opts[:base] + # The name is the ID we use. + @uuid = name + else + # Load the UUID if its saved. + active = env.local_data[:active] || {} + @uuid = active[@name.to_s] + end # Reload ourselves to get the state reload!