Answer the question
In order to leave comments, you need to log in
How to set VirtualBox VM to autostart on host startup?
Good afternoon
System: Ubuntu 14.04.2 LTS + VirtualBox 4.3.28
User running Virtual machines: vbox
Virtual machines:
vboxmanage list vms
"1C" {c653127b-89e4-4d5d-a41a-e5f3ae4212c0}
"Win7ENG" {01dced55-6fe9-4906-b96c-694d8357a6af}
vboxmanage modifyvm VM_NAME --autostart-enabled on
- then the USERNAME.start file should appear in the VBOXAUTOSTART_DB folder (/etc/vbox).So this file appears only if I execute the command vboxmanage modifyvm VM_NAME --autostart-enabled on
for both of my existing machines.Accordingly, when I run service vboxautostart-service start
it, it either does nothing (when there is no file ), or starts both machines (when the file exists), I can't start only one machine.Answer the question
In order to leave comments, you need to log in
I didn’t quite understand how you did it, but you can simply start the VM like this:
Create a file
With the following content:
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
vboxmanage startvm 1C
vboxmanage startvm Win7ENG
chmod +x /etc/init.d/vm_start.sh
update-rc.d vm_start.sh defaults
Try to write the command in /usr/rc.local:
sudo su -c "VBoxManage startvm vmname --type headless" username
startvm - name of the virtual machine
username - username from which the virtual machines are spinning, the fact is that the command is executed from root and you need to specify the user in whose home folder the virtual machines were lying
helped me)) here in detail
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question