Created
January 24, 2012 04:13
-
-
Save ApprenticeGC/1667753 to your computer and use it in GitHub Desktop.
Partial script to show how to create hd in VirtualBox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commandVBoxManage = 'VBoxManage' | |
hdSuffixNames = ['boot', | |
'root', | |
'tmp', | |
'var', | |
'usr', | |
'usr-local', | |
'swap', | |
'home'] | |
def createHDHelper(vmName, suffixName, hdSize): | |
actionCommand = 'createhd' | |
hdName = vmName + '-' + suffixName + '.vdi' | |
hdFile = os.path.join(vmName, hdName) | |
command = [commandVBoxManage, | |
actionCommand, | |
'--filename', | |
hdFile, | |
'--size', | |
str(hdSize)] | |
subprocess.call(command) | |
def createHD(vmName): | |
index = 0 | |
for hdSuffixName in hdSuffixNames: | |
if index == 0: | |
createHDHelper(vmName, hdSuffixName, 2048) | |
else: | |
createHDHelper(vmName, hdSuffixName, 2048) | |
index += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment