VMware Communities
eswenson
Contributor
Contributor

Cannot create vm using raw disk partition vmdk

I created a VMDK file for a bootable linux partition (I use rEFit to triple-boot among Mac OS X, Windows 7, and Ubuntu 10.4 Linux) using the "vmware-rawdiskCreator create" tool and the result are two VMDK files. I then try to set the hard drive associated with a new VM to use the VMDK(s), but both are greyed out. I see other VMDKs (for other VMs) not greyed out, but the ones created with vmware-rawdiskCreator are greyed out. Can anyone suggest what I might be doing wrong and how I might proceed?

And yes, the disk partition boots linux fine and it is marked as active.

Thanks. -- Eric

Tags (2)
Reply
0 Kudos
16 Replies
WoodyZ
Immortal
Immortal

Neither Apple or VMware support the use of rEFit and or more then one Boot Camp partition however this has been covered before and the results have been mixed and searching the Fusion forum using keyword rEFit should yield what has already been discussed.

Reply
0 Kudos
ChipMcK
Hot Shot
Hot Shot

I then try to set the hard drive associated with a new VM

What do you mean by 'set'? How?

Reply
0 Kudos
eswenson
Contributor
Contributor

I followed the directions on this web page:

http://feelslikeburning.com/2008/12/19/multibooting-linux-windows-and-mac-os-x-on-a-mac-and-using-th...

It calls for creating the VM, and then using Settings|Hard Disks to get rid of the dummy VMDK created as a result of creating the VM and then adding the VMDK created with rawDiskCreator. When I attempt to add the VMDK created by this utility, it is greyed out in the file list.

-- Eric

Reply
0 Kudos
ChipMcK
Hot Shot
Hot Shot

My, that is quite a set of directions!

Anyway, I recall V3 Fusion is when the greyed-out arrived.

Workaround: You need to edit the .vmx file for the 'new' VM, replacing

the generated '.vmdk' file with the raw one. Do this instead of the Settings/Remove step.

VMware Fusion must be stopped before you 'Show Package Package',

because of the lock files. Then TextEdit the '.vmx' file

Look for line similiar to this

ide0:0.fileName = "virtual disk.vmdk"

White you are here, do the other editing

Edited:

Do not forget that the two 'raw' files need to be copied into the Package

Reply
0 Kudos
mudaltsov
Expert
Expert

You'll need to manually add the raw disk .vmdk to the .vmx configuration file, with the following lines:

ide0:0.present = "TRUE"
ide0:0.fileName = "filename.vmdk"
ide0:0.deviceType = "rawDisk"
suspend.disabled = "TRUE"

The suspend.disabled line is important to prevent the VM from suspending with a raw disk - if you were to suspend the VM, then reboot from the physical partition, the file system may be inconsistent and data corruption may occur.

Reply
0 Kudos
eswenson
Contributor
Contributor

Thanks much. I'll give it a try. -- Eric

Reply
0 Kudos
eswenson
Contributor
Contributor

Well, manually editing the .vmx file gets me further, but now, grub goes into rescue mode with a "no such partition" error. I can't seem to be able to do anything at this prompt ("help" is an unknown command) and I can't load any commands because anything I pass insmod just fails since there is no access to the root file system.

I created the .vmdk using partition 2 (/dev/disk0s2) and this is where my linux partition is. I can boot this partition fine using rEFit, so grub must be setup correctly. But when fusion boots that raw disk partition, grub is unable to boot the system.

Any ideas?

-- Eric

Reply
0 Kudos
ChipMcK
Hot Shot
Hot Shot

I am not doing Triple-Boot, but would follow WoodyZ's suggestion:

  • Search on "rEFIt" in the forum

Reply
0 Kudos
eswenson
Contributor
Contributor

Thanks much ChipMcK. I did as you (and others) have suggested, and found a very helpful post regarding rEFIt and the exact same problem I had had. The proposed solution worked perfectly (it involved creating a virtual disk and putting grub on it). Anyway, I'm not booting my linux partition fine in vmware fusion. Thanks.

Reply
0 Kudos
unixwizard
Contributor
Contributor

Woody et al... are you willing to try to help an old UNIX hacker... do the same thing that you helped others in the bootcamp world...

First thanks in advance.... the idea would have have come if I had not tripped over your earlier posts when I looking for something else (google in your friend).

Anyway, I would like to create the two disk2*.vmdk files Woody describes elsewhere so I can direct Fusion to use an external physical drive, and but have been unable to get past step one... all I want is to mount an external physical drive as a raw disk partition for VMware Fusion.

