Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to run a command on a different folder.

The command I'm trying to run is

\Applications\VirtualBox.app\MacOS\VBoxManage modifyhd 
  Windows98.vdi --resize 1000

Windows98.vdi i the the following folder

\myusername\VirtualBox VMs\Windows 98\Windows98.vdi

I've tried being in the VBoxmanage folder and specifying the path of Windows98.vdi with and without double quotes.

Also being in the vdi's folder and specifying the VBoxManage path with and without quotes.

Tried forward slashes too.

Can anyone tell me what I should be doing, perhaps its a problem with slashes, I really don't know ?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

OS X is Unix based, so you need to use forward slashes / to separate directories in paths. Also, spaces in directory paths need to be prefixed by a backslash \.

You only have to specify the entire directory path if you're not already there. So, to make the command simpler, first cd to the directory with the command:

$ cd /Applications/VirtualBox.app/MacOS/

Now you can run the command (note that the ~ is just an easy way of writing /myusername/:

$ VBoxManage modifyhd ~/VirtualBox\ VMs/Windows\ 98/Windows98.vdi --resize 1000

Best of luck and welcome to the wonderful world of the OS X command line :)

Edit

As pointed out by devius, the modifyhd command requires the complete path to the .vdi.

share|improve this answer
add comment

You don't say what the problem is. I assume that the command fails. There are several things to note:

  1. resize only works if the new size is bigger than the existing size. Note that size is the size of the virtual disk and not the size of the image file. By default it's specified in MB.

  2. you have to use absolute paths with the vboxmanage tool. That is, you have to specify the complete path to the files being modified.

If you are trying to resize that image file you should go to /Applications/VirtualBox.app/MacOS and run VBoxManage from there like so:

VBoxManage modifyhd /myusername/VirtualBox\ VMs/Windows\ 98/Windows98.vdi --resize 1000

PS: Like elmugrat said you must escape spaces with \ on Unix-like OSes

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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