VirtualBox - command line

In VirtualBox, not all settings can be changed from the GUI. The part is changed using the command line. Changing the size of the hard drive

The hard disk of a virtual machine is usually located in the directories ~/VirtualBox then the name of the virtual machine or ~/.VirtualBox/HardDisks

Note

Changing the disk size is possible only for disks in VDI format. Disks imported from an OVA image cannot be expanded with this command!

Resizing the hard drive

Change the size with the command:

VBoxManage modifyhd Your_disk.vdi –resize size_in_Mb

The path to the disk will have to be specified in full. In the current version 5 of VirtualBox (command service VBoxManage), the modifyhd command has been replaced by modifymedium.

More details. For example, if you want to set the disk size to 12000 Megabytes (12 GB) then run:

VBoxManage modifyhd natty.vdi –resize 12000

Changing the amount of RAM

Go to the directory C\:ProgramFiles\Oracle\Virtualbox and run the command:

VBoxManage modifyvm «machine_name» –memory 4000

The size of RAM is indicated in megabytes; it allows you to specify more memory for the virtual machine than is available on the real machine.

Note

After setting more memory than is available on the host machine, you will not be able to edit the properties of the machine. graphical interface. !!

Changing the OS name

The OS name is changed with a command like:

VboxManage modifyvm «имя_машины_до» –name NEW_NAME

Quotes in the new machine name are optional.

Converting VMWare vmdk image to VirtualBox vdi

The manual is taken from the site - https://vmblog.ru/konvertaciya-obraza-vmware-vmdk-v-virtualbox-vdi/

This article describes how to convert a virtual machine image in the VMWare format (vmdk file) into the Oracle VirtualBox format (vdi - VirtualBox Disk Image). This technique will help you easily launch a virtual machine created in the VMWare environment on a computer with VirtualBox installed.

We will need a desktop virtualization environment - Oracle VirtualBox. Download the distribution and install VirtualBox. Copy the vmdk files of the virtual machine to your local disk and run a command prompt with administrator rights and go to the directory with VirtualBox:

cd c: \Program Files\Oracle\VirtualBox\

Now let’s run the built-in VBoxManage utility with the clonehd parameter to create a copy of the virtual machine data file and convert it from VMDK to VDI format.

Note

Note. Before starting the conversion, you need to delete snapshots of the virtual machine and make sure that the disk is not used by running virtual machines.

VBoxManage clonehd --format VDI D:\clonation\PROJECT.virtual.vmdk D:\Virtual.vdi

Now in VirtualBox you can create a new virtual machine and connect the resulting vdi disk to it. The converted disk will be located in the root of the D:\ folder