Frage

I got Vagrant installed and I am using a provision script provided by Vaprobash.

I havent changed a bit of that script except for the ip, which runs fine.

The problem is that Vagrant stops the box without any notice and with no apparent reason.

My suspicious go toward the battery. Mac can go to 2% of battery without auto suspending, could the box be watching that and suspending due to low battery?

Has anyone else beeing through that?

War es hilfreich?

Lösung 2

OK, so as in my comment above, I suspected Ubuntu's power management for shutting down the machine rather than Vagrant. As you probably already know, you can set the action for when battery is critically low to 'nothing' (as found in another answer):

gconftool-2 --set --type string /apps/gnome-power-manager/actions/critical_battery       nothing

Also, here I have found the same hint.

Additionally, you can play with other options if you like (found here):

/apps/gnome-power-manager/general/use_time_for_policy (false)
/apps/gnome-power-manager/thresholds/percentage_low (12)
/apps/gnome-power-manager/thresholds/percentage_critical (8)
/apps/gnome-power-manager/thresholds/percentage_action (5)
/apps/gnome-power-manager/actions/critical_battery (hibernate)

Andere Tipps

For anyone who is running a headless vagrant box and looking for a way to prevent the guest from automatically suspending itself on low-battery, the following worked for me:

within your Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.provider "virtualbox" do |v|
    v.customize ["modifyvm", :id, "--acpi", "off"]
  end

  ...
end

I wanted to add, in 4.3.30 versions of VirtualBox you can now disable this behavior:

VBoxManage setextradata global "VBoxInternal2/SavestateOnBatteryLow" 0

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top