openmediavault-virtualbox: graceful (ACPI) shutdown or suspend virtual machines on reboot or shutdown OpenMediaVault

    • OMV 1.0

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Virtualbox's init script saves the state of each vm on shutdown. I suppose you could change this to acpi shutdown.

      /etc/init.d/vboxinit

      Source Code

      1. stop()
      2. {
      3. # vms are saved, instead of stopped.
      4. MACHINES=$($su_command "VBoxManage list runningvms | awk '{ print \$NF }' | sed -e 's/[{}]//g'")
      5. for UUID in $MACHINES; do
      6. VMNAME=$($su_command "VBoxManage showvminfo $UUID | sed -n '0,/^Name:/s/^Name:[ \t]*//p'")
      7. echo "$0: saving machine ${VMNAME} state ..."
      8. $su_command "VBoxManage controlvm $UUID savestate" >>/var/log/vb.log
      9. done
      10. }
      omv 4.1.13 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Hello,

      I also want shut down my VM when the server shuts down. Unfortunately there's no vboxinit under /etc/init.d
      There's a script called "virtualbox".
      How can I shut down of my VM before the server shuts down (via script)?
      Unfortunately under root there is no VM visually. You have to change to user "vbox". See here
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 1x 10TB WD Red Pro, 1x 3TB WD Red (both basic setup) - Digibit R1 Sat-IP-Server with SatIP-Axe-Firmware

      OMV-Server-SW: Debian Stretch with backports-Kernel (always up-to-date), OMV v4 (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.2.x), Docker with PlexMediaServer, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2