Rechercher dans ce blog

lundi 17 novembre 2014

Tuning the Guest Additions time synchronization parameters

from the virtualbox manual

https://www.virtualbox.org/manual/ch09.html#idp60084960

To turn off the clock synchronization between host and VM

VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

9.14.3. Tuning the Guest Additions time synchronization parameters

The VirtualBox Guest Additions ensure that the guest's system time is synchronized with the host time. There are several parameters which can be tuned. The parameters can be set for a specific VM using the following command:

VBoxManage guestproperty set "VM name" "/VirtualBox/GuestAdd/VBoxService/PARAMETER" VALUE

where PARAMETER is one of the following:

--timesync-interval

Specifies the interval at which to synchronize the time with the host. The default is 10000 ms (10 seconds).

--timesync-min-adjust

The minimum absolute drift value measured in milliseconds to make adjustments for. The default is 1000 ms on OS/2 and 100 ms elsewhere.

--timesync-latency-factor

The factor to multiply the time query latency with to calculate the dynamic minimum adjust time. The default is 8 times, that means in detail: Measure the time it takes to determine the host time (the guest has to contact the VM host service which may take some time), multiply this value by 8 and do an adjustment only if the time difference between host and guest is bigger than this value. Don't do any time adjustment otherwise.

--timesync-max-latency

The max host timer query latency to accept. The default is 250 ms.

--timesync-set-threshold

The absolute drift threshold, given as milliseconds where to start setting the time instead of trying to smoothly adjust it. The default is 20 minutes.

--timesync-set-start

Set the time when starting the time sync service.

--timesync-set-on-restore 0|1

Set the time after the VM was restored from a saved state when passing 1 as parameter (default). Disable by passing 0. In the latter case, the time will be adjusted smoothly which can take a long time.

All these parameters can be specified as command line parameters to VBoxService as well.

9.14.4. Disabling the Guest Additions time synchronization

Once installed and started, the VirtualBox Guest Additions will try to synchronize the guest time with the host time. This can be prevented by forbidding the guest service from reading the host clock:

VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

samedi 15 novembre 2014

VirutalBox resize virtual hard disk

From https://forums.virtualbox.org/viewtopic.php?f=35&t=50661

Thanks to perryg the autor of the post


First resizing does not work if the guest has snapshots (prior to version 4.3.*) nor will it work on Fixed drives.
Secondly when doing anything that could prove as destructive as this should you make a mistake, backup the *.vdi file before you start.

Increasing the drive does not increase the primary partition so this is a two step process.

Step 1: Increase the size of the drive.

Use the following command to increase the size of the drive:
CODE: SELECT ALL   EXPAND VIEW
VBoxManage modifyhd <absolute path to file> --resize <size in MB>

Example: I have a 10GB drive that I want to be 20GB the command would be.
CODE: SELECT ALL   EXPAND VIEW
VBoxManage modifyhd <absolute path including the name and extension> --resize 20480

Step 2: Extend the primary partition to include the new drive space.
Download the Gparted live cd or what ever partition manager program you wish and mount it to the guests virtual CD and boot the guest.
From here you can expand the primary partition to use the new space.
Windows Vista and newer guests can use the Disk Management to expand the primary partition.

You can download the Gparted Live CD from HERE.
If you have issues where Gparted fails, try with Parted Magic HERE
Additional note about parted magic. It is no longer free to download (at least from the source).

Note 1: The only step that VirtualBox is concerned with is step 1. After that you need to seek additional information on the partition manager you wish to use from the vendor of the partition manager.

Note 2: You can not shrink a guest drive with VirtualBox due to the inherent danger of loosing data or making the guest non-bootable.

Note 3: In 4.3.0 the devs fixed a bug which had previously made it impossible to resize a snapshot. Since then it is possible, but not recommended for non-experts.

What if I used Fixed Disks or Snapshots, or VMDK?

As the advice above states, resizing of fixed VDIs or VHDs is not directly supported, nor is resizing of formats other than VHD/VDI, nor can you easily resize disks which are part of a snapshot chain.

However, all of these problems are easily addressed if you clone the disk to a supported format first, using :-
(fields in brackets are placeholders which should be replaced with actual filenames, the brackets are not literal)

CODE: SELECT ALL   EXPAND VIEW
VBoxManage clonehd <infilename or UUID> <outfilename> --format VDI --variant Standard


You can then resize the resulting dynamic VDI using "VBoxManage modifyhd" as described in the previous message.

If a snapshot chain is involved then <infilename> should be the name of the latest snapshot VDI in the "Snapshots" subfolder. Do not make the rookie mistake of cloning the base VDI. In this case "clonehd" will create a merged clone and it's important that you not incorporate this back into a VM which is still expecting a chain of difference disk images. Either build a new VM around the clone, or delete all the snapshot markers from the original VM, then replace the disk file. If the VM did not use difference images (no immutable drive, linked clone or snapshot) then you can use the Storage settings panel to remove the old disk and replace with the new one.