At work I used this script to create VM's with static MAC addresses which are known in our DHCP server, and it helped me a lot to instantly have a clean VM while working on unattended OS installations.
The script is written in bash and runs on any system which supports bash. It depends on vmware-vdiskmanager , which is included in VMware Server and VMware Workstation.
To run the script you first need to download it.
wget http://createvm.googlecode.com/svn/trunk/createvm.sh -O createvm.sh
Once downloaded you have to flag it executable:
chmod +x createvm.sh
Now you can run the script. Run it without any parameters to see the options available:
The script has one parameter that needs to be set, and that is the guest OS you want to run in your VM. To see a list of OS'es that are supported run the script with parameter -l :
To create your first VM decide on which Guest OS you want to run and pass it as the first parameter to the script. In this example I am creating an Ubuntu virtual machine:
To create the same VM with some more memory pass the -r (for ram) parameter with the wanted RAM value:
./createvm.sh ubuntu -r 512
The script will display a summary of what will be created (see screenshot). The defaults are displayed here. All the settings displayed here can be manipulated by the command line parameters.
To see some of the examples of creating Virtual Machines run the following command:
Any major updates on this script will be displayed here.