コード例 #1
0
 # some possible modifications pointed out
 #kickstartFileContent.removePackage("system-config-kickstart")
 #kickstartFileContent.addPackage("httpd")
 # some other possible modifications pointed out
 #kickstartFileContent.replaceAllPackages(UbKickstartTemplates.packagesForUbuntuDesktop)
 #kickstartFileContent.ubActivateGraphicalLogin()
 kickstartFileContent.ubSetUser(regularUser[0], pwd=regularUser[1])
 # some possible modifications pointed out
 #kickstartFileContent.setSwappiness(10)
 # pick right temporary directory, ideally same as VM
 modifiedDistroIsoImage = downloadedDistroIsoImage.cloneWithAutoBootingKickstart \
 (kickstartFileContent,
  cloneIsoImagePath=os.path.join(exampleVm.directory, "made-to-order-os-install.iso"))
 # some necessary choices pointed out
 # 32-bit versus 64-bit linux, memsizeMegabytes needs to be more for 64-bit, guestOS is "ubuntu" versus "ubuntu-64"
 exampleVm.create(memsizeMegabytes=1200, guestOS="ubuntu", ideDrives=[20000, 300, modifiedDistroIsoImage])
 # some possible modifications pointed out
 #exampleVm.vmxFile.setMemorySize(1280)
 #exampleVm.vmxFile.setNumberOfProcessors(2)
 #exampleVm.vmxFile.setAccelerate3D()
 exampleVm.portsFile.setSsh(ipaddress=ipaddress, user="******", pwd=rootpw)
 exampleVm.portsFile.setShutdown()
 exampleVm.portsFile.setSsh(ipaddress=ipaddress, user=regularUser[0], pwd=regularUser[1])
 exampleVm.portsFile.setRegularUser(regularUser[0])
 # some possible modifications pointed out
 #exampleVm.vmxFile.setEthernetAdapter(0, "bridged")
 # NAT works well if before hostonly
 # NAT works well if before hostonly
 #exampleVm.vmxFile.setEthernetAdapter(0, "nat")
 #exampleVm.vmxFile.setEthernetAdapter(1, "hostonly")
 # start up for operating system install