Rational: Am are trying to do some low level OS experiments... with ultimately funky HW. We do this today with real physical HW, but the ability to move the disk between a VM and the real world would be quite handy for an OS developer and HW architect.

Tools: Mac OSx Leopard (could be snow leopard with some work), Fusion 2.X latest version (also have a 3.1 license, but have not yet upgraded for other reasons at the moment).

I've a number of VM's running in the Fusion that do what we want... from Winders to Linux and custom OS's in between..

Now for the question/issue - I need help:

I have an 200GB disk on USB converter - said disk can be moved into real HW directly or used via USB.

Mac OSX sees it as the blocked device: /dev/disk2

% ls -l /dev/disk2

brw-r----- 1 unixwizard operator 14, 4 Jun 29 10:35 /dev/disk2

brw-r----- 1 unixwizard operator 14, 5 Jun 29 10:35 /dev/disk2s1

crw-r----- 1 unixwizard operator 14, 4 Jun 29 10:35 /dev/rdisk2

crw-r----- 1 unixwizard operator 14, 5 Jun 29 10:35 /dev/rdisk2s1

It mounts just fine, Mac DiskUtils like it etc ...

Although I currently have it >>unmounted<< as I suspected that it would be uncool to have MacOS and Fusion fighting.

BTW: this disk in real PC HW boots fine... in this case has a copy of XP on it for the last experiment... but that could change...

% ..../vmware-rawdiskCreator print /dev/disk2

Nr Start Size Type Id Sytem

1 63 398267352 BIOS 7 HPFS/NTFS

% .../vmware-rawdiskCreator create /dev/disk2 1 "~/Documents/Virtual Machines.localized/ExVM.vmwarevm" ide

Unable to create the source raw disk: The specified device is not a valid physical disk device (20).

Any idea why it's getting that error? Clearly it is a real blocked device and I have perms etc... I'm taking a wag that the *Creator program is looking for some sort of signature that we lack. All other references take about putting BootCamp on the disk before running *Creator. Is there real documentation (man page???) of a switch that says "just do it."

I gather the disk2.vmdk is an ascii text file with pointers to the real device and the *pt.vmdk is a binary file with the partition info into (and probably the MBR).

Failing getting the tool to work, if I can find out the format of the first and an example of same, I suspect I can create it by hand with a text editor, and I can dd(1) the partition information for the other.

Thoughts?? Again many thanks to all.

Reply
0 Kudos
ChipMcK
Hot Shot
Hot Shot

I am not sure where you are the the process. So, the 'cookbook' I use is as follows (derived from Apple forum postings)

cd "Library/Application Support/VMware Fusion"
Mount

Look for "/Volumes/ the volume you want

  1. Note the "/dev/disk?s?" path where the '?' are numbers

  2. Jot down as DISK_PATH up to the "s?" --> "/dev/disk?"

./vmware-rawdiskCreator print DISK_PATH

The partition table.

  1. Locate your partition

  2. Jot down as PART_NUM the value in the 'NR' column

./vmware-rawdiskCreator create DISK_PATH PART_NUM "/path_to_the_vmdk_file_to_create/nameFile" ide

You will have two .vmdk files in "/path_to_the_vmdk_file_to_create/" directory. The two files are a pair - move/copy one and the other must follow.

The following are also useful

sudo gpt -r show /dev/disk?

sudo fdisk /dev/disk?

Happy Sailing!

Reply
0 Kudos
unixwizard
Contributor
Contributor

Chip,

Thanks - sorry if my message was not clear.

I was using that cookbook and that's the problem the "create" command is failing.. with the "not a valid physical device" error

So I never get the *vmdk files created. I'm not sure why... as I said - something about my set up is causing the failure.

Would you do me small favor... look in your directory and post the contents of the first file (the ascii file) - which should be really small.

I think it will look something like:

% cat disk2.vmdk

  1. Disk descriptorfile

version=1

CID=fffffffe

parentCID=ffffffff

createType="partitionedDevice"

  1. Extent description

RW is offset (size p0p1p2 blocks I would guess, maybe +1)

  1. The Disk Data Base

  2. DDB

ddb.adapterType = "ide"

ddb.geometry.sectors = "63"

ddb.geometry.heads = "16"

ddb.geometry.cylinders = "XXXXXX"

Then please do the following:

% ls -l disk2-pt.vmdk

I think the size of the file will 512* ddb.geometry.sectors bytes - i.e. the partition cylinder on hd 0

Which means that vmware caches the partition info, including MBR and the like.

Reply
0 Kudos
mudaltsov
Expert
Expert

