+ self.out.output("Starting windows VM ...", False)
+
+ def random_mac():
+ mac = [0x00, 0x16, 0x3e,
+ random.randint(0x00, 0x7f),
+ random.randint(0x00, 0xff),
+ random.randint(0x00, 0xff)]
+ return ':'.join(map(lambda x: "%02x" % x, mac))
+
+ vm = kvm('-smp', '1', '-m', '1024', '-drive',
+ 'file=%s,format=raw,cache=none,if=virtio' %
+ self.image.device,
+ '-netdev', 'type=user,hostfwd=tcp::445-:445,id=netdev0',
+ '-device', 'virtio-net-pci,mac=%s,netdev=netdev0' %
+ random_mac(), '-vnc', ':0', _bg=True)
+ time.sleep(30)
+ self.out.success('done')
+ vm.wait()