#!/usr/bin/python import os, sys, subprocess, time os.environ['VBOX_USER_HOME'] = '/srv/vbox' devnull = open('/dev/null', 'wb') vml = open('/srv/vmlist', 'r') for vmd in vml: vmd = vmd.strip() if not vmd: continue name, mac, vnc, autostart = vmd.split(' ') if autostart == '1': subprocess.Popen(['/usr/local/sbin/startvm', name], env=os.environ).wait() time.sleep(2) vml.close()