Opened 12 years ago
Closed 9 years ago
#11049 closed defect (fixed)
vboxmanage fails for gpt disks (windows)
Reported by: | jburke | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 4.2.0 |
Keywords: | gpt | Cc: | |
Guest type: | all | Host type: | Windows |
Description
I have drives of msdosmbr and gpt styled partition tables. The following fails for only gpt tables, but passes for any msdos styled table i have.
What i'm attempting to list partitions of a rawdisk image..
VBoxManage internalcommands listpartitions -rawdisk
.\PhysicalDrive0
passes and so do the rest of my msdosmbr partition styled drives..
However when i use
.\PhysicalDrive3 (which is currently a gpt drive), there's a long printout of something as the following..
" VBoxManage.exe: error: Two partitions start at the same place Number Type StartCHS EndCHS Size (MiB) Start (Sect) 1 0x00 0 /0 /0 0 /0 /0 9 2032808 2 0x00 0 /0 /0 0 /0 /0 9 2032808 3 0x00 0 /0 /0 0 /0 /0 9 2032808 4 0x00 0 /0 /0 0 /0 /0 9 2032808 5 0x00 0 /0 /0 0 /0 /0 9 2032808 6 0x00 0 /0 /0 0 /0 /0 9 2032808 7 0x00 0 /0 /0 0 /0 /0 9 2032808 8 0x00 0 /0 /0 0 /0 /0 9 2032808 9 0x00 0 /0 /0 0 /0 /0 9 2032808 "
I guess if this fails, then I shouldn't try to attempt to make a rawdisk .vmdk rule file for it..
(System is Win7x64) (Virtualbox ver 4.2.0 r80737)
Attachments (3)
Change History (16)
comment:1 by , 12 years ago
comment:3 by , 11 years ago
I am also experiencing this problem with GPT formatted disks. Creating a VMDK for the whole disk works without issue, but specifying a partition causes it to crash. Note that I'm not running a hybrid GPT/MBR scheme on my Windows 8.1 install either. Happening for me with version 4.3.12.
comment:4 by , 11 years ago
VBoxManage fails because partRead() doesn't check if every RTFileReadAt() call succeeds. And ReadFile() fails with ERROR_INVALID_PARAMETER, because the requested number of bytes must be multiple of sector size. I'm attaching a patch, MIT licensed, if you can use it. I've already tested it, it seems to work fine.
by , 11 years ago
Attachment: | vboxmanage_gpt.patch added |
---|
by , 11 years ago
Attachment: | vboxmanage_gpt.patch2 added |
---|
a small modification to the original patch
by , 11 years ago
Attachment: | vboxmanage_gpt.patch3 added |
---|
another modification, it replaces the original patch
comment:5 by , 11 years ago
It would be nice to have this fixed, currently its not possible to use rawdisk with Windows 7/8 (64 bit) because the they can only be installed on GPT disks.
comment:7 by , 10 years ago
mhanor attached patch worked for me. I was also able to boot a native EFI ubuntu installation, creating first a legacy mbr installed (arbitrarily) on the root partition boot sector and using it to create a rawdisk with VBoxManage.
# NOTE: /dev/sdb3 is the root of the ubuntu installation $ sudo apt-get install grub-pc-bin $ sudo grub-install --target="i386-pc" --force /dev/sdb3 $ dd if=/dev/sdb3 of=~/virtualbox-native.mbr bs=512 count=1
I finally created the vmdk with:
VBoxManage internalcommands createrawvmdk -filename C:\Temp\ubuntu.vmdk -rawdisk \\.\PhysicalDrive1 -partitions 1,2,3 -mbr C:\Temp\virtualbox-native.mbr
The interesting thing is I didn't have to make the rawdisk be able access to the EFI system partition and the VM guest doesn't need to be EFI enabled at all. The native system still continue to boot in EFI way.
I hope to see the bug in VBoxManage fixed soon.
comment:9 by , 10 years ago
+1, trying to access a partition on GPT disk, Host OS is Windows 8.1 x32. listpartitions returns nothing. Can you please incorporate the patch into the VirtualBox release? I'm not sure how to apply it myself.
comment:10 by , 10 years ago
+1, I'm experiencing same issue with the latest Virtual Box (4.3.26 and 5.0.beta2) on Windows 8.1 (x64) with GPT only formatted disk:
vboxmanage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0 vboxmanage internalcommands listpartitions -rawdisk \\.\GLOBALROOT\ArcName\multi(0)disk(0)rdisk(0) vboxmanage internalcommands createrawvmdk -filename acerLucji.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 6 vboxmanage internalcommands createrawvmdk -filename acerLucji.vmdk -rawdisk \\.\GLOBALROOT\ArcName\multi(0)disk(0)rdisk(0) -partitions 6
Any of the above commands causes vboxmanage APPCRASH and no results or error messages are displayed in the command line.
Is there a chance to include vboxmanage_gpt.patch, added by mhanor 12 months ago, to the upcoming Virtual Box 5.0 or the next 4.3.x bugfix release?
comment:11 by , 10 years ago
Should be fixed in 5.0.0_BETA4 (not using the patch which apparently wasn't only hard for me to understand what it really does, but with a hopefully working, independent change). If I don't forget I will dig out the changeset with the fix once it has reached the public source repo.
comment:13 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I am succeeding, under Win8 x64 with Virtualbox 4.2.12 (and previous versions), to create a rawdisk for the whole drive which is formatted using GPT, but when I try to access individual partitions, using either "listpartitions" or "-partitions x,y,z -mbr mbrfile", vboxmanage crashes. Windows shows the following problem details:
Maybe the problem is in the partitioning scheme, since the partition numbers are not consecutive. Under linux, parted shows this:
It is important for me to be able to use a custom mbr, because virtualbox does not store uefi settings and therefore would by default always boot windows from that drive.