|
|
|
@ -57,15 +57,13 @@ def createVms():
|
|
|
|
|
print("\nTamaño del disco en Gigas")
|
|
|
|
|
vmSize=input("\nSize: ")
|
|
|
|
|
os.system("qemu-img resize "+dirVmsImgs+"/"+vmName+".qcow2 "+vmSize+"G")
|
|
|
|
|
print("\nPassword de root")
|
|
|
|
|
#vmPasswd=input("\nPassword: ")
|
|
|
|
|
vmPasswd=getpass("\nPassword: ")
|
|
|
|
|
vmPasswd=getpass("\nroot password: ")
|
|
|
|
|
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --root-password password:"+vmPasswd)
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --hostname "+vmName)
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --install dropbear")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --firstboot-command 'growpart /dev/sda 1'")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --firstboot-command 'resize2fs /dev/sda1'")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --root-password password:"+vmPasswd+" > /dev/null 2>&1")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --hostname "+vmName+" > /dev/null 2>&1")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --install dropbear > /dev/null 2>&1")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --firstboot-command 'growpart /dev/sda 1' > /dev/null 2>&1")
|
|
|
|
|
os.system("virt-customize -a "+dirVmsImgs+"/"+vmName+".qcow2 --firstboot-command 'resize2fs /dev/sda1' > /dev/null 2>&1")
|
|
|
|
|
choice()
|
|
|
|
|
|
|
|
|
|
def runVms():
|
|
|
|
|