Headless VirtualBox as Server VMs on Solaris x86 Host

I use VirtualBox a lot on both my desktop and to run a few server type VMs like an email collection server, Minecraft server for the kids and a few others. The one issue I had with running VirtualBox on the server is that it wasn’t REALLY intended to be a server virtualization platform. But I liked using VirtualBox since I can easily move VM around. So I started a quest to find out a way to have VirtualBox automatically start VMs on my Solaris x86 NAS PC.  As I mentioned in an earlier post, I use Solaris x86 as my server/nas OS purely because of the outstanding ZFS.

I came across a great tool at http://sourceforge.net/projects/vboxsvc/ that provided just what I needed. It also does way more than I’ll use at home.

The following steps assume that you already created your VMs using VirtualBox.  These steps will just add it to the vboxsvc program.

Install VirtualBox SMF service (run as root)
root@nas# gzcat COSvboxsvc-0.16.pkg.gz > /tmp/x
root@nas# pkgadd -d /tmp/x -G

Create a smf XML file for your VM (run as local user).
admin@nas$ cp /var/svc/manifest/site/vbox-svc.xml ~/vbox-mail-svc.xml

Edit your new file and change the 3 parameters to match your installation and your VM name.  Find this section,
        <instance name='VM_NAME' enabled='false'>
                <method_context working_directory='/var/tmp'>
                        <method_credential user='root' group='root' />
                </method_context>

and change it to look something like this.  For me, the VM in VB is called ‘mail’, with VB running as my local user called ‘admin’, which is in the ‘vboxuser’ group.

        <instance name='mail' enabled='false'>
                <method_context working_directory='/var/tmp'>
                        <method_credential user='admin' group='vboxuser' />
                </method_context>

Import and start the VM (run as root)
root@nas# svccfg import vbox-mail-svc.xml
root@nas# svcs -a | grep -i xvm
disabled       Jan_04   svc:/site/xvm/vbox:mail
root@nas#
svcadm enable mail

root@nas# svcs -a | grep -i xvm
online         Jan_04   svc:/site/xvm/vbox:mail

Your VM should now be running.  If you have the VirtualBox Manager window open, you can see it starting in the preview window.

A few notes on how to use it.  I created a few aliases for each VM I add that will be  useful.  These alias are for the non-root user that the VMs are actually running as.  My aliases look something like the following for each VM I have.

alias showmail="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:mail startgui"
alias startmail="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:mail start"

‘showmail’ will ‘Save the machine state’ the VM and the automatically start it back up in a GUI so that you can interact with the console window.  When you are done with the console and want to send it back into headless mode, just click on the close window button and choose to ‘Save the machine state’.  Once the VM has been saved, vboxsvc will automatically start it back up in the headless mode.

‘startmail’ is just a simple alias that will start the VM in headless mode if the VM is not actually started yet.

So for each new VM you want to add to the vboxsvr, just copy the SMF file you created, change the name of the VM and import the SMF .  Then just create a few more aliases.

alias showminecraft="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:minecraft startgui"
alias startminecraft ="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:minecraft start"

There is a lot more create details at the website listed above.
This post ‘VirtualBox as Server VMs on Solaris x86 Host’ first appeared on https://gregorygee.wordpress.com/.

MiniEdit 2.1.0.7

This is a quick small release.  It contains a bug fix and a feature that I originally dropped from the last release.

  • Bug fix in the Export not exporting controller information correctly.
  • You can import one of the MiniNet named topologies on startup.
    • sudo ./miniedit-2.1.0.7.py --topo linear,3
  • You can import a custom topology on startup.
    • sudo ./miniedit-2.1.0.7.py --custom mininet/custom/topo-2sw-2host.py --topo mytopo

Be warned that the import of the topology is pretty crude and will be limiting.  I don’t have any fancy auto layout features to nicely place icons on the screen.  Currently, I just create rows of icons.  You will need to lay them out yourself.  If someone knows of some python code that can do this autolayout, I’d be glad to hear from you.

Download MiniEdit 2.1.0.7 here.

MiniEdit 2.1.0.6

Another week, another MiniEdit drop.  One main thing is that you should be able to run this against MiniNet 2.0 now without modifying the code.  I’ve had some emails related to this.  The full feature list is below.

  • Supports running against MiniNet 2.0 systems.
  • Enable sFlow reporting.
  • Enable NetFlow reporting.
  • Bug fix in canvas scrollbar not increasing when dragging node off canvas

For sFlow and NetFlow reporting, you setup your profiles in the application preferences and then just enable sFlow and/or NetFlow on each individual switch that you want to use it for.

flow collector

If you want to try it out, I’ve been testing with these free/limited versions of collectors.

http://www.solarwinds.com/products/freetools/netflow-analyzer.aspx
http://www.inmon.com/products/sFlowTrend.php

If there are an features you’d like to see, please leave some feedback.  In a way, I’m running out of ideas for good features.  I’m sure there are some out there.

Download MiniEdit 2.1.0.6 here.