Randomness

How to create virtual machines using VMware Player

Posted on: October 24, 2007

Orginal post can be found here;

Lorenzo Ferrara’s Blog

==============================================

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 vmx file works. A vmx file is the configuration file used by the VMware Player to launchvirtual machines. This article explains how to create a vmx configuration file, a hard disk image and how to install a GNU/Linux OS using VMware Player. At the end of the article you can find a tar.gz file containing a complete working configuration with clean hd images ready to be used.

To create an hard disk image you need qemu-img for GNU/Linux or qemu-img.exe for Windows. Just run:

qemu-img create -f vmdk hda.vmdk 100M

to create a file called hda.vmdk of 100 Megs. If you want, say a 5 Gigs 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. This is 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"

## This 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.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"
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.fileName = "/dev/fd0"

## Ethernet configuration.
## Activate on startup and set a nat connection.
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat"
ethernet0.addressType = "generated"
ethernet0.generatedAddress = "00:0c:29:7f:26:09"
ethernet0.generatedAddressOffset = "0"

## Usb configuration.
## Activate usb on system startup.
usb.present = "TRUE"

## This configuration makes VMware Player emulate an es1371 sound card.
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"
##  "freebsd" ............ generic freebsd distribution
##  "netware6" ........... netware 6
##  "other24xlinux" ...... generic distribution with the linux 2.4.x kernel
##  "other26xlinux ....... generic distribution with the linux 2.6.x kernel
##  "otherlinux" ......... generic distribution with the linux kernel
##  "redhat" ............. red hat linux (fedora?)
##  "solaris10" .......... solaris 10
##  "suse" ............... suse linux
##  "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
guestOS = "otherlinux"

## Set the Non Volatile Random Access Memory file which contains information
## about BIOS settings.
nvram = "bios.nvram"
-------------------------------------------------------------------------------

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 containsthe 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 .iso file in cdrom and place it in the directory containing the VMware Player configuration file. To create aniso image from a cdrom/dvdrom 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)
QEMU for Windows (contains qemu-img.exe)

About these ads

3 Responses to "How to create virtual machines using VMware Player"

[…] -How to create virtual machines using VMWare Player […]

VMWare player, manual configuration and customization…

Sometimes i find myself in the need of getting some OS up and running quickly, just to try some stuff out. Like Live CD images of various sorts. Lately i’ve found myself playing around with SLAX, a live file system that can exist on a USB flash stick …

anyone know how to create a cut-down bootable VMWare Linux image, based on RHEL 5. so that I can attached that image on VMWare Player and boot the OS. if anyone please give me the step by step configuration

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: