Windows7 USB external rawdisk "invalid parameter" error

Discussions related to using VirtualBox on Windows hosts.

Windows7 USB external rawdisk "invalid parameter" error

Postby Dili » 11. May 2010, 02:25

hi all,

i am trying to setup my USB external drive as a raw disk in VBox. i have read how to do this at the following link:
http://agnipulse.com/2009/07/boot-your- ... irtualbox/

here is my setup. from computer management:
Image

here is the command i used:
Code: Select all   Expand viewCollapse view
VBoxManage internalcommands createrawvmdk -filename "D:\VMs\HDDs\USB.vmdk" -rawdisk \\.\PhysicalDrive2 -register

and here is the output. notice at the bottom it says Syntax error: Invalid parameter '\\.\PhysicalDrive2':
Code: Select all   Expand viewCollapse view
Sun VirtualBox Command Line Management Interface Version 3.1.6
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

Usage: VBoxManage internalcommands <command> [command arguments]

Commands:

  createrawvmdk -filename <filename> -rawdisk <diskname>
                [-partitions <list of partition numbers> [-mbr <filename>] ]
                [-register] [-relative]
       Creates a new VMDK image which gives access to an entite host disk (if
       the parameter -partitions is not specified) or some partitions of a
       host disk. If access to individual partitions is granted, then the
       parameter -mbr can be used to specify an alternative MBR to be used
       (the partitioning information in the MBR file is ignored).
       The diskname is on Linux e.g. /dev/sda, and on Windows e.g.
       \\.\PhysicalDrive0).
       On Linux host the parameter -relative causes a VMDK file to be created
       which refers to individual partitions instead to the entire disk.
       Optionally the created image can be immediately registered.
       The necessary partition numbers can be queried with
         VBoxManage internalcommands listpartitions

WARNING: This is a development tool and shall only be used to analyse
         problems. It is completely unsupported and will change in
         incompatible ways without warning.

Syntax error: Invalid parameter '\\.\PhysicalDrive2'
Press any key to continue . . .

has anyone every encountered this problem? or does anyone see something wrong with my setup?

any help is appreciated!

thanks :D
Dili
 
Posts: 13
Joined: 10. May 2010, 17:36
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Win7, Linux

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby rolandt52 » 12. May 2010, 18:21

I have not gotten that particular error. How you tried with the double quotes removed? And is there a space between the minus sign and register? There should not be.

I have gotten this to work with two different USB HDs. So the technique is correct.

The problem I have run into is the good-old Windows 7 security model. Using my normal UAC authority (my ID is in the administrator group) I could not create the VMDK - access to the USB drive is denied. To access the physical drive to create the USB VMDKs I had to run the CMD window as administrator. But then VirtualBox Media Manager could not access the VMDKs.......... So I have to run VirtualBox as administrator when I want to test a USB boot.
rolandt52
 
Posts: 1
Joined: 12. May 2010, 18:06
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: w7 xp

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby Dili » 12. May 2010, 18:57

thanks for the reply, rolandt52!

i have already tried using double quotes and single quotes around \\.\PhysicalDrive2 but it gave the same error. also, there are no spaces in the command parameter switches (i.e. -register not - register)

there are 2 possibilities i can think of that could be causing the "invalid parameter" error:
  1. i was not running the command window with admin rights (even though i have UAC completely turned off).
  2. my USB drive is not showing up as "Removable" in disk management.
other than that i have no clue why it wouldn't be working. i will try again later making sure that the command is running with admin rights and report back.

thanks again for your reply :)
Dili
 
Posts: 13
Joined: 10. May 2010, 17:36
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Win7, Linux

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby Dili » 14. May 2010, 02:12

well i managed to get the raw disk created. i simply opened a command window in admin mode inside the Virtualbox installation directory and the command ran successfully. i was also able to use the disk in a VM and see its contents.

however, any changes to the disk made inside the VM were not saved on the physical disk itself. i also tried using the writethrough switch at the command line but still no luck. does anyone know why that could be?
Dili
 
Posts: 13
Joined: 10. May 2010, 17:36
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Win7, Linux

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby mpack » 14. May 2010, 14:59

The most likely reason is that security measures introduced in Vista (inherited by Win7) are blocking you.

I'm curious why you are doing this the hard way. Why not just create a shared folder on the removable drive? Why do you need raw access to the whole drive?
mpack
Site Moderator
 
Posts: 29348
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby Dili » 15. May 2010, 01:56

that is a very valid question, mpack.

the reason is i'm trying to access the physical itself drive outside the guest OS using bootable software. therefore, shared folders wont help me.

i am currently running with UAC off. i have even tried running Virtualbox in admin mode but still no changes are made to the drive. is there another way to bypass the windows 7 security?
Dili
 
Posts: 13
Joined: 10. May 2010, 17:36
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Win7, Linux

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby mpack » 15. May 2010, 14:01

Dili wrote:i am currently running with UAC off. i have even tried running Virtualbox in admin mode but still no changes are made to the drive.

If it's the problem I'm thinking of, neither of those things would help. The only entity allowed to do sector level writes to a drive under Windows (Vista and later) is a kernel mode device driver. However I may have been a bit quick to suspect this particular issue: if that was the problem then I would have expected something like a sharing violation when VBox requested read/write access, not simply "writes that do nothing". The latter sounds more like a drive configured for immutable operation.
mpack
Site Moderator
 
Posts: 29348
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Windows7 USB external rawdisk "invalid parameter" error

Postby Dili » 17. May 2010, 03:08

mpack wrote:The latter sounds more like a drive configured for immutable operation.

would you know how to setup a mutable rawdisk drive? as i stated before i've already tried using the writethrough switch at the VBoxManage command line but still no success.
Dili
 
Posts: 13
Joined: 10. May 2010, 17:36
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Win7, Linux


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 24 guests