Raw VMDK using disk ID
Raw VMDK using disk ID
I'm running a Win7 guest under a Win10 host, and it's using a VMDK that refers to an entire physical drive as "\\.\PhysicalDrive2". Sometimes this path changes. Is there a way to reference the drive by some fixed id in Windows? I've found descriptions of how to do this on a Linux host, but not in Windows. There is a 32-bit id that can be retrieved by the diskpart "uniqueid disk" command, but is there a way to refer to a disk by that id in the vmdk file?
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Raw VMDK using disk ID
Unfortunately, no, not on Windows. Thus the expert status of Raw Disk Access. You need to check that number each time lest the wrong disk gets used.pderocco wrote:Sometimes this path changes. Is there a way to reference the drive by some fixed id in Windows?
There may be (and I believe there is) some unique UUID or other such number for each drive accessible through a Diskpart script or WMI search that can cross-tabulate each disk's UUID and physical disk number. A VBscript could be made to gather the information, determine the correct physical disk number, then write the raw disk access file before starting the VM.
Re: Raw VMDK using disk ID
Is there a way to invoke such a script or program from the .vbox file?
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Raw VMDK using disk ID
No, it would only be from a batch file or shortcut. Virtualbox does not have a setting for running a script before starting the VM, though that could be a useful addition.
You'd have to be careful to use the script to start the VM, not the main Virtualbox window.
You'd have to be careful to use the script to start the VM, not the main Virtualbox window.