VMware Communities
continuum
Immortal
Immortal

new possible workaround for rawdisk access under Windows 7

if you used physical disks with VMs a lot under XP or 2003 you surely have noticed that this is a pain with Vista or Windows 7 hosts.

Joakim has written a tool to work around the issues.

here is something that maybe even better - check yourself

http://www.boot-land.net/forums/index.php?noref=1&showtopic=12413

I'll report after testing myself


Shortcut added: If you find this post through a search engine and just want to jump to the conclusion read post 17.
At the moment that seems to be the most reliable way to operate physical disks inside a VM.

_________________________

VMX-parameters- WS FAQ -[ MOAcd|http://sanbarrow.com/moa241.html] - VMDK-Handbook


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

38 Replies
jokke
Expert
Expert

Definetely. It seems like he's using the native api's instead of the horrible and dirty workaround.

Actually I am a little curious about this tool and would like to hear about reports with vmware usage and how it behaves.

Joakim

continuum
Immortal
Immortal

first test :

host 2008 R2

guest : Win7 PE on local USB disk - diskmanagement detects it as physical disk2

starting without the tool WS 7.11 runs into

maybe 30 seconds after boot of the VM

with the tool and physical disk2 locked everything is fine

test win Win 7 64 coming next




_________________________

VMX-parameters- WS FAQ -[ MOAcd|http://sanbarrow.com/moa241.html] - VMDK-Handbook


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
jokke
Expert
Expert

Do you know if it's possible to lock individual partitions with it?

Joakim

Reply
0 Kudos
continuum
Immortal
Immortal

nope - the tools only asks for full disks and locks all partitions that exist on specified disk.

But if you then create a "partitionedDevice" vmdk it works as expected = partitions excluded from the vmdk can not be mounted from the guest




_________________________

VMX-parameters- WS FAQ -[ MOAcd|http://sanbarrow.com/moa241.html] - VMDK-Handbook


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
L4M4R
Contributor
Contributor

is it possible to dismount more than 1 drive with that tool? Because I simply can't

Reply
0 Kudos
continuum
Immortal
Immortal

not sitting on my windows7 right now ... can't you launch it a second time ?




_________________________

VMX-parameters- WS FAQ -[ MOAcd|http://sanbarrow.com/moa241.html] - VMDK-Handbook


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
L4M4R
Contributor
Contributor

I can, but then I need to leave it open 2 times, which sucks a bit.... the CLI docu is just not logical to me, no matter what I try I cannot dismount a drive with CLI thus not needing to use 2 open instances I guess?

Command I use: ld.exe -force 1
.\PhysicalDrive1[/b] doesn't do anything

Reply
0 Kudos
jokke
Expert
Expert

For Windows 7 you might just as well put the disk offline with diskpart. It really does the same thing, and has no limitation in number of drivers..

Joakim

Reply
0 Kudos
L4M4R
Contributor
Contributor

Diskpart offline does not work ony My Win Srv 2008 R2

Reply
0 Kudos
Loren_Pechtel
Contributor
Contributor

Thank you!!!

I've been fighting this for the last 4 hours before I found your answer.

The previously mentioned LockDismount doesn't appear to do anything from the command line, run from the GUI it seems to work but attempting to install my VM still dies.  Taking it offline with Diskpart did it.

Reply
0 Kudos
Charjol
Contributor
Contributor

Yet another workaround that I found: The full system disk encryption feature of TrueCrypt software.

I have found this by accident. I have found this thread some time ago and haven since been a happy LockDismount user. In the while I have used TrueCrypt on my guest which would still work fine both as a VM and native. Then some time later there was some fiddling with my hard disk drives which changed positions. I had to rebuild the virtual disk file for the guest but didn't pay attention to the batch file I have made to start Workstation along with LockDismount. Only some time later I have found that my LockDismount shortcut wasn't pointing to the right drive and not locking anything anymore with the VM still running well. Confirmed with totally disabling LockDismount.

I figure because the partitions on the guest hard drive become raw partitions as they get encrypted, Windows cannot mount them anymore and whatever mandatory locking that was necessary before becomes pointless...

At any rate, it works, even though TrueCrypt's security features get heavily compromised by running into a VM.

Reply
0 Kudos
burritoboy9984
Contributor
Contributor

So what is the general concensus on the best way to acheive this with multiple drives? I have 20 drives that I need to be able to do this with. Running workstation 7.1.4 under windows 7 64bit. I should be getting able to get some time to test this week.

Thanks for any advice in advance!

-Erik

Reply
0 Kudos
continuum
Immortal
Immortal

try diskpart first


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
WoodyZ
Immortal
Immortal

So what is the general concensus on the best way to acheive this with multiple drives?

I don't know that there is a general consensus on the best way however I've used both LockDismount and DISKPART and both have worked however I'd use neither and instead use Disk Management (diskmgmt.msc).,

Click the Start Orb.

Type diskmgmt.msc and press Enter.

Right-click the target Disk and select Change Drive Letter and Paths...

Click Remove button.

Click Yes button.

Open VMware Workstation and Power On the Virtual Machine.

This is the method that I've been using under Windows 7 when I need to run a Virtual Machine that is using a Physical Disk and is IMO much easier then using DISKPART and was more reliable then LockDismount.  DISKPART works but is a Console application and requires a lot of typing or wrapping a script around it and LockDismount something requires running it two or more times to get it to preform its actions as it would just outright fail to do it the first time with constancy.

Reply
0 Kudos
continuum
Immortal
Immortal

Woody - I am extremly surpriised that that works for you at all.

Most folks must use the step you mentioned PLUS setting the disk offline with diskpart


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
WoodyZ
Immortal
Immortal

I have not had to do anything other then to use diskmgmt.msc however I do this mostly with removable disks vs internal disks so that may be the difference however so far I haven't had to do anything more then what I've mentioned.  I also do it immediately after plugging in the disk or when starting the system and that also may be a contributing factor vs having had the disk online and using the disk for a while before removing it and running the Virtual Machine.

Reply
0 Kudos
burritoboy9984
Contributor
Contributor

Like so?

"To use the whole physical disk under Server 2008 and Windows7, the most easy way is to put the disk offline. To do that start diskpart.exe and select your disk, then enter "offline disk", then "attribute disk clear readonly", then "rescan". That's how simple (and safe) it can be!"

Taken from here.

Thanks again for the quick responses!

-Erik

continuum
Immortal
Immortal

yes


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
burritoboy9984
Contributor
Contributor

continuum, is there a way around the 4 raw disk limit in workstation. I have a 20 bay home nas server I am putting together, and would like to run openfiler/freenas in workstation. I saw http://communities.vmware.com/thread/205610, but forgive my ignorance, I never saw the question answered/where the discussion was heading.

Thanks again for all your help!

-Erik

Reply
0 Kudos