Page 1 of 1

Need HowTo for WinXP guest on rawdisk under Win7 host

Posted: 17. Jan 2011, 03:00
by pjfarley3
Hi All,

Newbie VB user here (one week). I have been able to create a virtual WinXP using a virtual drive and booting from a WinXP CD, works like a charm. Running Win7 on a brand new HP core i7 desktop, VB 4.0.0 PUEL.

Now I want to move a working WinXP physical drive from my old desktop (a *copy* of the WinXP C: drive, not the original) into my Win7 box (i.e., a second physical drive inthe Win7 box, separate from the host Win7 drive) and use it as a rawdisk to a virtual machine.

My first question is: How to specify the second physical drive to VBoxManage (i.e., the correct syntax). To test if I got the syntax correct, I tried to list the partitions on the second drive in a Win7 command shell like this:

C:\Users\<MyUserName>\VirtualBox VMs\WinXP Home on HDD>VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive1
VBoxManage.exe: error: Cannot open the raw disk: VERR_ACCESS_DENIED

Is that syntax (\\.\PhysicalDrive1) correct? If that is correct, why am I getting the "access denied" error?

TIA for any help or advice you can give me. I did try searching the forums for references to "rawdisk", but all of the ones I saw seem to be for Linux hosts, and I have a Win7 host.

Peter

Re: Need HowTo for WinXP guest on rawdisk under Win7 host

Posted: 22. Feb 2011, 18:13
by zlock
Have a similar problem. Running 4.0.4 on Windows 7 64 bit.

Would very much like to get access to my old Gentoo 64bit SATA drive this way and all the "internalcommands" gives me is VERR_ACCESS_DENIED.
I read somewhere that using DISKPART and setting the drive offline, removing the "READ-Only" attribute on the disk would solve it. But that did not help.

Did you solve this ?

Is there anyone that sucessfully has crerated a vmdk on a Windows 7 64 bit host on a raw disk with an already functional OS ?

Re: Need HowTo for WinXP guest on rawdisk under Win7 host

Posted: 24. Mar 2011, 10:20
by dotku
You must use "Run As Administrator" to get the access permit

Re: Need HowTo for WinXP guest on rawdisk under Win7 host

Posted: 24. Mar 2011, 16:50
by mpack
Raw disk access is an expert level feature - if you need to ask how to use it then you really shouldn't be using it, especially since there are few genuine reasons to need it.

I would suggest an alternative strategy: use Disk2VHD to create a virtual disk copy of your old hard disk, temporarily writing the copy to an external USB drive - formatted with NTFS so it has no 4GB file size limit. Then as you planned, install a 2nd hard drive in your new Win7 host, and copy the .VHD file onto that (*). If you wish, that 2nd drive can be the one taken out of your old PC - however you may find that a 1TB SATA drive is a better long term investment.

Now you should have no permissions problems, nor any danger of corrupting a physical drive.

(*) As an optional step you could use CloneVDI to convert VHD to VDI, as in my opinion VDI is a better fit for VirtualBox users. In this case just get CloneVDI to do the external to internal drive copy for you: that way you get the VDI conversion for free...

Re: Need HowTo for WinXP guest on rawdisk under Win7 host

Posted: 5. Apr 2011, 05:19
by hhspiny
first find out which disk you are allowing vb to have raw disk access to. it can be found in win7 host's storage manager. find out the disk number as indicated there such as "disk 0", "disk 1". note that depends on how you connect disk to sata/ide ports, the number could change if connection changes.

the in win7 host, open an administrator right command line. let's assume the disk you identified above is disk 0
>diskpart
>select disk 0
>attributes disk clear readonly
>exit

then use command

c:\program file\oracle\vboxmanager internalcommands createrawvmdk -filename c:\disk0.vmdk -rawdisk \\.\PhysicalDrive0

now you can use disk0.vmdk as the virutal disk to mount in virtual machine

Re: Need HowTo for WinXP guest on rawdisk under Win7 host

Posted: 14. Jul 2014, 07:27
by diablo465
I ran command prompd using administrator and run the command as suggest, but it failed.


DISKPART> attributes disk clear readonly

DiskPart failed to clear disk attributes.

DISKPART>