I have a USB who have a OS inside on them. now i want to create VMDK file to use them in virtualbox.

i read many article but never found that how i can use them. in a article i found the way that:-

C:program files\Oracle\VirtualBox > VBoxManage internalcommands createrawvmdk -filename D:\usb.vmdk -rawdisk \\.\physicalDrive<Disk 1> -register

it's not worked i try it without register but nothing happened if i open my diskmsgmt.msc then they show me the drive name is Disk 1 Removable

now tell me how i can do this. the problem is that when i run the command the system tell file not found.

well i try to check USB that's work fine. i thing that their is may be two reason for the certain problem

  1. disk name have a whitespace so i thing it's not worked for that.

  2. something i missing in commands.

so can anyone explain what command i need to exact then it's work fine for me.

[the certain commands i try with virtualbox not VMware]

link|improve this question

25% accept rate
feedback

migrated from stackoverflow.com Aug 21 '11 at 13:03

This question came from our site for professional and enthusiast programmers.

1 Answer

Simply open a terminal on Linux or a command-line tool on Windows (Win+R cmd) and change directory to your VirtualBox folder.

cd "C:\Program Files\Oracle\VirtualBox"

Then we run the VBoxManage command with the following options to link the USB Drive to a vmdk file (Virtual Machine Disk):

VBoxManage internalcommands createrawvmdk -filename usb.vmdk -rawdisk "path_to_usb"

For example on Linux if I want to save in /home/thomas/.VirtualBox/usb.vmdk a virtual machine disk that links to my USB in /dev/sdb, I type the following line:

VBoxManage internalcommands createrawvmdk -filename /home/thomas/.VirtualBox/usb.vmdk -rawdisk /dev/sdb

On Windows, if I want to save the virtual machine disk in C:\Users\Thomas.VirtualBox\usb.vmdk that links to my USB in in Disk 1 (according to the previous Disk Management), I type the following line:

VBoxManage internalcommands createrawvmdk -filename C:\Users\Thomas\usb.vmdk -rawdisk \\.\PhysicalDrive1

Replace the 1 in \\.\PhysicalDrive1 by YOUR device number of the USB drive (for example \\.\PhysicalDrive2).

If any path contains spaces, write it between quotation marks (") to make it work. Example:

VBoxManage internalcommands createrawvmdk -filename "C:\Documents and Settings\Carletdesiles\.VirtualBox\usb.vmdk" -rawdisk \\.\PhysicalDrive1

That's it, you have done a Virtual Machine disk that should be very tiny (~1KB) and links to your USB drive.

You just need to import this hard drive in VirtualBox and use it as primary hard drive (to boot on) for your new system.

link|improve this answer
you dont need the "-register" command. follow the text exactly and it will work. – cyberkeeper1 Dec 4 '11 at 5:16
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.