73

The file is located in Program Files/Oracle/VirtualBox/VBoxManage.exe and is used as a command-line interface with VirtualBox.

I'm using it to convert the .vdi image to a .vdmk (for VMware).

http://scottlinux.com/2011/06/24/convert-vdi-to-vmdk-virtualbox-to-vmware/

Here's an example script:

$ VBoxManage list hdds

But where do I run this command? In Windows cmd? I tried both in cmd and in Linux but I can't figure it out.

user9517
  • 114,104
  • 20
  • 206
  • 289
AlxVallejo
  • 1,066
  • 4
  • 11
  • 19
  • What is the error message you see ? – user9517 Mar 01 '12 at 20:34
  • cmd.exe worked, I just had to navigate to the VirtualBox folder, I couldn't run the program from root. – AlxVallejo Mar 01 '12 at 20:47
  • You need to add the VirtualBox installation folder (i.e. default: `C:\Program Files\Oracle\VirtualBox`) to the `advanced system settings > system properties > system environment variables` to be able to run this command from cmd or powershell – Foad Mar 07 '19 at 14:00

3 Answers3

86

You need to either use the whole path for the command:

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list hdds

Or cd to the C:\Program Files\Oracle\VirtualBox directory, then:

VBoxManage.exe list hdds

Or you can add add the C:\Program Files\Oracle\VirtualBox directory to your PATH:

PATH=%PATH%;C:\Program Files\Oracle\VirtualBox

and then you can run VBoxManage from anywhere

user9517
  • 114,104
  • 20
  • 206
  • 289
  • 2
    ...or you create a `vboxmanage.bat` “stub“, somewhere in your path (e.g. I collect those in `d:\scripts`) to avoid polluting your path to endless lengths... Content: `@CALL "C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" %*` – Frank Nocke Jan 26 '16 at 11:13
  • 1
    @FrankNocke you could use mklink for a similar purpose – StayOnTarget Jun 02 '21 at 12:58
16

It's a pretty sure bet that running an exe file in Linux won't work. In Windows you do run it from the command prompt. If you get a message about the command not being found then either add the path to the command to your PATH environment variable or specify the full path to the command.

If the command runs but it's not doing what you think it should be doing then read the documentation.

John Gardeniers
  • 27,262
  • 12
  • 53
  • 108
2
  1. From the Windows7 start menu go to search programs and files folder.
  2. Type in CMD. Do not press enter.
  3. Right Click on the CMD icon and select copy.
  4. Navigate to c:\"Program Files\Oracle\VirtualBox\
  5. Right click in the window and select paste.

You should now be able to use VboxManage from the CMD window. Try typing in VboxManage /? If you see the help list then your on your way.

LRankin2
  • 31
  • 1
  • I'm not overly familiar with Windows but this *smells* like a bad idea. Surely there's a better way to change your working directory on the Windows command line. – Ladadadada May 19 '14 at 16:27
  • @Ladadadada agreed that "cd" should be the normal way, but in case of long path names i need to travel where i have already an explorer window open for that path, i tend to use this (copy/paste path) approach as well – Dennis Nolte Dec 09 '14 at 10:32