This week, I tried the new openindiana release 151a to use kvm. There’s a good post from Gray Matter Boundaries, Installing KVM and Creating a Debian VM in OpenIndiana 151a. I installed a first vm and it works nicely! So how do I start it automatically? I’m not a sysadmin, but I create a smf and a bash script that start every *.sh in /etc/kvm. It’s simple, probably not perfect and it won’t halt your vms on reboot/halt, but it did what I needed! Maybe it will help someone else. By the way, if you find a bug or want to suggest an improvement, just email me at phil (at)!

/etc/init.d/kvm (the startup script):



for f in $FILES
        $f &

kvm.xml (smf config)

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='kvm'>
   <service name='system/kvm' type='service' version='1'>
     <create_default_instance enabled='false' />
     <dependency name='multi-user-server'
        <service_fmri value='svc:/milestone/multi-user-server:default'/>
     <exec_method type='method' name='start' exec='/etc/init.d/kvm' timeout_seconds='-1' />
     <exec_method type='method' name='stop' exec=':kill' timeout_seconds='-1' />
     <stability value='Unstable' />
       <loctext xml:lang='C'> KVM start </loctext>

Install the smf config for kvm

svccfg import kvm.xml
svcadm enable kvm

That’s it, your vms should be started on reboot!

Philippe L'Heureux

Interested in Machine Learning, Scala, Haskell, Signal Processing and damn good music!