7

I have a virtualbox machine on a OSX 10.9.2 host. I do not want to open VirtualBox every time and start the machine there. Also, I do not need the the screen output, as I will just ssh from the OSX terminal anyway.

How to start the virtual machine in headless mode on system start?

15

VirtualBox comes with a series of command line tools all prefixed with VBox. The command you are looking for is

VBoxHeadless --startvm "my vm name"

You can see a short description of its options via VBoxHeadless --help.

If you don't know the name of the virtual machine you can find out via:

VBoxManage list vms

To to run upon startup on Mac OS X you can use the Automator application.

In the Automator App, select the Run Shell Script from the list and type the script:

How to add the shell script within the automator app

After saving the service, import it from System Preferences > Users & Groups > TheLoginUser > Login Items > Import the service above.

5

You can create the service without any additional apps

Open Terminal,

1 Create a file by writing

touch vm.command

2. Edit the file

vi vm.command

3. Press "i" button, then enter the following lines:

VBoxHeadless --startvm vmname

(make sure you've replaced "vmname" with actual name)

4.save the file by pressing Esc button, then typing :wq

5.allow it to run:

sudo chmod +x vm.command

7.Copy the vm.command file to Application folder

8.Now you can enable it with System Preferences > Users & Groups > TheLoginUser > Login Items > Import the service above

2

As for me nohup is essential:

$ nohup VBoxHeadless --startvm "xnode" > /dev/null &

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.