14 April, 2009

Creating CD-ROM ISO Image - the cowboy way

I've been investigating installation of Xen for work, in the process I thought it would be useful to rather than run around with the WinXp installation disk to create an ISO image of it for installation purposes.

The utility 'dd' suits the bill, you have to first interface directly with the device driver so the cd cannot be mounted. If the cd is mounted, I'd first recommend finding the device driver reference by issuing the mount command:



$ mount
. . .
/dev/scd0 on /media/cdrom0 . . . ..
$ umount /media/cdrom0


As you can see, this was an external cdrom on /dev/scd0.

Next, issue the appropriate dd command:



$ dd if=/dev/scd0 of=WinXpProInstall.iso

The arguments if=/dev/scd0 tells dd to read from the device in raw format, of=WinXpInstall.iso specifies the output file.

You'll be left with an exact image of what resides on the cd, use at your leisure.

13 April, 2009

Installing VirtualBox 2.2

I've been evaluating VirtualBox, comparing it to VMware Server.

One of my first discoveries is the extent of changes since VirtualBox OSE 1.6.6, the verified package of Debian.

I found it not to be worthwhile in comparing 1.6.6 to VMware 2.0 since the feature set has significantly evolved and it wouldn't be a fair comparison comparing the latest version of VMware to VirtualBox development months old.

First step; update the Debian sources to make VirtualBox 2.2 available. Start by editing the /etc/apt/sources.list, adding the line

deb http://download.virtualbox.org/virtualbox/debian/ etch non-free
Next, install virtualbox-2.2; you may need to uninstall any previous version.


# apt-get update
# apt-get install virtualbox-2.2


Start the interactive UI by invoking the command:

$ VirtualBox

10 April, 2009

VMware Remote Console -- Command Line

I've been investigating thin-client connectivity to virtual machines with VMware Server 2.0.

While the console available through the web interface is pretty responsive, I've got a need to restrict the VM configuration from the user. I figured there was a means to kick off the console independent of the web interface, but hadn't found it...'til now.


/home/user/.mozilla/firefox/6lk37syc.default/extensions/VMwareVMRC@vmware.com/plugins/vmware-vmrc -X -h localhost:8333 -u vmadmin -p adminpassword "[standard] WinXp/WinXp.vmx"



That'll start a full screen console where VMware Server is running locally. Should apply remotely as well, but does require installation of the VDI on the client (i.e. connect via the web interface at least once).

Cool Beans.

07 April, 2009

Timing VM Startup Script

In my previous post I eluded to creating a script for timing the starting of a virtual machine.

This is it, use at your leisure:


#!/bin/csh

set i=0
while ( $i < starttime="`date" addr="192.168.2.24" response="1" response ="=">> /dev/null
set response=$status
end
set stopTime=`date +%s`

set secs=`expr $stopTime - $startTime`
echo "startUp: $secs (secs)"

sleep 10
vmrun -T 127.0.0.1 -h 'https://127.0.0.1:8333/sdk' -u vmadmin -p 'vmadminpassword' stop "[standard] JltvWinXp/JltvWinXp.vmx"
set i=`expr $i + 1`
end

The script loops 5 times to get a crude sampling. Each iteration, the virtual machine is started then monitored via a ping until the VM is pingable. It then sleeps some 10 seconds before commanding the virtual machine to shutdown.

06 April, 2009

VmRun Command

I've been recently tailoring a WinXp virtual machine to accelerate the OS initialization. To measure the impacts I've created a script that repeatedly times the starting of the VM. In particular, I'm measuring how long it takes between initiated startup and the time it takes before I can ping the virtual machine.

The first challenge was to decode the vmware-cmd (now vmrun) syntax. The following is an example of how you can start a virtual machine.


vmrun -T 127.0.0.1 -h 'https://127.0.0.1:8333/sdk' -u vmadmin -p 'vmadminpassword' start "[standard] JltvWinXp/JltvWinXp.vmx"

05 April, 2009

Querying Unix Time

Just a quick post of a useful feature of querying the Unix time (seconds since Epoch) that I find useful in various scripts.

I'm posting it because time and again I find the need to use it and repeatedly spend time re-looking up what the syntax consists of.


$ date +%s
1227918465

03 April, 2009

External USB Disk - NTFS Mount

In my last post I eluded to purchasing an Seagate FreeAgent Xtreme external hard-drive and was woefully disappointed in the inability to mount it from Linux and gain write permissions. This is how I resolved it for Debian 4.0 - AMD64 distro.

I 'fixed' this by reformatting the drive as a FAT32 file system which technically resolved the issue, but FAT32 didn't support my needs as I needed to store large files (5+ Gigs) on the drive.

I later found that if I installed the ntfs-3g driver and mounted it using this file system type that I could in fact read and write to the drive.


# vi /etc/apt/sources.list


Adding this line:

deb http://www.backports.org/debian etch-backports main


Followed by:

# apt-get update
# apt-get install ntfs-3g


then, define the mount point and edit the /etc/fstab as follows:

# mkdir /media/usbdisk

and add this line to /etc/fstab

/dev/sdc1 /media/usbdisk ntfs-3g rw,user,noauto 0 0



# mount /media/usbdisk


Ta-Da.