3

I have VirtualBox 5 in OS X El Capitan 10.11.3. There is an option in Windows's VirtualBox to enlarge the image here described. However, I cannot find a similar way for OS X.

My storage looks like this

enter image description here

Clicking the 8.00 GB you get

enter image description here

Choose disk image and you get

enter image description here

so no similar view as in Windows.

DavidAnderson. The user manual's page 150 is here. It just describes about the command VBoxManage modifyhd but not how you can get it in your commandline.

Terminal approach

In VirtualBox 4, there was VBoxManage command to enlarge the image size, as described here about How To Resize A VirtualBox Disk (Window and Mac)

VBoxManage modifyhd “<vdi_file_full_path_and_name>” –resize 40000

I solved the PATH problem by not changing the PATH but uninstalling Macports as described here by the recursive forceful deletes, so I can now call the function without explicitly having /usr/local/bin/VBoxManage in the start of the command.

klanomath. I run successfully

/usr/local/bin/VBoxManage modifyhd "/Users/masi/VirtualBox VMs/Ubuntu 14.04 64bit/Ubuntu 14.04 64bit.vdi" --resize 10000 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

I login successfully to the encrypted system. I login successfully to my Ubuntu's user account but the session only stays in the view

enter image description here

where the Ubuntu on the host stays stacked infinite time. The encryption of the virtual disk should not be a problem because I managed to get the login view of the OS. I have not been able to login to different TTYs of Ubuntu inside the virtual machine, to debug the case further.

I login successfully as Guest and I get

enter image description here

which indicates that the size of my disk for the OS is too small. I increase successfully the space to 20 GB by the following command but I still receive the complain about no disk space in the Guest login

VBoxManage modifyhd "/Users/masi/VirtualBox VMs/Ubuntu 14.04 64bit/Ubuntu 14.04 64bit.vdi" --resize 20000

The space looks ok inside and there should be enough space

enter image description here

The storage looks now like this where the actual space increases dynamically

enter image description here

Login to my User account still stays stucked forever, like one of the screenshots indicates.

Thread in Oracle's VirtualBox Forum

I opened a thread about the issue in Oracle's VB forum here. I got this answer

https://forums.virtualbox.org/viewtopic.php?f=24&t=50661
Pay close attention to step 2

Also if you selected to use LVM when you installed you would need to use LVM to extend the primary partition. Seek assistance from Ubuntu on how to do that.

where I do not understand the thing about LVM and not content provided in the link.

The last point was solved by completely removing the existing disk and doing reinstallation of Ubuntu with 50 GB dynamic disk size. For long term stability, this method is the safest. I had backups of the files in the disk.


How can you enlarge disk image in VirtualBox?

  • 1
    The VirtualBox Version 5.1.10 User Manual explains the use of the VBoxManage modifyhd command on page 150. Exactly which version of VirtualBox are you using? – David Anderson Mar 25 '16 at 9:30
  • 1
    On my Mac running OS X 10.11.4 and VirtualBox 5.0.14 the command VBoxManage can be found in the directory (folder) /usr/local/bin. – David Anderson Mar 25 '16 at 9:50
  • 1
    You many be looking for `VBoxManage modifymedium'. – David Anderson Mar 25 '16 at 9:57
  • 1
    If VBoxManage exists in /usr/local/bin, then you should be able to execute the command by typing the full path: /usr/local/bin/VBoxManage. – David Anderson Mar 25 '16 at 10:39
  • @DavidAnderson You are right! I did first run unsuccessfully. I updated the body. – Léo Léopold Hertz 준영 Mar 25 '16 at 10:45
2

Your vdi path is wrong:

VBoxManage: error: Could not find file for the medium

In your resize command either use the uuid of the vdi or a proper path (no backslashes!) :

VBoxManage modifyhd "/Users/masi/VirtualBox VMs/Ubuntu 14.04 64bit/Ubuntu 14.04 64bit.vdi" --resize 10000

or (with backslashes but no quotation marks)

VBoxManage modifyhd /Users/masi/VirtualBox\ VMs/Ubuntu\ 14.04\ 64bit/Ubuntu\ 14.04\ 64bit.vdi --resize 10000

or after entering VBoxManage list hdds:

#replace UUID and size below by the appropriate UUID and the required size
VBoxManage modifyhd UUID --resize size

If your PATH doesn't work properly you may have to prepend /usr/local/bin/

  • 1
    @Masi It depends on what you have installed in /opt/local/bin, /opt/local/sbin or /usr/local/bin. If you have identical named executables installed and you rely on both versions to be present always choose the full path. If you have no identical named execs in the 3 paths it doesn't matter. The first exec found in the path is always executed. So, if you have an older /opt/local/bin/exec and a newer at /usr/local/bin/exec the older exec will be executed entering exec with your current PATH variable. – klanomath Mar 25 '16 at 12:21
1

I might be missing something here, but this is how I see it. You are executing the VBoxManage command to add space to your virtual disk. What does that translate to? Does this mean you are adding logical blocks to the disk? If so, then this space is not going to be automatically added the the partitions containing the file sytems. Would you not also have to execute commands from within the virtual OS or a live version of a virtual OS to expand the file sytems?

  • 1
    If you are referring to Guest Additions, I can tell you this is not needed to execute the command VBoxManage. – David Anderson Mar 25 '16 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .