Trying to use raw partitions and need some help

Discussions related to using VirtualBox on Windows hosts.
Post Reply
keef
Posts: 4
Joined: 27. Jan 2009, 16:55

Trying to use raw partitions and need some help

Post by keef »

I've googled and search these forums but can't find an idiots guide to getting raw partitions to work.

The host OS I am using is Windows Server 2008, I have the latest version of virtual box and all works fine.

I've got a 80GB Hard disk that I've partitoned useing windows disk manager so that I have a.
C: Drive 20Gb
D: Drive 15Gb
12 Gb Raw Partition
29 Gb Unallocated space....

I want to use the 12Gb partition to install a vm onto so I run the following command to list the partitions.....

c:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe internalcommands listpartitions
-rawdisk \\.\PhysicalDrive0
VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x07 0 /32 /33 1023/254/63 20000 2048 = My C drive
2 0x07 1023/254/63 1023/254/63 15000 40962048 = My D drive
3 0x06 1023/254/63 1023/254/63 12000 71682048 = 12Gig partition for my MV

It seems that I want to use partition 3, so I use the following command to create the vmdk....


c:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe internalcommands createrawvmdk
-filename D:\Virtual_Boxs\Disks\KeithsMailBox.vmdk -rawdisk \\.\PhysicalDrive0
-partitions 3 -register

I can now create a new VM using the disk partition I just created and boot the VM with a XP iso and after a
minute of the boot process I get to the disk setup part, But I can still see both my C: and D: drives!

I didn't expect the VM would be able to see the rest of the drive and so have tried a few work arounds.
I've tried creating a mbr file using DD and I've also tried editing the .vmdk file and removing the partitions that
I didn't want but both had issues.

Can someone help ? or point me in the write direction ?

Thanks
Keith
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Post by baf »

Hi post your vmdk file here so we can see it(before hand edits).
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
keef
Posts: 4
Joined: 27. Jan 2009, 16:55

My unedited KeithsMailBox.vmdk file

Post by keef »

# Disk DescriptorFile
version=1
CID=be0325fb
parentCID=ffffffff
createType="partitionedDevice"

# Extent description
RW 2048 FLAT "KeithsMailBox-pt.vmdk"
RW 40960000 ZERO
RW 30720000 ZERO
RW 24576000 FLAT "\\.\PhysicalDrive0" 71682048
RW 59991952 ZERO

# The disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="613f6c95-1d16-4f16-abb2-7559d33c61c5"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Post by baf »

# Extent description
RW 2048 FLAT "KeithsMailBox-pt.vmdk"
RW 40960000 ZERO
RW 30720000 ZERO
RW 24576000 FLAT "\\.\PhysicalDrive0" 71682048
RW 59991952 ZERO

Means:
First 2048 sectors from KeithsMailBox-pt.vmdk (MBR+some)
many zeroes 20GB C:
many zeroes 15GB D:
12.x GB data from the disk starting at pos 35.x GB
30GB Zeroes (the rest)

So in effect your virtual machine can only reach whats part of its partition.
What you see is only a "ghost" of the other partitions.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Just make sure that you have recent backups of all your data when messing around with RAW disk access. If something screw it up, you still have your data.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
keef
Posts: 4
Joined: 27. Jan 2009, 16:55

Tried it but it didn't work .

Post by keef »

I backed up the whole machine yesterday as I know how risky this can be. Anyway I recreated the vmdk files again along with a new virtual machine and tried to install XP. Unfortunatly it failed with the following error.....

Windows XP Professional Setup

Setup was unable to format drive C. The hard disk may be damaged.
Make sure the disk in on and properly connected
to your computer. If the disk is a SCSI disk, make sure your SCSI
devices are properly terminated. See your computer or SCSI
adapter documentation for more information.....

Any ideas ?

.................................

Image
Selecting the partitionl to install windows

Image
Press F to Format disk....

Image
Can't Format disk error!
.................................

C:\Users\keith>"c:\Program Files\Sun\xVM VirtualBox\VBoxManage.exe" internalcomm
ands createrawvmdk -filename D:\Virtual_Boxs\Disks\KeithsMailBox.vmdk -rawdisk \
\.\PhysicalDrive0 -partitions 3 -register
VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

RAW host disk access VMDK file D:\Virtual_Boxs\Disks\KeithsMailBox.vmdk created
successfully.

C:\Users\keith>

===============================================================================
# Disk DescriptorFile
version=1
CID=7e98cfc8
parentCID=ffffffff
createType="partitionedDevice"

# Extent description
RW 2048 FLAT "KeithsMailBox-pt.vmdk"
RW 40960000 ZERO
RW 30720000 ZERO
RW 24576000 FLAT "\\.\PhysicalDrive0" 71682048
RW 59991952 ZERO

# The disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="fbeaa7c9-8031-4e16-82d3-1df62fc8e6bf"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"

===============================================================================
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Post by baf »

Select the third partition (E) instead.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
keef
Posts: 4
Joined: 27. Jan 2009, 16:55

VirtualBox on Windows Hosts - Update

Post by keef »

I did select the E partition, then on the next screen windows refers to the disk as C and asks about formatting it...

Has anyone got this working with a windows host and running a windows VM in a raw partition ? It seems that all the posts that I've read on this forum and that I've found via googled it appears that people are using linux as the host OS ?
Post Reply