Accessing other physical drives

Discussions about using Windows guests in VirtualBox.
Post Reply
w2tq
Posts: 24
Joined: 2. May 2014, 22:12

Accessing other physical drives

Post by w2tq »

Host: OpenSuSE 13.1
Guest: Windows XP sp3

The pc has five separate hard drives (dual boot; under Windows, Disk 0-4; Linux, sda-sde). When booting into Windows, one of the drives functions as the Windows swap drive, physically separate from the C drive containing the OS. Another drive performs the same function for the Photoshop scratch disk.

I wish to access these drives from the Windows XP guest for the same purposes. While I have enabled read-write access to all of the drives (all five) and can access them, only the drive containing the virtual machine (drive 0) and the CD/DVD (passthrough) appear in Windows disk management. In order to reassign the swap memory, computer management must recognize the other drive(s).

Section 9.9.1 in the VirtualBox manual discusses raw host disks, but it is not clear to me that the procedures discussed there will enable me to create the desired configuration. I have also tried adding controllers and drives with the machine powered down, but while I can see all of the drives, the interface does not allow me to add another physical drive.

All suggestions welcome. Thank you.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Accessing other physical drives

Post by Perryg »

Disks of different formats are not native to Windows. You should check on what you need to make this happen. Google ext3 in windows
w2tq
Posts: 24
Joined: 2. May 2014, 22:12

Re: Accessing other physical drives

Post by w2tq »

Disk format is not an issue. All of the disks are accessible under native Windows and Linux, and the Windows guest.

My question is how to get the Windows guest to see the drives as connected devices, as in device manager (not just access them).
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Accessing other physical drives

Post by Perryg »

RAW is the only way and you may need to set the chipset to ICH9
Windows does have a permission issue that you will need to work around, just be certain that you don't mount the hosts partition as this will cause corruption ( as warned in the manual )
w2tq
Posts: 24
Joined: 2. May 2014, 22:12

Re: Accessing other physical drives

Post by w2tq »

Should I follow the directions in section 9.9.1? Will that enable mounting of the physical drives, either the whole drive or a partition, in the Windows guest? (That was my original question.)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Accessing other physical drives

Post by Perryg »

I can't tell you exactly what to do for several reasons. Not knowing exactly what the partitions and drive structure looks like being the first, but I would *NOT* try to include the entire drive. Use partitions and stay away from the drive/partition that has the host. This is a very dangerous activity and one I don't advise on since you will corrupt the drive if you make one little mistake.
w2tq
Posts: 24
Joined: 2. May 2014, 22:12

Re: Accessing other physical drives

Post by w2tq »

Please see my original post. There is no data, programs, OS, or anything else on these two drives. One is simply a repository for the Windows swap and the other Photoshop scratch disk.

Based on the prior responses, I am not sure that I have framed the question properly.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Accessing other physical drives

Post by BillG »

I think that your basic problem is the way you look at the virtual machine. You are looking at it as if it was somehow part of the host machine, but it is not. The vm is a separate entity with its own emulated hardware. It does not see the hardware of the physical machine - it sees its own devices. If you want the vm to have a swap file on a separate device, create an additional virtual hard drive and allocate it to the vm.

Trying to access the partitions of the physical hard drive from the vm is possible but not recommended.
Bill
w2tq
Posts: 24
Joined: 2. May 2014, 22:12

Re: Accessing other physical drives

Post by w2tq »

BiilG -

Thank you for your reply. I do understand that the Windows guest is its own entity.

This is my first experience with VirtualBox, and except for this issue, everything is running quite well - Windows XP sp3, a number of legacy applications, network printing, and full read/write access to every drive on the machine.

I did previously create a virtual hard drive as a swap disk, but it is on the same physical drive. And that is what I am trying to avoid - simultaneous or near simultaneous accesses of the same physical drive.

Perhaps what I wish to do is not possible under VirtualBox. But I do note (and did state in the original post) that the CD/DVD drive is recognized via a passthrough. Again, this may not be available for a second SATA drive under VirtualBox.

I do not understand what you meant by "not recommended." Except for the cautions in section 9.9.1 [https://www.virtualbox.org/manual/ch09.html#rawdisk], it appears that this is permissible in a VirtualBox configuration. Indeed, access to a partition under 9.9.1.2 seems even less problematic. What am I missing here?

Thank you.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, OSX
Location: U S of A

Re: Accessing other physical drives

Post by ChipMcK »

w2tq wrote:I did previously create a virtual hard drive as a swap disk, but it is on the same physical drive. And that is what I am trying to avoid - simultaneous or near simultaneous accesses of the same physical drive.
Simpler would be to move the file for this 2nd virtual hard drive to another volume. You will need to tell VirtualBox about such a move via the Virtual Media Manager (Cmd-D). Remember that this move will make it more difficult to BackUp/Restore the Virtual Machine
w2tq
Posts: 24
Joined: 2. May 2014, 22:12

Re: Accessing other physical drives

Post by w2tq »

I have tried to enable access to the partition on the drive using the technique outlined in sec. 9.9.1.2 (Access to individual physical hard disk partitions), but received the following errror:

Code: Select all

linux-5:~ # VBoxManage internalcommands createrawvmdk -filename /root/VirtualBox_VMs/WindowsXP/rawE.vmdk -rawdisk /dev/sdd -partitions 1
VBoxManage: error: VMDK: could not create new file '/root/VirtualBox_VMs/WindowsXP/rawE.vmdk'
VBoxManage: error: Error code VERR_FILE_NOT_FOUND at /home/vbox/vbox-4.3.10/src/VBox/Storage/VMDK.cpp(3425) in function int vmdkCreateRawImage(PVMDKIMAGE, PVBOXHDDRAW, uint64_t)
VBoxManage: error: Cannot create the raw disk VMDK: VERR_FILE_NOT_FOUND
VBoxManage: error: The raw disk vmdk file was not created
linux-5:~ # 
The command appears to be looking for a file, but except for the VirtualBox.xml file under /root/.config/Virtualbox, all the files are located in /root/VirtualBox_VMs/WindowsXP/

I understand the risks of operating as root and have always done this, so please no comments on this aspect. Thank you.
Post Reply