Using Raw Disks with VMware Server 2

Published on Monday, August 11, 2008

For various reasons I had the need to open a raw disk inside VMware Server 2. The reports from the field say that this just isn't supported. Although I don't need to actually run a raw disk, I needed to get some data off it -- 400GB worth. It turns out 'not supported' really means 'not in the UI.' I don't know the reason why it isn't in the UI, maybe marketing wants people to use ESX, or maybe the UI guys fell behind with their workload.

Alas, it is possible. And here's how.

1) Take out your 'raw disk' and put it into another machine.

2) Fire up Server 1.0.x or Workstation and open a virtual machine (or create a new one). Edit the preferences and add a new hard disk. Select 'use a physical disk', and select the disk you put in above. Select use entire disk. You may want to change the SCSI LUN to SCSI1:0 (depending how many disks are in your 'proper' server).

3) Save it as something like 500GB.vmdk

5) Copy out the relevant bit from the vmx file, e.g.

# Test VM.vmx
scsi1.present = "TRUE"
scsi1:0.present = "TRUE"
scsi1:0.fileName = "500GB.vmdk"
scsi1:0.deviceType = "rawDisk"

And of course, the entire 500GB.vmdk file

# 500GB.vmdk
# Disk DescriptorFile

# Extent description
RW 976773168 FLAT "/dev/sdb" 0

# The Disk Data Base 

ddb.virtualHWVersion = "6"
ddb.geometry.cylinders = "60801"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.geometry.biosCylinders = "60801"
ddb.geometry.biosHeads = "255"
ddb.geometry.biosSectors = "63"
ddb.adapterType = "buslogic"

Note: If your guest OS is 64-bit, you won't be able to use buslogic. Switch the last entry above to 'lsilogic'.

While you could likely create the vmdk file by hand, the only number I'm not certain about is the part after the RW. (UPDATE: Note added to page). The Disk Data Base you can just see by typing in 'fdisk /dev/sdb'

4) Move the disk back to the 'server' and turn the server back on.

5) Edit the vmx file of whatever virtual machine you want to use and put in the part copied from the vmx file of your other machine. Alternatively, if you did an upgrade, you could just copy it across now. Create a new 500GB.vmdk file in the same directory, paste in the bit you copied out from the test virtual machine. Double check that the 'raw disk' comes up as the same node in /dev.

6) Boot up the virtual machine. You will notice in the WebUI that a new scsi controller is inserted. You should also noticed a new disk accessible inside your virtual machine, e.g.

[root@files dev]# ls sd*
sda  sda1  sda2  sda3  sdb  sdb1
[root@files dev]# ls /mnt
cdrom  floppy
[root@files dev]# mkdir /mnt/disk
[root@files dev]# mount /dev/sdb1 /mnt/disk
[root@files dev]# ls /mnt/disk
Files  lost+found  Movies  Music  Personal  VMWare
[root@files dev]#

Update: Peter Jonsson kindly sent in the answer to "I don't know what to put after the RW." Below is the description of how to find the correct number. Thanks Peter!

The magic formula is:

ThePartAfterTheRW  =  TOTAL AMMOUNT OF DISKBYTES   /   512

This is my Western Digital 500 GB drive: 

fdisk -l

Disk /dev/sdc: 500.1 GB, 500107862016 bytes

256 heads, 63 sectors/track, 60563 cylinders

Units = cylinders of 16128 * 512 = 8257536 bytes

Disk identifier: 0x00000000

And using the formula I got the "RW" stuff:

500107862016 / 512  = 976773168

VM Automatic Startup in Server 2

Published on Saturday, August 2, 2008

I think possibly one of the most practical upgrades in VMware Server 2 appears to be the ability to automatically turn on virtual machines in a stagnated order. I have fond memories of turning on a server with 10 virtual machines, and when they all turn on at once, the hard disk grinds to a halt. This forced me to turn on the machines manually afterwards.

+1 VMware in my books.

VMware Tools in VMware Server 2

Published on Friday, August 1, 2008

Installing the tools in VMware Server 2 is a little different than Workstation or the previous versions of VMware Server. Under the Summary tab of your Virtual Machine, look for a link that says "Install VMware Tools" -- click it.

Wait for 'Success' to show up on the bottom, and jump into your virtual machine. Mount the tools as so:

mount /dev/cdrom /media/cdrom

And install as normal (copy the .tar.gz to /usr/src, extract it, install it). Easy peasy.

Ubuntu 8.04 64-Bit and VMware Server 2

Published on

I now have successful installation of VMware Server 2 (Beta RC1) on top of Ubuntu 8.04 64-bit. I have been using various virtualization technologies for years, and VMware is usually the easiest to install and configure. So far, VMware Server 2 RC1, has proven to be the exception to the rule.

That said, I am very excited by the direction VMware is taking -- this new server version looks to have great potential.

The 'server' this is on is a mATX motherboard from Gigabyte (GA-G33M-DS2R), with 4GB (2x2GB) of Transcend DDR2-800 memory, topped off with the E8200. I have been nothing but impressed with this combination of hardware.

However, although I was thinking VMware Server 2 would install seamlessly over Ubuntu, I was wrong. There were a few things I had to tweak to get everything working correctly.

The first thing I had major issues with was VMware choking on the parallel port. Normally the parport is the first thing I would turn off, but in this instance, I guess excitement overtook me. My tip is to first remove the lp module from inside /etc/modules, and then disable the parallel port inside the BIOS. The symptoms I was having involved VMware halting/freezing on either startup or shutdown. This occurred for both RC1 as well as 1.0.6.

My second tip, if VMware freezes half way through starting up or shutting down, is to go through the vmware startup script, /etc/init.d/vmware, and comment out anything refering to the parport_pc. In particular, I looked for this line and made sure to comment it out:

/sbin/modprobe -r parport_pc >/dev/null 2>&1

I commented out lines 974 and 1076. After doing this, VMware loaded perfectly.

The second major issue I had occurred after actually installing VMware. I opened Firefox and went to the IP of my virtual server, logged in just fine, and loaded up my first virtual machine. However, after booting the virtual machine, I was unable to open up the remote console. It turns out I had just upgraded to Firefox 3.0.1, and the Remote Console is set to fail on anything above The fix is quite easy.

First click where it says "click anywhere to open the virtual machine". Copy the address of the XPI and use something like wget to download the file. This is an example:

wget --no-check-certificate

If you are using Gnome, right click the file you just downloaded and say Open With then Archive Manager. Do the same for the 'install.rdf' file inside, specifying gedit as the application if need be. Next, edit line 20 so it reads as follows:


Save the file, open the XPI with Firefox, and you should be good to go.

I've seen a lot of other suggestions on the 'net on how to fix VMware RC1 when booting -- including disabling ipv6, checking the hosts file, and running the any-any patches. None of these approaches helped me at all, but maybe it is exactly what you need. My biggest tip is that if VMware isn't starting up or stopping correctly, open up /etc/init.d/vmware and find out exactly where it is faulting (add things like 'echo "fail"' inside the IF statements).