The "not a valid physical disk device" error is mistakenly reported by rawdiskCreator from Fusion 2 for some external drives. If you use rawdiskCreator from Fusion 3.1, it should work correctly (even if you keep version 2 of Fusion actually installed). It's possible to create the .vmdk file by hand as you're asking about, but it should not be necessary.

You can extract the Fusion 3.1 install archive manually if you want to just grab the rawdiskCreator tool without doing a full install:

/Volumes/VMware Fusion/Install VMware Fusion.app/Contents/Resources/Install VMware Fusion.mpkg/Contents/Packages/Install VMware Fusion.pkg/Contents/Archive.pax.gz


However, I would highly recommend actually upgrading to Fusion 3.1 for any raw disk activity because of several improvements:

  • Resolved issues with the changing BSD disk device number. This is especially important for external disks that can be plugged in or unplugged at any time.

  • Raw disk access uses the unbuffered /dev/rdisk* device nodes for much faster IO (95% of native or better in most cases).

  • rawdiskCreator supports specifying multiple partition numbers to reference more than one partition on the physical disk.

  • rawdiskCreator supports a "fullDevice" option to create a .vmdk referencing a whole disk device instead of individual partitions. This might be useful if you're changing the entire disk contents including the partition table.

Reply
0 Kudos
ChipMcK
Hot Shot
Hot Shot

I created a raw disk - but I am on 3.1

ddb.geometry.cylinders should reflect the total disk, not a partition of the disk

Size of disk = 63 times 255 times XXXXXX

The disk used for the rawdisk test

  1. gpt, not mbrt

  2. 3 partitions

The partitons are

  1. EFI

  2. NTFS

  3. NTFS

  4. HFS+

# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=fffffffe
parentCID=ffffffff
isNativeSnapshot="no"
createType="partitionedDevice"

# Extent description
RW 1 FLAT "testing-pt.vmdk" 0
RW 409639 ZERO 
RW 60254696 FLAT "/dev/disk2s2" 0 partitionUUID @partition:diskModel=3200AAV|20External,diskSize=320072933376,diskVendor=WD,partSize=30850404352,partOffset=209735680,partMediaUUID=7CDF687D-0CB8-4701-A3FC-43877DBEC834,partVolumeUUID=FA1CABD8-5903-47F9-8570-A369813A1851
RW 262144 ZERO 
RW 488281256 ZERO 
RW 262144 ZERO 
RW 75148280 ZERO 
RW 524288 ZERO 

# The Disk Data Base 
#DDB

ddb.adapterType = "ide"
ddb.geometry.biosSectors = "63"
ddb.geometry.biosHeads = "255"
ddb.geometry.biosCylinders = "1024"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255"
ddb.geometry.cylinders = "38913"
ddb.uuid = "60 00 C2 9c be de cd 0f-88 1f e3 1f f6 87 4d 35"
ddb.longContentID = "f8b502f191b1b12237181420fffffffe"

63 x 255 x 38913 should be 320GB disk

Happy Sailing!

Reply
0 Kudos
ChipMcK
Hot Shot
Hot Shot

Some additional data

My-iMac:VMWare Fusion My-User-Id$ sudo gpt -r show /dev/disk2
gpt show: /dev/disk2: Suspicious MBR at sector 0
      start       size  index  contents
          0          1         MBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640   60254696      2  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
   60664336     262144         
   60926480  488281256      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  549207736     262144         
  549469880   75148280      4  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  624618160     524255         
  625142415         32         Sec GPT table
  625142447          1         Sec GPT header
My-iMac:VMWare Fusion My-User-Id$ sudo fdisk /dev/disk2
Disk: /dev/disk2	geometry: 38913/255/63 [625142448 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: 07 1023 254  63 - 1023 254  63 [    409640 -   60254696] HPFS/QNX/AUX
 3: 07 1023 254  63 - 1023 254  63 [  60926480 -  488281256] HPFS/QNX/AUX
 4: AF 1023 254  63 - 1023 254  63 [ 549469880 -   75148280] HFS+        
My-iMac:VMWare Fusion My-User-Id$ 

Reply
0 Kudos
unixwizard
Contributor
Contributor

Michael:

The "not a valid physical disk device" error is mistakenly reported by rawdiskCreator from Fusion 2 for some external drives. If you use rawdiskCreator from Fusion 3.1, it should work correctly

A bug!! Thanks - I'll give the 3.1 *Creator a try - and let you know how I succeed.

I also see about the full 3.1 upgrade - I have the bits and the upgrade license; but we have been trying to keep some other things stable/consistant for a bit on that system. Hence staying on Leopard and some other tools.

Thanks again.

Reply
0 Kudos