Run VirtualBox VM as a System Service

Recently, I installed Ubuntu on my last Windows server at home. There are a couple Windows-only applications that don't run in Wine, so I needed to virtualize an XP machine for those applications. One of these applications needs to run all the time as a service, and since it would be running on a Ubuntu server, I needed a way to start the VM when the physical machine starts, not when I log in. I installed VMware Server, as it has an option to start a VM on system boot. But there's a catch, the server I installed it on is a headless server, and I want to be able to control the VM from another machine without installing a full-blown VMware Server on the client machine. Then, I saw that VirtualBox has the ability to run an RDP layer on top of the VM.

 

So, I uninstalled VMware and installed the non-open-source edition of VirtualBox. The only problem is, VirtualBox does not have an option to start a VM on system boot, so I went looking for a way. After reading the documentation, I found that you can start and shutdown VMs from the terminal and it works great. Now, I just needed to have it start on boot. Since I've never written an init script before, this proved to be a little troublesome, but in the end, I got it to work. Of course, I have no idea how good or bad the implementation is, but it works. Initially, I posted a question in the Ubuntu Forums for help and ended up posting my init script. I hope it can help someone, and I also hope that some of you elite init scripters can fix my likely horrible init sciprt Smile.

 

Original post: http://ubuntuforums.org/showthread.php?t=701735

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

User login