Short guide on how to create virtual machines using VMware Player and a focus on the VMware configuration file format.
VMware Player is the new free (as in beer) great tool released a few days ago by VMware.
It can be used to run virtual machines made with VMware Workstation, VMware GSX Server, and VMware ESX Server but it can’t create them.
The 24th October Eliot Phillips wrote about how to create virtual machines with VMware Player.
There is also another, maybe more simple, way to create virtual machines using VMware Player. The problem is to understand how the VMware configuration file works. These configuration files are called VMX files, and they are used by VMware Player to launch virtual machines. This article explains how to create a VMX configuration file, a hard disk image and how to install a GNU/Linux operating system using VMware Player.
At the end of the article you can find a compressed file containing a complete working configuration with clean hard disk images ready to be used.
To create an hard disk image you need the qemu-img software for GNU/Linux or qemu-img.exe for Windows. On GNU/Linux just run:
qemu-img create -f vmdk hda.vmdk 100M
to create a file called hda.vmdk of 100 megabytes. If you want, say a 5 gigabyte hard disk, just use
qemu-img create -f vmdk hda.vmdk 5G
Next thing you need is a new configuration file so VMware Player can install your new GNU/Linux distribuntion on the hard disk image. The file can be created using a normal text editor. Follows a sample of a working configuration file.
## VMware Player Configuration File
## This indicates the version of the virtual machine.
## Compatible VMs are the ones created by Workstation 4.x and 5.x, GSX Server 3.x, and ACE 1.x
## Valid entires are 7 and 8. We will use 8.
config.version = "8"
## This seems to indicate the version of the VMware hardware. Valid values are from 0 to 4. But to
## set value 4 you need to make the configuration file not writable because VMware Player will
## change it automaticaly to 3.
virtualHW.version = "3"
## This will specify how much ram will be used by VMware Player.
memsize = "128"
## Configure SCSI
## "lsilogic" ............. LSILogic
## "buslogic" ............. BusLogic
scsi0.present = "TRUE"
scsi0.virtualdev = "buslogic"
## This group of variables are used to configure the primary master ide channel.
## You must assign to ide0:0.fileName the name of the hard disk image created with qemu-img.
## ide0:0.present = "TRUE" means that the device shoul be connected on system startup.
## ide0:0.deviceType can be: disk | cdrom-raw |cdrom-image | atapi-cdrom | auto detect | raw??"
## ide0:0.mode = "persistent" ???????
## ide0:0.redo = "" ?????????????????
## ide0:0.writeThrough = "TRUE" ?????
ide0:0.startConnected = "TRUE"
ide0:0.present = "TRUE"
ide0:0.fileName = "hda.vmdk"
ide0:0.deviceType = "disk"
ide0:0.redo = ""
## No configuration for the primary slave ide channel.
## ide0:1.present = "TRUE"
## Configure the secondary master ide channel.
## This time you want to configure a cdrom. This configuration uses the cdrom.iso file as cdrom drive.
## if you want to use your phisical cdrom drive set
## ide1:0.filename = "auto detect"
## ide1:0.deviceType = "cdrom-raw"
## if you want to specify a particular device use:
## ide0:0.fileName = "/dev/cdrom"
## ide0:0.deviceType = "atapi-cdrom"
ide1:0.present = "TRUE"
ide1:0.fileName = "cdrom.iso"
ide1:0.deviceType = "cdrom-image"
ide1:0.autodetect = "TRUE"
## No configuration for the secondary slave ide channel
## ide1:1.present = "TRUE"
## This section configures the floppy drive.
## change "/dev/fd0" to "A:" if you run VMware Player on Windows.
## You could also use an image of a floppy disk.
floppy0.present = "FALSE"
floppy0.startconnected = "TRUE"
floppy0.fileName = "/dev/fd0"
## Ethernet configuration.
## Activate on startup and set a nat connection.
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat" #nat | hostonly | bridged
ethernet0.addressType = "generated" # generated | static
ethernet0.generatedAddress = "00:0c:29:7f:26:09"
ethernet0.generatedAddressOffset = "0"
ethernet1.present = "TRUE"
ethernet1.connectionType = "nat"
ethernet1.addressType = "generated"
ethernet1.generatedAddress = "00:0c:29:7e:06:58"
ethernet1.generatedAddressOffset = "0"
## Usb configuration.
## Activate usb on system startup.
usb.present = "TRUE"
usb.generic.autoconnect = "TRUE"
## This configuration makes VMware Player emulate a sound card.
## "sb16" ................... Creative SB16
## "es1371" ................. Ensoniq ES1371
sound.present = "TRUE"
sound.virtualDev = "es1371"
## This is just to set tile of the VMware Player window.
displayName = "Virtual OS"
## Here you need to specify the guest os, that is the os that VMware Player will run.
## Possible choices are:
## "dos"
## "ms-dos"
## "freebsd" .................. freebsd distribution
## "freebsd-64" ............... freebsd 64 bit distribution
## "mandrake" ................. mandrake linux generic
## "netware6" ................. netware 6
## "netware5 .................. netware 5
## "netware4 .................. netware 4
## "netware" .................. netware generic
## "nld9" ..................... novell linux desktop 9
## "other-64" ................. other 64 bit
## "other" .................... other generic
## "other24xlinux" ............ other generic distribution with the linux 2.4.x kernel
## "other26xlinux ............. other generic distribution with the linux 2.6.x kernel
## "otherlinux" ............... other generic distribution with the linux kernel
## "rhel4-64" ................. red hat enterprise linux 4 64 bit
## "rhel4" .................... red hat enterprise linux 4
## "rhel3-64" ................. red hat enterprise linux 3 64 bit
## "rhel3" .................... red hat enterprise linux 3
## "rhel2" .................... red hat enterprise linux 2
## "redhat" ................... red hat linux (fedora?) generic
## "solaris10-64" ............. solaris 10 64 Bit
## "solaris10" ................ solaris 10
## "solaris9" ................. solaris 9
## "solaris8" ................. solaris 8
## "solaris7" ................. solaris 7
## "solaris6" ................. solaris 6
## "solaris" .................. solaris generic
## "sjds" ..................... sun java desktop system
## "sles-64" .................. suse linux enterprise server 64 bit
## "sles" ..................... suse linux enterprise server
## "suse-64" .................. suse linux 64 bit
## "suse" ..................... suse linux generic
## "turbolinux" ............... turbo linux
## "ubuntu-64" ................ ubuntu linux 64 bit
## "ubuntu" ................... ubuntu linux generic
## "win95" .................... windows 95
## "win98" .................... windows 98
## "winme" .................... windows me
## "winnt" .................... windows nt
## "winnetstandard" ........... windows server 2003 standard edition
## "winxphome" ................ windows xp home
## "winxppro" ................. windows xp professional
## "winvista-64" .............. windows vista 64 bit
## "winvista .................. windows vista
## "longhorn-64" .............. windows longhorn 64 bit
## "longhorn" ................. windows longhorn
## "winnetbusiness" ........... windows server 2003 small business
## "winnetenterprise-64 ....... windows server 2003 enterprise 64 bit
## "winnetenterprise" ......... windows server 2003 enterprise
## "winnetstandard-64" ........ windows server 2003 standard 64 bit
## "winnetstandard" ........... windows server 2003 standard
## "winnetweb" ................ windows server 2003 web
## "winxppro-64" .............. windows xp professional 64 bit
## "winxppro" ................. windows xp professional
## "winxphome" ................ windows xp home
## "win2000advserv" ........... windows 2000 advanced server
## "win2000serv ............... windows 2000 server
## "win2000pro" ............... windows 2000 professional
## "winnt" .................... windows nt
## "winme" .................... windows me
## "win98" .................... windows 98
## "win95" .................... windows 95
## "win31" .................... windows 3.1
## "windows" .................. windows generic
guestOS = "otherlinux"
## Set the Non Volatile Random Access Memory file which contains information @about BIOS settings.@
nvram = "bios.nvram"
uuid.location = "56 4d 43 8e a0 f2 98 da-6e 15 86 c5 0f 7f 26 09"
uuid.bios = "56 4d 43 8e a0 f2 98 da-6e 15 86 c5 0f 7f 26 09"
Using this file as template you can install any operating system.
If you want a fully functional configuration, just download virtual_machine.tar.gz. The file contains a working configuration and some blank hard disk images created with qemu-img. The hd/ directory contains the hard disk images. Each image has different size. Just copy the desired image in the ../hda.vmdk file. Also, the configuration reads cdrom.iso file as input for the cdrom drive, so, if you want to install your favorite distribution, rename the file in cdrom and place it in the directory containing the VMware Player configuration file. To create an iso image from a CDROM/DVD just run dd if=/dev/cdrom of=cdrom.iso where /dev/cdrom is you CDROM/DVD reader device. Then launch vmplayer start_linux.vmx and install your GNU/Linux distibution.
Links:
VMware Player
QEMU for Linux – contains qemu-img
