VM on RAW disk on Windows 7 host

Discussions related to using VirtualBox on Windows hosts.

VM on RAW disk on Windows 7 host

Postby beremour » 11. Feb 2011, 10:20

So, what is the verdict?) is it possible to fight (rc=VERR_ACCESS_DENIED) error in virtual machine, placed on RAW disk under WIndows7 host ? (as I can understand, error occurs when Windows7 host starts recognizing and protecting Partition created by VM on RAW disk)
beremour
 
Posts: 4
Joined: 12. Jan 2011, 07:32
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP

Re: VM on RAW disk on Windows 7 host

Postby Korkman » 16. Feb 2011, 01:47

This problem bugs me alot, too. What's worse: In my case, on a particular partition, VirtualBox happily acknowledges all I/O to the guest OS and only *logs* VERR_ACCESS_DENIED on writes (reads work). My guest OS does not notice anything, but any changes are lost on reboot (or when page cache is gone).

Thus far, I have not been able to tell Windows 7 to "free" the drive properly.

* running virtualbox with administrative rights did make guest boot off a Linux-only filesystem (ext2, ext3 and XFS partitions seem to work OK), but the same disk contains a FAT32 partition, on which all changes are lost
* removing all drive letters did not change anything
* offlining the disk in disk management made the whole disk behave like the FAT32 partition: guest boots into my desktop, everything works, but all changes are lost and logged with VERR_ACCESS_DENIED

It's sad to see physical disk pass-through in such a half-working state (on Windows 7, I think Linux is a far better host where a root user has actual power over the operating system).

Maybe Microsoft sealed down direct write access to partitions housing filesystems to keep things secure, so there's not much VBox can do, but even so VERR_ACCESS_DENIED on write should halt the virtual machine (waving at VBox devs).

Some research while writing this revealed this thread in "the other camp", having the same issues:
http://communities.vmware.com/docs/DOC-10455

I have not yet tried "attribute disk clear readonly", which may be my solution.
Korkman
 
Posts: 3
Joined: 16. Feb 2011, 01:09
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Debian Linux

Re: VM on RAW disk on Windows 7 host

Postby Korkman » 16. Feb 2011, 02:34

Success!

In summary:

To gain full hard drive access in a VBox guest on Win7 host

0. close all open programs or documents on any partition on the disk to pass-through
1. run DISKPART (command line utility)*
2. select hard drive carefully using SELECT DISK. disk numbering starts at zero. you can roughly verify your selection with LIST PARTITION if you know what your partitions should look like or LIST DISK to see disk sizes.
3. offline the disk using OFFLINE DISK. all volumes will disappear from windows explorer.
4. ATTRIBUTES DISK CLEAR READONLY
5. verify with ATTRIBUTES DISK
6. create VMDK file as shown in several howtos on the web
7. enjoy

As always with the dumb numeric representation of physical disks in windows: keep an eye on the ordering of your disks, especially removables, before booting the wrong one.

*administrative rights required for operating vbox and utilities but not for desktop
Korkman
 
Posts: 3
Joined: 16. Feb 2011, 01:09
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Debian Linux

Re: VM on RAW disk on Windows 7 host

Postby beremour » 21. Feb 2011, 18:49

Korkman wrote:Success!

4. ATTRIBUTES DISK CLEAR READONLY



Thank you very-very much!)) YAHOOOOO!)
beremour
 
Posts: 4
Joined: 12. Jan 2011, 07:32
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP

Re: VM on RAW disk on Windows 7 host

Postby bsod » 14. Mar 2012, 15:28

Hello,

just wanna add one thing: I had exactly the same error "VERR_ACCESS_DENIED" on starting the machine.
After some digging in the logfiles and installing various other versions of virtual box I found the line
00:00:00.436 VMSetError: D:\tinderbox\win-3.2\src\VBox\Devices\Storage\DrvVD.cpp(2054) drvvdConstruct; rc=VERR_VD_IMAGE_READ_ONLY

Just for testing I tried to recreate the raw file:
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands listpartition
s -rawdisk \\.\PhysicalDrive2
Oracle VM VirtualBox Command Line Management Interface Version 3.2.14
(C) 2005-2011 Oracle Corporation
All rights reserved.

Error opening the raw disk: VERR_SHARING_VIOLATION
(I got this error on every command)
So I searched via Process Explorer for the handle "Harddisk2" and found that OpenHardwareMonitor was accessing all Harddisk drives, after closing OpenHardwareMonitor VirtualBox is working fine now.

