mb@7
|
1 |
'''
|
mb@7
|
2 |
Created on Nov 19, 2013
|
mb@7
|
3 |
|
mb@7
|
4 |
@author: BarthaM
|
mb@7
|
5 |
'''
|
mb@7
|
6 |
import os
|
mb@7
|
7 |
import os.path
|
mb@7
|
8 |
from subprocess import Popen, PIPE, call
|
mb@7
|
9 |
import subprocess
|
mb@7
|
10 |
import sys
|
mb@7
|
11 |
import re
|
om@19
|
12 |
import _winreg
|
om@18
|
13 |
from cygwin import Cygwin
|
mb@7
|
14 |
|
om@19
|
15 |
|
mb@7
|
16 |
DEBUG = True
|
mb@7
|
17 |
|
mb@7
|
18 |
class USBFilter:
|
mb@7
|
19 |
vendorid = ""
|
mb@7
|
20 |
productid = ""
|
mb@7
|
21 |
revision = ""
|
mb@7
|
22 |
|
mb@7
|
23 |
def __init__(self, vendorid, productid, revision):
|
mb@7
|
24 |
self.vendorid = vendorid.lower()
|
mb@7
|
25 |
self.productid = productid.lower()
|
mb@7
|
26 |
self.revision = revision.lower()
|
mb@7
|
27 |
return
|
mb@7
|
28 |
|
mb@7
|
29 |
def __eq__(self, other):
|
mb@7
|
30 |
return self.vendorid == other.vendorid and self.productid == other.productid and self.revision == other.revision
|
mb@7
|
31 |
|
mb@7
|
32 |
def __hash__(self):
|
mb@7
|
33 |
return hash(self.vendorid) ^ hash(self.productid) ^ hash(self.revision)
|
mb@7
|
34 |
|
mb@7
|
35 |
def __repr__(self):
|
mb@7
|
36 |
return "VendorId = \'" + str(self.vendorid) + "\' ProductId = \'" + str(self.productid) + "\' Revision = \'" + str(self.revision) + "\'"
|
mb@7
|
37 |
|
mb@7
|
38 |
|
mb@7
|
39 |
class VMManager(object):
|
mb@7
|
40 |
vmRootName = "SecurityDVM"
|
mb@7
|
41 |
systemProperties = None
|
mb@7
|
42 |
cygwin_path = 'c:\\cygwin64\\bin\\'
|
om@19
|
43 |
vboxManage = 'VBoxManage'
|
mb@7
|
44 |
|
mb@7
|
45 |
def __init__(self):
|
om@31
|
46 |
self.cygwin_path = os.path.join(Cygwin.root(), 'bin') + os.path.sep
|
om@22
|
47 |
self.vboxManage = os.path.join(self.getVBoxManagePath(), 'VBoxManage')
|
mb@7
|
48 |
self.systemProperties = self.getSystemProperties()
|
mb@7
|
49 |
return
|
mb@7
|
50 |
|
mb@7
|
51 |
def execute(self, cmd):
|
mb@7
|
52 |
if DEBUG:
|
mb@7
|
53 |
print('trying to launch: ' + cmd)
|
mb@7
|
54 |
process = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
mb@7
|
55 |
if DEBUG:
|
mb@7
|
56 |
print('launched: ' + cmd)
|
mb@7
|
57 |
result = process.wait()
|
mb@7
|
58 |
res_stdout = process.stdout.read();
|
mb@7
|
59 |
res_stderr = process.stderr.read();
|
mb@7
|
60 |
if DEBUG:
|
mb@7
|
61 |
if res_stdout != "":
|
mb@7
|
62 |
print res_stdout
|
mb@7
|
63 |
if res_stderr != "":
|
mb@7
|
64 |
print res_stderr
|
mb@7
|
65 |
return result, res_stdout, res_stderr
|
mb@7
|
66 |
|
om@19
|
67 |
def getVBoxManagePath(self):
|
om@19
|
68 |
"""get the path to the VirtualBox installation on this system"""
|
om@19
|
69 |
p = None
|
om@19
|
70 |
try:
|
om@19
|
71 |
k = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\Oracle\VirtualBox')
|
om@19
|
72 |
p = _winreg.QueryValueEx(k, 'InstallDir')[0]
|
om@19
|
73 |
_winreg.CloseKey(k)
|
om@19
|
74 |
except:
|
om@19
|
75 |
pass
|
om@19
|
76 |
return p
|
om@19
|
77 |
|
BarthaM@8
|
78 |
# return hosty system properties
|
mb@7
|
79 |
def getSystemProperties(self):
|
om@22
|
80 |
cmd = self.vboxManage + ' list systemproperties'
|
mb@7
|
81 |
result = self.execute(cmd)
|
mb@7
|
82 |
if result[1]=='':
|
mb@7
|
83 |
return None
|
mb@7
|
84 |
props = dict((k.strip(),v.strip().strip('"')) for k,v in (line.split(':', 1) for line in result[1].strip().splitlines()))
|
mb@7
|
85 |
return props
|
BarthaM@8
|
86 |
|
BarthaM@8
|
87 |
# return the folder containing the guest VMs
|
mb@7
|
88 |
def getDefaultMachineFolder(self):
|
mb@7
|
89 |
return self.systemProperties["Default machine folder"]
|
mb@7
|
90 |
|
BarthaM@8
|
91 |
#list the hostonly IFs exposed by the VBox host
|
mb@7
|
92 |
def getHostOnlyIFs(self):
|
mb@11
|
93 |
cmd = 'VBoxManage list hostonlyifs'
|
mb@11
|
94 |
result = self.execute(cmd)[1]
|
mb@7
|
95 |
if result=='':
|
mb@7
|
96 |
return None
|
mb@7
|
97 |
props = dict((k.strip(),v.strip().strip('"')) for k,v in (line.split(':', 1) for line in result.strip().splitlines()))
|
mb@7
|
98 |
return props
|
mb@7
|
99 |
|
mb@7
|
100 |
def listRSDS(self):
|
mb@7
|
101 |
cmd = 'VBoxManage list usbhost'
|
mb@12
|
102 |
results = self.execute(cmd)[1]
|
mb@7
|
103 |
results = results.split('Host USB Devices:')[1].strip()
|
mb@7
|
104 |
|
mb@7
|
105 |
items = list( "UUID:"+result for result in results.split('UUID:') if result != '')
|
mb@7
|
106 |
rsds = dict()
|
mb@7
|
107 |
for item in items:
|
mb@7
|
108 |
props = dict()
|
mb@7
|
109 |
for line in item.splitlines():
|
mb@7
|
110 |
if line != "":
|
mb@7
|
111 |
k,v = line[:line.index(':')].strip(), line[line.index(':')+1:].strip()
|
mb@7
|
112 |
props[k] = v;
|
mb@7
|
113 |
|
mb@7
|
114 |
if 'Product' in props.keys() and props['Product'] == 'Mass Storage':
|
mb@7
|
115 |
usb_filter = USBFilter( re.search(r"\((?P<vid>[0-9A-Fa-f]+)\)", props['VendorId']).groupdict()['vid'],
|
mb@7
|
116 |
re.search(r"\((?P<pid>[0-9A-Fa-f]+)\)", props['ProductId']).groupdict()['pid'],
|
mb@7
|
117 |
re.search(r"\((?P<rev>[0-9A-Fa-f]+)\)", props['Revision']).groupdict()['rev'] )
|
mb@7
|
118 |
rsds[props['UUID']] = usb_filter;
|
mb@7
|
119 |
if DEBUG:
|
mb@7
|
120 |
print filter
|
mb@7
|
121 |
return rsds
|
mb@7
|
122 |
|
BarthaM@8
|
123 |
# list all existing VMs registered with VBox
|
mb@7
|
124 |
def listVM(self):
|
mb@7
|
125 |
cmd = 'VBoxManage list vms'
|
mb@11
|
126 |
result = self.execute(cmd)[1]
|
mb@7
|
127 |
vms = list(k.strip().strip('"') for k,_ in (line.split(' ') for line in result.splitlines()))
|
mb@7
|
128 |
return vms
|
mb@7
|
129 |
|
BarthaM@8
|
130 |
# list existing SDVMs
|
mb@7
|
131 |
def listSDVM(self):
|
mb@7
|
132 |
vms = self.listVM()
|
mb@7
|
133 |
svdms = []
|
mb@7
|
134 |
for vm in vms:
|
mb@7
|
135 |
if vm.startswith(self.vmRootName) and vm != self.vmRootName:
|
mb@7
|
136 |
svdms.append(vm)
|
mb@7
|
137 |
return svdms
|
mb@7
|
138 |
|
BarthaM@8
|
139 |
# generate valid (not already existing SDVM name). necessary for creating a new VM
|
mb@7
|
140 |
def generateSDVMName(self):
|
mb@7
|
141 |
vms = self.listVM()
|
mb@7
|
142 |
for i in range(0,999):
|
mb@7
|
143 |
if(not self.vmRootName+str(i) in vms):
|
mb@7
|
144 |
return self.vmRootName+str(i)
|
mb@7
|
145 |
return ''
|
mb@7
|
146 |
|
BarthaM@8
|
147 |
# return the RSDs attached to all existing SDVMs
|
BarthaM@8
|
148 |
def getAttachedRSDs(self):
|
BarthaM@8
|
149 |
vms = self.listSDVM()
|
BarthaM@8
|
150 |
attached_devices = dict()
|
BarthaM@8
|
151 |
for vm in vms:
|
BarthaM@8
|
152 |
rsd_filter = self.getUSBFilter(vm)
|
mb@12
|
153 |
if rsd_filter != None:
|
BarthaM@8
|
154 |
attached_devices[vm] = rsd_filter
|
BarthaM@8
|
155 |
return attached_devices
|
BarthaM@8
|
156 |
|
BarthaM@8
|
157 |
# configures hostonly networking and DHCP server. requires admin rights
|
BarthaM@8
|
158 |
def configureHostNetworking(self):
|
BarthaM@8
|
159 |
#cmd = 'vboxmanage list hostonlyifs'
|
BarthaM@8
|
160 |
#self.execute(cmd)
|
BarthaM@8
|
161 |
#cmd = 'vboxmanage hostonlyif remove \"VirtualBox Host-Only Ethernet Adapter\"'
|
BarthaM@8
|
162 |
#self.execute(cmd)
|
BarthaM@8
|
163 |
#cmd = 'vboxmanage hostonlyif create'
|
BarthaM@8
|
164 |
#self.execute(cmd)
|
BarthaM@8
|
165 |
cmd = 'vboxmanage hostonlyif ipconfig \"VirtualBox Host-Only Ethernet Adapter\" --ip 192.168.56.1 --netmask 255.255.255.0'
|
BarthaM@8
|
166 |
self.execute(cmd)
|
BarthaM@8
|
167 |
#cmd = 'vboxmanage dhcpserver add'
|
BarthaM@8
|
168 |
#self.execute(cmd)
|
BarthaM@8
|
169 |
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'
|
BarthaM@8
|
170 |
self.execute(cmd)
|
BarthaM@8
|
171 |
|
mb@11
|
172 |
#create new virtual machine instance based on template vm named SecurityDVM (\SecurityDVM\SecurityDVM.vmdk)
|
BarthaM@8
|
173 |
def createVM(self, vm_name):
|
BarthaM@8
|
174 |
hostonly_if = self.getHostOnlyIFs()
|
BarthaM@8
|
175 |
machineFolder = self.getDefaultMachineFolder()
|
mb@11
|
176 |
cmd = 'VBoxManage createvm --name ' + vm_name + ' --ostype Debian --register'
|
BarthaM@8
|
177 |
self.execute(cmd)
|
mb@11
|
178 |
cmd = 'VBoxManage modifyvm ' + vm_name + ' --memory 512 --vram 10 --cpus 1 --usb on --usbehci on --nic1 hostonly --hostonlyadapter1 \"' + hostonly_if['Name'] + '\" --nic2 nat'
|
BarthaM@8
|
179 |
self.execute(cmd)
|
mb@11
|
180 |
cmd = 'VBoxManage storagectl ' + vm_name + ' --name contr1 --add sata --portcount 2'
|
BarthaM@8
|
181 |
self.execute(cmd)
|
mb@12
|
182 |
cmd = 'VBoxManage storageattach ' + vm_name + ' --storagectl contr1 --port 0 --device 0 --type hdd --medium \"'+ machineFolder + '\SecurityDVM\SecurityDVM.vmdk\"'
|
mb@12
|
183 |
#--mtype immutable
|
BarthaM@8
|
184 |
self.execute(cmd)
|
BarthaM@8
|
185 |
return
|
BarthaM@8
|
186 |
|
BarthaM@8
|
187 |
#remove VM from the system. should be used on VMs returned by listSDVMs
|
BarthaM@8
|
188 |
def removeVM(self, vm_name):
|
BarthaM@8
|
189 |
print('removing ' + vm_name)
|
BarthaM@8
|
190 |
cmd = 'VBoxManage unregistervm', vm_name, '--delete'
|
BarthaM@8
|
191 |
print self.execute(cmd)
|
BarthaM@8
|
192 |
machineFolder = self.getDefaultMachineFolder()
|
BarthaM@8
|
193 |
cmd = self.cygwin_path+'bash.exe --login -c \"rm -rf ' + machineFolder + '\\' + vm_name + '*\"'
|
BarthaM@8
|
194 |
print self.execute(cmd)
|
BarthaM@8
|
195 |
|
BarthaM@8
|
196 |
# start VM
|
BarthaM@8
|
197 |
def startVM(self, vm_name):
|
BarthaM@8
|
198 |
print('starting ' + vm_name)
|
BarthaM@8
|
199 |
cmd = 'VBoxManage startvm ' + vm_name + ' --type headless'
|
BarthaM@8
|
200 |
print self.execute(cmd)
|
BarthaM@8
|
201 |
|
BarthaM@8
|
202 |
# stop VM
|
BarthaM@8
|
203 |
def stopVM(self, vm_name):
|
BarthaM@8
|
204 |
print('stopping ' + vm_name)
|
BarthaM@8
|
205 |
cmd = 'VBoxManage controlvm ' + vm_name + ' poweroff'
|
BarthaM@8
|
206 |
print self.execute(cmd)
|
BarthaM@8
|
207 |
|
BarthaM@8
|
208 |
# return the hostOnly IP for a running guest
|
BarthaM@8
|
209 |
def getHostOnlyIP(self, vm_name):
|
BarthaM@8
|
210 |
print('gettting hostOnly IP address ' + vm_name)
|
BarthaM@8
|
211 |
cmd = 'VBoxManage guestproperty get ' + vm_name + ' /VirtualBox/GuestInfo/Net/0/V4/IP'
|
BarthaM@8
|
212 |
result = self.execute(cmd)
|
BarthaM@8
|
213 |
if result=='':
|
BarthaM@8
|
214 |
return None
|
BarthaM@8
|
215 |
result = result[1]
|
BarthaM@8
|
216 |
return result[result.index(':')+1:].strip()
|
BarthaM@8
|
217 |
|
BarthaM@8
|
218 |
# attach removable storage device to VM by provision of filter
|
BarthaM@8
|
219 |
def attachRSD(self, vm_name, rsd_filter):
|
BarthaM@8
|
220 |
cmd = 'VBoxManage usbfilter add 0 --target ' + vm_name + ' --name OpenSecurityRSD --vendorid ' + rsd_filter.vendorid + ' --productid ' + rsd_filter.productid + ' --revision ' + rsd_filter.revision
|
BarthaM@8
|
221 |
print self.execute(cmd)
|
BarthaM@8
|
222 |
|
BarthaM@8
|
223 |
|
BarthaM@8
|
224 |
# return the description set for an existing VM
|
mb@7
|
225 |
def getVMInfo(self, vm_name):
|
mb@7
|
226 |
cmd = 'VBoxManage showvminfo ' + vm_name + ' --machinereadable'
|
mb@12
|
227 |
results = self.execute(cmd)[1]
|
mb@7
|
228 |
props = dict((k.strip(),v.strip().strip('"')) for k,v in (line.split('=', 1) for line in results.splitlines()))
|
mb@7
|
229 |
return props
|
mb@7
|
230 |
|
BarthaM@8
|
231 |
# return the configured USB filter for an existing VM
|
mb@7
|
232 |
def getUSBFilter(self, vm_name):
|
mb@7
|
233 |
props = self.getVMInfo(vm_name)
|
mb@7
|
234 |
keys = set(['USBFilterVendorId1', 'USBFilterProductId1', 'USBFilterRevision1'])
|
mb@7
|
235 |
keyset = set(props.keys())
|
mb@7
|
236 |
usb_filter = None
|
mb@7
|
237 |
if keyset.issuperset(keys):
|
mb@7
|
238 |
usb_filter = USBFilter(props['USBFilterVendorId1'], props['USBFilterProductId1'], props['USBFilterRevision1'])
|
mb@7
|
239 |
return usb_filter
|
mb@7
|
240 |
|
mb@7
|
241 |
#generates ISO containing authorized_keys for use with guest VM
|
mb@7
|
242 |
def genCertificateISO(self, vm_name):
|
mb@7
|
243 |
machineFolder = self.getDefaultMachineFolder()
|
mb@7
|
244 |
# create .ssh folder in vm_name
|
mb@7
|
245 |
cmd = self.cygwin_path+'bash.exe --login -c \"mkdir -p \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\\"\"'
|
mb@7
|
246 |
result = self.execute(cmd)
|
mb@7
|
247 |
# generate dvm_key pair in vm_name / .ssh
|
mb@7
|
248 |
cmd = self.cygwin_path+'bash.exe --login -c \"ssh-keygen -q -t rsa -N \\"\\" -C \\\"' + vm_name + '\\\" -f \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\dvm_key\\\"\"' #'echo -e "y\\n" |',
|
mb@7
|
249 |
result = self.execute(cmd)
|
mb@7
|
250 |
# set permissions for keys
|
mb@7
|
251 |
#TODO: test without chmod
|
mb@7
|
252 |
cmd = self.cygwin_path+'bash.exe --login -c \"chmod 500 \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\*\\\"\"'
|
mb@7
|
253 |
result = self.execute(cmd)
|
mb@7
|
254 |
# move out private key
|
mb@7
|
255 |
cmd = self.cygwin_path+'bash.exe --login -c \"mv \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\dvm_key\\\" \\\"' + machineFolder + '\\' + vm_name + '\\\"'
|
mb@7
|
256 |
result = self.execute(cmd)
|
mb@7
|
257 |
# rename public key to authorized_keys
|
mb@7
|
258 |
cmd = self.cygwin_path+'bash.exe --login -c \"mv \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\dvm_key.pub\\\" \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\authorized_keys\\\"'
|
mb@7
|
259 |
result = self.execute(cmd)
|
mb@7
|
260 |
# generate iso image with .ssh/authorized keys
|
mb@7
|
261 |
cmd = self.cygwin_path+'bash.exe --login -c \"/usr/bin/genisoimage -J -R -o \\\"' + machineFolder + '\\' + vm_name + '\\'+ vm_name + '.iso\\\" \\\"' + machineFolder + '\\' + vm_name + '\\.ssh\\\"\"'
|
mb@7
|
262 |
result = self.execute(cmd)
|
mb@7
|
263 |
|
mb@7
|
264 |
# attaches generated ssh public cert to guest vm
|
mb@7
|
265 |
def attachCertificateISO(self, vm_name):
|
mb@7
|
266 |
machineFolder = self.getDefaultMachineFolder()
|
mb@7
|
267 |
cmd = 'vboxmanage storageattach ' + vm_name + ' --storagectl contr1 --port 1 --device 0 --type dvddrive --mtype readonly --medium \"' + machineFolder + '\\' + vm_name + '\\'+ vm_name + '.iso\"'
|
mb@7
|
268 |
result = self.execute(cmd)
|
mb@7
|
269 |
return result
|
mb@7
|
270 |
|
mb@7
|
271 |
# handles device change events
|
mb@7
|
272 |
def handleDeviceChange(self):
|
mb@7
|
273 |
attached_devices = self.getAttachedRSDs()
|
mb@7
|
274 |
connected_devices = self.listRSDS()
|
mb@7
|
275 |
for vm_name in attached_devices.keys():
|
mb@12
|
276 |
if connected_devices and attached_devices[vm_name] not in connected_devices.values():
|
mb@12
|
277 |
# self.netUse(vm_name)
|
mb@7
|
278 |
self.stopVM(vm_name)
|
mb@7
|
279 |
self.removeVM(vm_name)
|
mb@7
|
280 |
|
mb@7
|
281 |
attached_devices = self.getAttachedRSDs()
|
mb@7
|
282 |
for connected_device in connected_devices.values():
|
mb@12
|
283 |
if attached_devices or connected_device not in attached_devices.values():
|
mb@7
|
284 |
new_sdvm = self.generateSDVMName()
|
mb@7
|
285 |
self.createVM(new_sdvm)
|
mb@7
|
286 |
self.attachRSD(new_sdvm, connected_device)
|
mb@7
|
287 |
self.startVM(new_sdvm)
|
mb@12
|
288 |
self.netUse(new_sdvm)
|
mb@12
|
289 |
|
mb@12
|
290 |
def handleBrowsingRequest(self):
|
mb@12
|
291 |
new_sdvm = self.generateSDVMName()
|
mb@12
|
292 |
self.createVM(new_sdvm)
|
mb@12
|
293 |
self.genCertificateISO(new_sdvm)
|
mb@12
|
294 |
self.attachCertificateISO(new_sdvm)
|
om@31
|
295 |
return new_sdvm
|
mb@7
|
296 |
|
mb@7
|
297 |
# executes command over ssh on guest vm
|
BarthaM@8
|
298 |
def sshGuestExecute(self, vm_name, prog, user_name='opensec'):
|
mb@7
|
299 |
# get vm ip
|
mb@7
|
300 |
address = self.getHostOnlyIP(vm_name)
|
mb@7
|
301 |
machineFolder = self.getDefaultMachineFolder()
|
mb@7
|
302 |
# run command
|
BarthaM@8
|
303 |
cmd = self.cygwin_path+'bash.exe --login -c \"ssh -i \\\"' + machineFolder + '\\' + vm_name + '\\dvm_key\\\" ' + user_name + '@' + address + ' ' + prog + '\"'
|
mb@7
|
304 |
return self.execute(cmd)
|
mb@7
|
305 |
|
mb@7
|
306 |
# executes command over ssh on guest vm with X forwarding
|
BarthaM@8
|
307 |
def sshGuestX11Execute(self, vm_name, prog, user_name='opensec'):
|
mb@7
|
308 |
#TODO: verify if X server is running on user account
|
mb@7
|
309 |
#TODO: set DISPLAY accordingly
|
mb@7
|
310 |
address = self.getHostOnlyIP(vm_name)
|
mb@7
|
311 |
machineFolder = self.getDefaultMachineFolder()
|
mb@7
|
312 |
# run command
|
BarthaM@8
|
313 |
cmd = self.cygwin_path+'bash.exe --login -c \"DISPLAY=:0 ssh -Y -i \\\"' + machineFolder + '\\' + vm_name + '\\dvm_key\\\" ' + user_name + '@' + address + ' ' + prog + '\"'
|
mb@7
|
314 |
return self.execute(cmd)
|
mb@7
|
315 |
|
mb@7
|
316 |
# executes NET USE and connects to samba share on guestos
|
mb@7
|
317 |
def netUse(self, vm_name):
|
mb@7
|
318 |
ip = self.getHostOnlyIP(vm_name)
|
mb@12
|
319 |
cmd = 'net use H: \\' + ip + '\USB'
|
mb@7
|
320 |
return self.execute(cmd)
|
mb@7
|
321 |
|
mb@7
|
322 |
|
mb@7
|
323 |
if __name__ == '__main__':
|
mb@7
|
324 |
man = VMManager()
|
mb@7
|
325 |
man.cygwin_path = 'c:\\cygwin64\\bin\\'
|
mb@7
|
326 |
#man.handleDeviceChange()
|
mb@7
|
327 |
#print man.listSDVM()
|
mb@11
|
328 |
#man.configureHostNetworking()
|
mb@11
|
329 |
new_vm = man.generateSDVMName()
|
mb@11
|
330 |
man.createVM(new_vm)
|
mb@11
|
331 |
man.genCertificateISO(new_vm)
|
mb@11
|
332 |
man.attachCertificateISO(new_vm)
|
mb@11
|
333 |
|
mb@7
|
334 |
#man.attachCertificateISO(vm_name)
|
mb@7
|
335 |
#man.sshGuestExecute(vm_name, "ls")
|
mb@7
|
336 |
#man.sshGuestX11Execute(vm_name, "iceweasel")
|
mb@7
|
337 |
#cmd = "c:\\cygwin64\\bin\\bash.exe --login -c \"/bin/ls\""
|
mb@7
|
338 |
#man.execute(cmd)
|
mb@7
|
339 |
|
mb@7
|
340 |
|
mb@7
|
341 |
|
mb@7
|
342 |
|