# HG changeset patch # User mb # Date 1386176466 -3600 # Node ID 27aa3b16eebb9b0b8106123ac69dd3b95dbdc2ff # Parent 67b71eb218aa42b0fdf14520f4ac3937e8969a60 corrections in vmmanager.py diff -r 67b71eb218aa -r 27aa3b16eebb server/vmmanager/vmmanager.py --- a/server/vmmanager/vmmanager.py Wed Dec 04 15:00:32 2013 +0100 +++ b/server/vmmanager/vmmanager.py Wed Dec 04 18:01:06 2013 +0100 @@ -74,8 +74,8 @@ #list the hostonly IFs exposed by the VBox host def getHostOnlyIFs(self): - cmd = ['VBoxManage list hostonlyifs'] - result = self.execute(cmd) + cmd = 'VBoxManage list hostonlyifs' + result = self.execute(cmd)[1] if result=='': return None props = dict((k.strip(),v.strip().strip('"')) for k,v in (line.split(':', 1) for line in result.strip().splitlines())) @@ -107,7 +107,7 @@ # list all existing VMs registered with VBox def listVM(self): cmd = 'VBoxManage list vms' - result = self.execute(cmd) + result = self.execute(cmd)[1] vms = list(k.strip().strip('"') for k,_ in (line.split(' ') for line in result.splitlines())) return vms @@ -153,17 +153,17 @@ cmd = 'vboxmanage dhcpserver modify --ifname \"VirtualBox Host-Only Ethernet Adapter\" --ip 192.168.56.1 --netmask 255.255.255.0 --lowerip 192.168.56.100 --upperip 192.168.56.255' self.execute(cmd) - #create new virtual machine instance based on template vm named SecurityVM (\SecurityVM\SecurityVM.vdi) + #create new virtual machine instance based on template vm named SecurityDVM (\SecurityDVM\SecurityDVM.vmdk) def createVM(self, vm_name): hostonly_if = self.getHostOnlyIFs() machineFolder = self.getDefaultMachineFolder() - cmd = 'VBoxManage createvm --name ' + vm_name, ' --ostype Debian --register' + cmd = 'VBoxManage createvm --name ' + vm_name + ' --ostype Debian --register' self.execute(cmd) - cmd = 'VBoxManage modifyvm ' + vm_name + ' --memory 512 --vram 10 --cpus 1 --usb on --usbehci on --nic1 hostonly --hostonlyadapter1 ' + hostonly_if['Name'] + ' --nic2 nat' + cmd = 'VBoxManage modifyvm ' + vm_name + ' --memory 512 --vram 10 --cpus 1 --usb on --usbehci on --nic1 hostonly --hostonlyadapter1 \"' + hostonly_if['Name'] + '\" --nic2 nat' self.execute(cmd) - cmd = 'VBoxManage storagectl ' + vm_name + ' --name contr1 --add sata --sataportcount 2' + cmd = 'VBoxManage storagectl ' + vm_name + ' --name contr1 --add sata --portcount 2' self.execute(cmd) - cmd = 'VBoxManage storageattach ' + vm_name + ' --storagectl contr1 --port 0 --device 0 --type hdd --mtype normal --medium '+ machineFolder + '\SecurityVM\SecurityVM.vdi' + cmd = 'VBoxManage storageattach ' + vm_name + ' --storagectl contr1 --port 0 --device 0 --type hdd --mtype normal --medium \"'+ machineFolder + '\SecurityDVM\SecurityDVM.vmdk\"' self.execute(cmd) return @@ -301,9 +301,12 @@ man.cygwin_path = 'c:\\cygwin64\\bin\\' #man.handleDeviceChange() #print man.listSDVM() - man.configureHostNetworking() - vm_name = "SecurityDVM0" - man.genCertificateISO(vm_name) + #man.configureHostNetworking() + new_vm = man.generateSDVMName() + man.createVM(new_vm) + man.genCertificateISO(new_vm) + man.attachCertificateISO(new_vm) + #man.attachCertificateISO(vm_name) #man.sshGuestExecute(vm_name, "ls") #man.sshGuestX11Execute(vm_name, "iceweasel") diff -r 67b71eb218aa -r 27aa3b16eebb server/windows/USBEventSvc/USBEventSvc.sdf Binary file server/windows/USBEventSvc/USBEventSvc.sdf has changed diff -r 67b71eb218aa -r 27aa3b16eebb server/windows/USBEventSvc/USBEventSvc.v12.suo Binary file server/windows/USBEventSvc/USBEventSvc.v12.suo has changed