/ ... / Linux / ubuntu virtualbox / virtualbox

virtualbox

 

nano /etc/init.d/virtualbox1

 
#!/bin/bash
START="/bin/bash"
 
#if [ ! -f /etc/rc.vm ]; then
#       echo "/etc/rc.vm does not exist"
#       exit 0
#fi
 
VBOXDIR="/etc/vbox"
VM_USER="vbox"
SU="su - $VM_USER -c"
VBOXMANAGE="VBoxManage -nologo"
VM="Gateway"
 
case "$1" in
       start)
       echo -n "Starting up virtual maschine $VM"
       $SU "VBoxHeadless --startvm $VM > /dev/null 2>&1 &"
       echo "done."
       ;;
       restart)
       $SU "VBoxManage controlvm $VM reset"
       ;;
       stop)
       $SU "VBoxManage controlvm $VM savestate"
    ;;
       stopacpi)
       $SU "VBoxManage controlvm $VM acpipowerbutton"
       exit 0
       ;;
*)
       echo "Usage: $N {start|restart|stop}" >&2
       exit 1
       ;;
esac
 
exit 0

      VM, , phpvirtualbox.
      :

 

chmod +x /etc/init.d/virtualbox1
update-rc.d virtualbox1 defaults

::