Page 1 of 1

Syntax error: Invalid parameter '–filename' in CREATERAWVMDK

Posted: 27. Jun 2019, 02:05
by vbuser_999
hi all,

I'm having a really bad experience with VB console.

admin, win7-x86, VB 5.2.30-130521 + extension pack same version, downloaded from official site.

when I want to create a simple .vmdk file from usb pendrive bootable, I receive the message in topic.

I tried with single quotes, double quotes, no quotes, reinstalled VB, power off antivirus:
nothing to do.

note that usb device is no mounted on win, or, to put it better, I didn't assign a volume letter to device, then it shoul be available to vb console, isn't?
what's the matter?

tomorrow I will redo same test on different host but always win7sp1.
EDIT: drive1 is my pendrive. thanks in advance for good answers.

this is a paste from console:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands createrawvmdk –filename "C:\Temp\test_01.vmdk" –rawdisk \\.\PhysicalDrive1
Oracle VM VirtualBox Command Line Management Interface Version 5.2.30
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage: VBoxManage internalcommands <command> [command arguments]

Commands:

  createrawvmdk -filename <filename> -rawdisk <diskname>
                [-partitions <list of partition numbers> [-mbr <filename>] ]
                [-relative]
       Creates a new VMDK image which gives access to an entire 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 or FreeBSD host the parameter -relative causes a VMDK file to
       be created which refers to individual partitions instead to the entire
       disk.
       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 '–filename'

Re: Syntax error: Invalid parameter '–filename' in CREATERAWVMDK

Posted: 27. Jun 2019, 11:22
by mpack
It might need to be two dashes in front of filename, i.e. "--" not "-".

This is a standard-ish convention for command line: a single dash is used for single letter option groups "-a -b", whereas double dash is used for verbose option names: "--filename".

Looking at the manual, it does seem to show a single dash for this argument with createrawvmdk, but everywhere else "--filename" has two dashes.

I'd also put "\\.\PhysicalDrive1" in quotes - it's good practice whenever a name contains punctuation characters, and pretty much every other time too.

Re: Syntax error: Invalid parameter '–filename' in CREATERAWVMDK

Posted: 27. Jun 2019, 14:11
by scottgus1
Here are the two raw-disk commands I have used successfully:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands listpartitions -rawdisk \\.\PhysicalDrive#

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands createrawvmdk -filename driveletter:\path\to\rawdisk.vmdk -rawdisk \\.\PhysicalDrive#
I just tried it successfully with a real drive:
C:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands createrawvmdk -filename "C:\Temp\test_01.vmdk" -rawdisk \\.\PhysicalDrive2
Your command appears to be same syntax as mine:

Code: Select all

 me: VBoxManage internalcommands createrawvmdk -filename "C:\Temp\test_01.vmdk" -rawdisk \\.\PhysicalDrive2
you: VBoxManage internalcommands createrawvmdk –filename "C:\Temp\test_01.vmdk" –rawdisk \\.\PhysicalDrive1
I'm on Virtualbox 6.0.4, you're on 5.2.30. Maybe there's been a glitch?