nativeInstaller

Resize the OS X VM disk

If your OS X VM is running out of disk space, you can resize the root disk as follows:

  • Install the qemu CLI tools

    $ brew install qemu
    
  • Find and inspect the OS X VM’s disk file, usually at $HOME/.bitnami/stackman/machines/APP-NAME/vm/machine.qcow2:

    $ qemu-img info $HOME/.bitnami/stackman/machines/owncloud/vm/machine.qcow2
    image: /Users/alejandro/.bitnami/stackman/machines/owncloud/vm/machine.qcow2
    file format: qcow2
    virtual size: 100G (107374182400 bytes)
    disk size: 1.2G
    cluster_size: 65536
    Format specific information:
        compat: 1.1
        lazy refcounts: false
        refcount bits: 16
        corrupt: false
    
  • Stop the OS X VM.

  • Resize the disk file using qemu-img. You must specify the new disk size as an argument to the qemu-img command, as shown below:

    $ qemu-img resize $HOME/.bitnami/stackman/machines/owncloud/vm/machine.qcow2 100G
    
    $ qemu-img info $HOME/.bitnami/stackman/machines/owncloud/vm/machine.qcow2
    image: machine.qcow2
    file format: qcow2
    virtual size: 100G (107374182400 bytes)
    disk size: 1.2G
    cluster_size: 65536
    Format specific information:
        compat: 1.1
        lazy refcounts: false
        refcount bits: 16
        corrupt: false
    
  • Restart the OS X VM to have access to the resized disk.

IMPORTANT: These steps are not recommended for production environments or disks that store sensitive data, as the virtual disk may eventually get corrupted, resulting in data loss.

Last modification June 13, 2019