Category: Virtualbox

How to install the Virtualbox SDK

Download and extract the SDK package. The target directory will be sdk.

If we try to execute directly the installer we will get:

python sdk/installer/vboxapisetup.py install
Traceback (most recent call last):
  File "sdk/installer/vboxapisetup.py", line 88, in <module>
    main(sys.argv)
  File "sdk/installer/vboxapisetup.py", line 61, in main
    raise Exception("No VBOX_INSTALL_PATH defined, exiting")
Exception: No VBOX_INSTALL_PATH defined, exiting

To install correctly we have to launch locally the install script.

cd sdk/installer
export VBOX_INSTALL_PATH=$(which virtualbox)
sudo -E python vboxapisetup.py install

VirtualBox: change the vdi UUID

When you setup a new virtual machine and choose an existing vdi file, if this has already been registered, you will get an error like this:

VBoxManage: error: Cannot register the hard disk
 '/media/cesare/transcend_ext4/virtualbox/vdi_install/linux_mint13_mate_x64_install.vdi'
 {a6826c8b-4440-4ab4-8b66-eec560def024} because a hard disk
 '/home/cesare/virtualbox/vdi/linux_mint13_mate_x64_install.vdi'
 with UUID {a6826c8b-4440-4ab4-8b66-eec560def024} already exists

A simple command to change the UUID will solve:

vboxmanage internalcommands sethduuid <path_to_the_vm.vdi>

 

Virtualbox: change the VM setting time and date

The bios time of the guest VM is automatically synchronized with the host time. I didn’t know that before and when I try to change the time of a guest VM running Windows XP, I am not able to modify it permanently and in the VirtualBox Management GUI I can’t see any option to edit this feature.

I have a particular application running on Windows only for which the licence has expired few years ago. Following how to set up your guest VM living in the past.

Get the UUID, look at the line In use by VMs, the vdi file must be used by any guest VM.

$ vboxmanage showhdinfo xp_eng_sp3.vdi 
UUID:                 00bb9751-d8a2-457d-8a0e-3b6c12d49cf3
Accessible:           yes
Logical size:         266240 MBytes
Current size on disk: 7089 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
In use by VMs:        windows xp (UUID: 7425961e-ac67-4f6d-bf92-0677e5f87f8f)

Vboxmanage provides the option –biossystemtimeoffset <msec> where you can pass the time offset expressed in milliseconds and adjust the time in the future or in the past.

I have to go back in the past of 4 years, so the offset will be: 1000 x 60 x 60 x 24 x 365 x 4 = 126144000000 plus the – (minus) sign.

$ vboxmanage modifyvm xp_eng_sp3.vdi --biossystemtimeoffset -126144000000

 

virtualbox guest windows xp time back to the past

Increase your Virtualbox VDI size

With the latest version of Virtualbox, at this time 4.2.0, it is possible to easily modify the VDI file size with just one command.

For instance, I had to increment up to 30Gb my virtual machine with which I test Mint Mate edition:

vboxmanage modifyhd --resize 30000 linux_mint_13_x64_mate.vdi

Then you have to use a partition editor, such as Gparted or PartedMagic, to expand or move your partitions.

WordPress Themes