vmtools/autostartvm
cecilkorik 7b51226796 initial import
--HG--
branch : vmtools
2011-03-05 08:34:41 +00:00

20 lines
395 B
Python
Executable file

#!/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()