linux guest running as a service on a Windows host

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Posts: 32
Joined: 6. Mar 2009, 15:27

linux guest running as a service on a Windows host

Post by rasker »

I have spent some time researching options other than vboxvmservice for running virtualbox virtual machines as services on windows. I'm posting this mainly as a reference for myself and to save other people time if they need to do this.

I wanted to see why the usual method for running an application as a service did not work and why vbox had special needs.

The usual methods:


A howto for srvany here


A howto for NT Wrapper here

Basically when either of these methods closes a virtual machine they terminate the process and either leave the virtual machine running or kill it without putting the virtual machine into a safe state first.


Srvstart appears to have some functionality that might work. I guess it is very similar to VboxVMService but has slimmer requirements (Visual c++ redistributable only).

A howto for srvstart here

I have found that srvstart works quite well. The main issue with srvstart is it's simplicity (as well as it's benefit). You can build you environment up using environment variables, you can set an external program up to test whether the service is running and also to stop the service. You can also set timeouts for the service. It's not very clever at parsing parameters, so you have to get your configuration right or it throws out (meaningful but) obtuse win32 system error messages. Another issue is that one cannot redirect stdout/stderr so the service needs to open a console or virtualbox fails to start. Bearing these issues in mind srvstart does what it says on the box and does it with great flexibility.

Here are some other tools to have handy when working with virtualbox when running as a service:
Posts: 2
Joined: 29. Sep 2011, 06:37
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 8 Developer Preview

Re: linux guest running as a service on a Windows host

Post by CoreTech »

AlwaysUp is another commercial option. Check out this step-by-step guide showing how to run VirtualBox as a Windows Service with AlwaysUp.
Post Reply