Problem creating a VMDK to access raw partitions

Discussions related to using VirtualBox on Windows hosts.
Post Reply
closetpacifist
Posts: 2
Joined: 11. Jun 2007, 19:33

Problem creating a VMDK to access raw partitions

Post by closetpacifist »

Hello, I like how VirtualBox works, but I've had one problem with it. I'm trying to create a VMDK file that will let me access my Linux partition from a VM on my Windows XP install, but I keep getting a VERR_SHARING_VIOLATION error. Could this means that I don't have permission to access the hard drive, and if so is it possible in Windows to change things so that one has permission? My account is an administrator account.

If I don't specify partitions, the command works fine, but I'd rather have the .vmdk limited to the Linux partitions. It seems like it's just having trouble creating the file C:\linux-pt.vmdk; I don't know why that should be the case. Could this be a bug?

Here's the exact command I've been using, and the resulting error:

Code: Select all

C:\Program Files\innotek VirtualBox>VBoxManage.exe internalcommands createrawvmdk -filename C:\linux.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 3,5
VirtualBox Command Line Management Interface Version 1.4.0
(C) 2005-2007 innotek GmbH
All rights reserved.

ERROR: VMDK: could not create new partition data file 'C:\linux-pt.vmdk'
Error code VERR_SHARING_VIOLATION at E:\vbox\w32-rel\src\VBox\Devices\Storage\VmdkHDDCore.cpp(2228) in function vmdkCreateImage
Error while creating the raw disk VMDK: VERR_SHARING_VIOLATION
Thanks a lot for any help you can provide!
freedomfury
Posts: 1
Joined: 13. Jun 2007, 08:58

Post by freedomfury »

Im having the same issue here :(

C:\Program Files\innotek VirtualBox>VBoxManage internalcommands createrawvmdk -f
ilename F:\LinuxVirtual\xBoxOS.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 0
VirtualBox Command Line Management Interface Version 1.4.0
(C) 2005-2007 innotek GmbH
All rights reserved.

ERROR: VMDK: could not create new partition data file 'F:\LinuxVirtual\xBoxOS-pt
.vmdk'
Error code VERR_SHARING_VIOLATION at E:\vbox\w32-rel\src\VBox\Devices\Storage\Vm
dkHDDCore.cpp(2228) in function vmdkCreateImage
Error while creating the raw disk VMDK: VERR_SHARING_VIOLATION

C:\Program Files\innotek VirtualBox>
nedig_structmri
Posts: 1
Joined: 15. Jun 2007, 12:33
Location: Jena

Problem creating a VMDK to access raw partitions

Post by nedig_structmri »

Same problem here:

WXP on PIV 4GB RAM with 500 GB HD, trying to create direct disc access from WXP to partitions 1 and 8

Partitions
1 fat32 2GB (C:, setup & maintenance)
5 ntfs 20GB (D:, WXP)
6 ntfs 30 GB (E: W2KAS)
7 ntfs 400 GB (F: DATA)
8 none 10 GB (F7 should go here)

The aim: to test parallel execution of WXP, W2KAS & Fedora 7 all running with direct disc access, 2 of them using virtualbox. Have tested direct disc access under F7 with W2KPro on a different machine, worked well with explicit chmod 666 to /dev/sdaX.

Since the machine is currently not physically accessible, I cannot do a fresh install of F7, so I wanted to install through VBox, and then boot to F7 partition from WXP boot menu, then having the choice of using WXP as host, and W2KAS and F7 as guests, or F7 as host, and WXP and W2KAS as guests. Three network cards, each dedicated.

Now: same problem, createrawvmdk with -partitions creates access violation when executed as local admin. Had a similar problem with installing software at some time, when full admin rights were not granted because machine was part of a domain. This one is, too, so I wonder whether this has anything to do with it.

Maybe the WXP inbuilt terminal server and telnet functions prevent any direct disk acces, but even running a script on system startup via tasks as localadmin did not succeed.

Any help appreciated
closetpacifist
Posts: 2
Joined: 11. Jun 2007, 19:33

Post by closetpacifist »

I wonder if this error may just be a bug in the Windows version? The error occurs in reference to just creating/opening the linux-pt.vmdk file, apparently not in reference to any attempt to actually access the raw partitions themselves. Creating this .vmdk file shouldn't require any particular special permissions.

VERR_SHARING_VIOLATION apparently means that the file's being accessed by another process. This seems very unlikely unless maybe two parts of VirtualBox are trying to open the file independently?

Here's the line of code that that VBoxManage.exe complains about. I'd try playing around with it myself but apparently the free version of Visual C++ doesn't have the libraries necessary to compile VBoxManage.exe.

Best of luck everyone!
guyr
Posts: 34
Joined: 14. May 2007, 06:55

Post by guyr »

See the second page on this thread: http://forums.virtualbox.org/viewtopic. ... aterawvmdk

achimba states that access to Linux raw partitions from Windows hosts is not currently possible.
Guy Rouillier
Post Reply