So it is also possible that other running programs are accessing the harddisks to trigger this error...
Im adding this just for reference (in case anybody is running into this issue).

reddragon
bsod
 
Posts: 1
Joined: 14. Mar 2012, 15:16

Re: VM on RAW disk on Windows 7 host

Postby gmchenry » 17. Mar 2012, 07:55

I can't quite find what I'm looking for, but I know the Linux equivelant.

With VBoxManage.exe, how do you list the -rawdisk flag? ie in Windows 7, what's equiv. to /dev/sda?

Can I do it by device ID? I have two 2TB hard drives mirrored in ZFS. I've installed Solaris 11 and I can't figure out how to access the pool.

Does the Windows Diskpart tell you device names/ID's?

I'll keep searching in the meantime, but if anyone's got the instant solution, let me know :-)
gmchenry
 
Posts: 3
Joined: 5. Oct 2010, 10:23
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows XP, Open Solaris

Re: VM on RAW disk on Windows 7 host

Postby virtualbrax » 10. Jun 2012, 23:26

Could this be also the solution for my problem "Using encrypted Linux LVM partition fails"?

See: https://forums.virtualbox.org/viewtopic ... 50#p227041

I was able to "sucessfully" create a VMDK file without using DISKPART.
virtualbrax
 
Posts: 6
Joined: 4. Jun 2012, 22:28

Re: VM on RAW disk on Windows 7 host

Postby oatkinson » 12. Jun 2012, 16:42

What if the partitions you are after are on the save disk as your win7 partition? Is it still safe to OFFLINE the disk?
oatkinson
 
Posts: 1
Joined: 12. Jun 2012, 16:39

Re: VM on RAW disk on Windows 7 host

Postby virtualbrax » 12. Jun 2012, 20:34

oatkinson wrote:What if the partitions you are after are on the save disk as your win7 partition? Is it still safe to OFFLINE the disk?


I did think about that and did post it in the other thread linked above (https://forums.virtualbox.org/viewtopic ... 50#p227041)

virtualbrax wrote:RAW access seems to work for a whole physical disk using this tool:
http://reboot.pro/15069/

There seems to be a way to use partitions as well, but I did not fully understand how to do that and it seems to be not very save.
virtualbrax
 
Posts: 6
Joined: 4. Jun 2012, 22:28

Re: VM on RAW disk on Windows 7 host

Postby angelcool.net » 25. Apr 2013, 06:56

Temporarily disabling User Account Control Settings (UAC) worked for me. My host is Windows 7 64b :)

enjoy!

angel
angelcool.net
 
Posts: 1
Joined: 25. Apr 2013, 06:52

Re: VM on RAW disk on Windows 7 host

Postby TaserShots » 5. Apr 2014, 18:41

Sorry if this post is not appropriate, but I'm fairly new to VirtualBox and brand new to this forum.

I'm trying to set up SpinRite to run in VirtualBox but am having problems creating the virtual raw disk. I'm running the Windows 7 Ultimate 64-bit OS.

When I run the command from an Administrator command prompt, it times out (?) stating "Most likely, the VirtualBox COM server is not running or failed to start."

I had this problem in the past trying to convert a disk but solved it by running the command from a non-Administrator command prompt. When I try that here, however, I get the VERR_ACCESS_DENIED error.

I followed the DISKPART command sequence to disable the drive and remove the "readonly" attribute. I also tried reducing UAC to its minimal setting, but no joy in either case.

Any help is appreciated as is you patience.

Thanks!
TaserShots
 
Posts: 1
Joined: 5. Apr 2014, 18:28

Re: VM on RAW disk on Windows 7 host

Postby BillG » 6. Apr 2014, 01:20

Nothing to do with raw access at all. You will always get that if you run the command as Administrator. It should work if you run it with the user account.
Bill
BillG
Volunteer
 
Posts: 3579
Joined: 19. Sep 2009, 04:44
Location: Sydney, Australia
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Win 7 Win8.1 Win10 WinServer

Re: VM on RAW disk on Windows 7 host

Postby jingking » 21. Sep 2015, 19:26

Korkman wrote:Success!

...
4. ATTRIBUTES DISK CLEAR READONLY
...


Thanks. You save my day!
jingking
 
Posts: 3
Joined: 21. Sep 2015, 19:19


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: Bing [Bot] and 46 guests