VirtualBox Operations

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Virtual Machine Deletion

Power down.

Right click -> Remove.

Delete all files. This removes everything under ~/VirtualBox VMs/<machine-name>.

Creating and Installing a new Virtual Disk

Select the VM in the VirtualBox Manager and stop It.

Settings -> Storage -> Controller: SATA -> HD Icon + -> Create new disk -> VDI -> Size Dynamically Allocated.

Detected by the O/S as /dev/sdb.

This device then can be added to an existing Volume Group (see Linux Logical Volume Management Concepts), or it can be initialized with a different Volume Groups, etc.

When doing this, update Linux Logical Volume Management Concepts with details.

Resizing an Existing Virtual Disk

Select the VM in the VirtualBox Manager and stop It.

Go to the host directory where VirtualBox maintains the file:

cd /Users/ovidiu/VirtualBox VMs/Windows/Windows10

Copy the .vdi file as a precaution:

cp Windows10.vdi  Windows10.vdi.backup

Resize it (the space is specified in MB). The following command resizes the disk to 100 GB.

VBoxManage modifyhd Windows10.vdi --resize 102400

The size does not get modified right away, but the disk will grow as needed.

After I've done this, I have not seen any change in the Windows guest, the file system has the same size. What to do next? I ended up #Creating_and_Installing_a_new_Virtual_Disk. However, a possibility is to Right Click on Start -> Disk Management -> select the partition that was just resized -> right click -> Extend Volume.

Getting Information about a Guest

Guest window -> Machine -> Session Information.

Managing an Environment from Command Line

VirtualBox Managing an Environment from Command Line