17 Feb
Recently my computer at work blew up and I had to reinstall the OS and start from scratch. Backing everything up and starting over was a pain. I decided to minimize any down time in the future by installing Ubuntu and then running windows with virtualization. That way if some new policy - or just the nature of windows - caused my system to experience catastrophic failure again I could simply copy a folder containing a base image complete with dev environment into place and fire the VM back up in no time flat.
I’d used VMWare’s Workstation in the past and I’d heard that they’d recently released VMPlayer for free. Well that was certainly a good price. I downloaded that and while I was scrambling to find a copy of Workstation around the office so I could create my image someone mentioned that you can create images for VMPlayer - which supposedly, as the name suggests, only runs the VMachines but doesn’t create them.
After a bit of digging around I found all the steps I need to setup my new image and start loading windows. I’ll document the steps as follows - mainly so I don’t have to run around all over the place the next time I want to create an image and I’ve forgotten how. This is for installing and setting up on Linux. Namely Ubuntu Breezy.
1) Make sure you have gcc-3.4 and your linux kernel headers installed. (You should know how to work apt-get)
2) Grab VMPlayer from VMWare’s site and install it. I selected bridged network during the install, for what it’s worth.
3) Grab qemu from their site. You need version 0.8.x
4) Create a .vmx file. This is just a text file actually. You can modify an existing file - like the example at the end of this post - or go to this site to have one dynamically generated for you (http://www.consolevision.com/members/dcgrendel/vmxform.html).
5)In the same folder run the following command to create the actual drive image: qemu-img create -f vmdk Drive1.vmdk 2G
(it’s all fairly self explantory. 2G is the size you want the image to be - expand to, it doesn’t take up that much room once created.)
6)Put your install media in the cd drive and select the .vmk from VMPlayer and it should begin installing after the POST. (Note: You can also PXE boot. I had problems with this but I think it was more the scripts the PXE image was trying to run and not VMPlayer)
7)Now you have to install VMTools to get your screen to size right and to get things running a little more smoothly. Download the Evaluation copy of VMWare Workstation. Extract the .iso file of your OS. So I extracted windows.iso. Mount the .iso and then get the files contained into your VM. Run setup and you’re done.
That’s it.
I’ve talked to a couple people and this doesn’t seem to be a violation of the usage agreements. Supposedly VMWare themselves have released a free tool for creating images. So this might all be moot. I believe VMWare Server was mentioned though I’m not sure if that’s the app that creates free images. It’s also been released for free. I’ll have to look into that. It was also suggested that an image created with VMWare’s tools might run better since it will make certain optimization settings.
BONUS:
Here’s an entry I found on making your physical machine a virtual machine. Just what I was looking for.. but about 1 week too late (post crash).
Until then.. happy imaging.
EXAMPLE .VMX BELOW:
config.version = "8" virtualHW.version = "3" MemAllowAutoScaleDown = "FALSE" MemTrimRate = "-1" uuid.location = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58" uuid.bios = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58" uuid.action = "create" checkpoint.vmState = "" displayName = "Test" guestOS = "winXPPro" memsize = "256" ethernet0.present = "TRUE" ethernet0.connectionType = "bridged" ethernet0.addressType = "generated" ethernet0.generatedAddress = "00:0c:29:7e:06:58" ethernet0.generatedAddressOffset = "0" usb.present = "TRUE" usb.generic.autoconnect = "TRUE" sound.present = "TRUE" sound.virtualdev = "sb16" scsi0.present = "FALSE" floppy0.present = "FALSE" ide0:0.present = "TRUE" ide0:0.fileName = "Drive1.vmdk" ide0:0.deviceType = "disk" ide0:0.mode = "persistent" ide0:0.redo = "" ide0:0.writeThrough = "TRUE" ide0:0.startConnected = "TRUE" ide0:1.present = "TRUE" ide0:1.fileName = "CDDrive" ide0:1.deviceType = "cdrom-raw" ide0:1.autodetect = "TRUE" ide0:1.startConnected = "TRUE" ide1:0.present = "FALSE" ide1:1.present = "FALSE"
One Response for "Creating Virtual Machines for VMPlayer"
http://www.easyvmx.com/
Leave a reply