| #!/bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: save-running-virtualboxes | |
| # Required-Start: | |
| # Required-Stop: $network | |
| # Default-Start: | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Stops all running virtualboxes | |
| # Description: Stops all running virtualboxes of all users | |
| ### END INIT INFO | |
| case "$1" in | |
| stop) | |
| echo "Saving all running virtualboxes ..." | |
| for user in $(ps -ouser= -C VBoxHeadless,VirtualBox | sort -u); do | |
| for vm_name in $(su -c '/usr/bin/VBoxManage list runningvms | cut -d " " -f 1' $user); do | |
| echo "Saving box '$vm_name' of user '$user'" | |
| su -c "/usr/bin/VBoxManage controlvm $vm_name savestate" $user | |
| done | |
| done | |
| echo "Done." | |
| ;; | |
| *) | |
| echo "Usage: /etc/init.d/save-running-virtualboxes stop" | |
| exit 1 | |
| ;; | |
| esac | |
| exit 0 |
StefanNeuser
commented
Jun 10, 2014
|
Have to same issue und same idea but doesnt work for me. When i will reboot my System it idles still on 'waiting for vboxnet0 to become free' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ymc-geha commentedJan 14, 2014
INSTALL
WHY