KEMBAR78
2 Pages From UserManual | PDF | Virtual Machine | Operating System
0% found this document useful (0 votes)
94 views3 pages

2 Pages From UserManual

VirtualBox's Guest Additions allow managing guest properties and starting applications from the host. Memory ballooning and page fusion are techniques supported by the Guest Additions to optimize memory usage across VMs. Memory ballooning reduces memory used by a running VM, while page fusion avoids duplicating identical memory pages between similar VMs.

Uploaded by

antidemos
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views3 pages

2 Pages From UserManual

VirtualBox's Guest Additions allow managing guest properties and starting applications from the host. Memory ballooning and page fusion are techniques supported by the Guest Additions to optimize memory usage across VMs. Memory ballooning reduces memory used by a running VM, while page fusion avoids duplicating identical memory pages between similar VMs.

Uploaded by

antidemos
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

4 Guest Additions To add or change guest properties from the guest, use the tool VBoxControl.

This tool is included in the Guest Additions of VirtualBox 2.2 or later. When started from a Linux guest, this tool requires root privileges for security reasons:
$ sudo VBoxControl guestproperty enumerate VirtualBox Guest Additions Command Line Management Interface Version 4.2.18 (C) 2009-2013 Oracle Corporation All rights reserved. Name: /VirtualBox/GuestInfo/OS/Release, value: 2.6.28-18-generic, timestamp: 1265813265835667000, flags: <NULL> Name: /VirtualBox/GuestInfo/OS/Version, value: #59-Ubuntu SMP Thu Jan 28 01:23:03 UTC 2010, timestamp: 1265813265836305000, flags: <NULL> ...

For more complex needs, you can use the VirtualBox programming interfaces; see chapter 11, VirtualBox programming interfaces, page 196.

4.7 Guest control


Starting with version 3.2, the Guest Additions of VirtualBox allow starting applications inside a VM from the host system. For this to work, the application needs to be installed inside the guest; no additional software needs to be installed on the host. Additionally, text mode output (to stdout and stderr) can be shown on the host for further processing along with options to specify user credentials and a timeout value (in milliseconds) to limit time the application is able to run. This feature can be used to automate deployment of software within the guest. Starting with version 4.0, the Guest Additions for Windows allow for automatic updating (only already installed Guest Additions 4.0 or later). Also, copying les from host to the guest as well as remotely creating guest directories is available. To use these features, use the VirtualBox command line, see chapter 8.31, VBoxManage guestcontrol, page 142.

4.8 Memory overcommitment


In server environments with many VMs; the Guest Additions can be used to share physical host memory between several VMs, reducing the total amount of memory in use by the VMs. If memory usage is the limiting factor and CPU resources are still available, this can help with packing more VMs on each host.

4.8.1 Memory ballooning


Starting with version 3.2, the Guest Additions of VirtualBox can change the amount of host memory that a VM uses while the machine is running. Because of how this is implemented, this feature is called memory ballooning. Note: VirtualBox supports memory ballooning only on 64-bit hosts, and it is not supported on Mac OS X hosts. Normally, to change the amount of memory allocated to a virtual machine, one has to shut down the virtual machine entirely and modify its settings. With memory ballooning, memory that was allocated for a virtual machine can be given to another virtual machine without having to shut the machine down.

76

4 Guest Additions When memory ballooning is requested, the VirtualBox Guest Additions (which run inside the guest) allocate physical memory from the guest operating system on the kernel level and lock this memory down in the guest. This ensures that the guest will not use that memory any longer: no guest applications can allocate it, and the guest kernel will not use it either. VirtualBox can then re-use this memory and give it to another virtual machine. The memory made available through the ballooning mechanism is only available for re-use by VirtualBox. It is not returned as free memory to the host. Requesting balloon memory from a running guest will therefore not increase the amount of free, unallocated memory on the host. Effectively, memory ballooning is therefore a memory overcommitment mechanism for multiple virtual machines while they are running. This can be useful to temporarily start another machine, or in more complicated environments, for sophisticated memory management of many virtual machines that may be running in parallel depending on how memory is used by the guests. At this time, memory ballooning is only supported through VBoxManage. Use the following command to increase or decrease the size of the memory balloon within a running virtual machine that has Guest Additions installed:
VBoxManage controlvm "VM name" guestmemoryballoon <n>

where "VM name" is the name or UUID of the virtual machine in question and <n> is the amount of memory to allocate from the guest in megabytes. See chapter 8.13, VBoxManage controlvm, page 130 for more information. You can also set a default balloon that will automatically be requested from the VM every time after it has started up with the following command:
VBoxManage modifyvm "VM name" --guestmemoryballoon <n>

By default, no balloon memory is allocated. This is a VM setting, like other modifyvm settings, and therefore can only be set while the machine is shut down; see chapter 8.8, VBoxManage modifyvm, page 122.

4.8.2 Page Fusion


Whereas memory ballooning simply reduces the amount of RAM that is available to a VM, Page Fusion works differently: it avoids memory duplication between several similar running VMs. In a server environment running several similar VMs (e.g. with identical operating systems) on the same host, lots of memory pages are identical. VirtualBoxs Page Fusion technology, introduced with VirtualBox 3.2, is a novel technique to efciently identify these identical memory pages and share them between multiple VMs. Note: VirtualBox supports Page Fusion only on 64-bit hosts, and it is not supported on Mac OS X hosts. Page Fusion currently works only with Windows guests (2000 and later). The more similar the VMs on a given host are, the more efciently Page Fusion can reduce the amount of host memory that is in use. It therefore works best if all VMs on a host run identical operating systems (e.g. Windows XP Service Pack 2). Instead of having a complete copy of each operating system in each VM, Page Fusion identies the identical memory pages in use by these operating systems and eliminates the duplicates, sharing host memory between several machines (deduplication). If a VM tries to modify a page that has been shared with other VMs, a new page is allocated again for that VM with a copy of the shared page (copy on write). All this is fully transparent to the virtual machine. You may be familiar with this kind of memory overcommitment from other hypervisor products, which call this feature page sharing or same page merging. However, Page Fusion differs signicantly from those other solutions, whose approaches have several drawbacks:

77

4 Guest Additions 1. Traditional hypervisors scan all guest memory and compute checksums (hashes) for every single memory page. Then, they look for pages with identical hashes and compare the entire content of those pages; if two pages produce the same hash, it is very likely that the pages are identical in content. This, of course, can take rather long, especially if the system is not idling. As a result, the additional memory only becomes available after a signicant amount of time (this can be hours or even days!). Even worse, this kind of page sharing algorithm generally consumes signicant CPU resources and increases the virtualization overhead by 10-20%. Page Fusion in VirtualBox uses logic in the VirtualBox Guest Additions to quickly identify memory cells that are most likely identical across VMs. It can therefore achieve most of the possible savings of page sharing almost immediately and with almost no overhead. 2. Page Fusion is also much less likely to be confused by identical memory that it will eliminate just to learn seconds later that the memory will now change and having to perform a highly expensive and often service-disrupting reallocation. At this time, Page Fusion can only be controlled with VBoxManage, and only while a VM is shut down. To enable Page Fusion for a VM, use the following command:
VBoxManage modifyvm "VM name" --pagefusion on

You can observe Page Fusion operation using some metrics. RAM/VMM/Shared shows the total amount of fused pages, whereas the per-VM metric Guest/RAM/Usage/Shared will return the amount of fused memory for a given VM. Please refer to chapter 8.33, VBoxManage metrics, page 147 for information on how to query metrics.

78

You might also like