VirtualBox

source: vbox/trunk/doc/manual/en_US/user_GuestAdditions.xml@ 35065

最後變更 在這個檔案從35065是 35065,由 vboxsync 提交於 14 年 前

Manual: doc updates (vbox settings, chipset)

檔案大小: 74.6 KB
 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
4<chapter>
5 <title id="guestadditions">Guest Additions</title>
6
7 <para>The previous chapter covered getting started with VirtualBox and
8 installing operating systems in a virtual machine. For any serious and
9 interactive use, the VirtualBox Guest Additions will make your life much
10 easier by providing closer integration between host and guest and improving
11 the interactive performance of guest systems. This chapter describes the
12 Guest Additions in detail.</para>
13
14 <sect1>
15 <title>Introduction</title>
16
17 <para>As mentioned in <xref linkend="virtintro" />, the Guest Additions
18 are designed to be installed <emphasis>inside</emphasis> a virtual machine
19 after the guest operating system has been installed. They consist of
20 device drivers and system applications that optimize the guest operating
21 system for better performance and usability. Please see <xref
22 linkend="guestossupport" /> for details on what guest operating systems
23 are fully supported with Guest Additions by VirtualBox.</para>
24
25 <para>The VirtualBox Guest Additions for all supported guest operating
26 systems are provided as a single CD-ROM image file which is called
27 <computeroutput>VBoxGuestAdditions.iso</computeroutput>. This image file
28 is located in the installation directory of VirtualBox. To install the
29 Guest Additions for a particular VM, you mount this ISO file in your VM as
30 a virtual CD-ROM and install from there.</para>
31
32 <para>The Guest Additions offer the following features:<glosslist>
33 <glossentry>
34 <glossterm>Mouse pointer integration</glossterm>
35
36 <glossdef>
37 <para>To overcome the limitations for mouse support that were
38 described in <xref linkend="keyb_mouse_normal" />, this provides
39 you with seamless mouse support. You will only have one mouse
40 pointer and pressing the Host key is no longer required to "free"
41 the mouse from being captured by the guest OS. To make this work,
42 a special mouse driver is installed in the guest that communicates
43 with the "real" mouse driver on your host and moves the guest
44 mouse pointer accordingly.</para>
45 </glossdef>
46 </glossentry>
47
48 <glossentry>
49 <glossterm>Shared folders</glossterm>
50
51 <glossdef>
52 <para>These provide an easy way to exchange files between the host
53 and the guest. Much like ordinary Windows network shares, you can
54 tell VirtualBox to treat a certain host directory as a shared
55 folder, and VirtualBox will make it available to the guest
56 operating system as a network share, irrespective of whether guest
57 actually has a network. For details, please refer to <xref
58 linkend="sharedfolders" />.</para>
59 </glossdef>
60 </glossentry>
61
62 <glossentry>
63 <glossterm>Better video support</glossterm>
64
65 <glossdef>
66 <para>While the virtual graphics card which VirtualBox emulates
67 for any guest operating system provides all the basic features,
68 the custom video drivers that are installed with the Guest
69 Additions provide you with extra high and non-standard video modes
70 as well as accelerated video performance.</para>
71
72 <para>In addition, with Windows, Linux and Solaris guests, you can
73 resize the virtual machine's window if the Guest Additions are
74 installed. The video resolution in the guest will be automatically
75 adjusted (as if you had manually entered an arbitrary resolution
76 in the guest's display settings). Please see <xref
77 linkend="intro-resize-window" /> also.</para>
78
79 <para>Finally, if the Guest Additions are installed, 3D graphics
80 and 2D video for guest applications can be accelerated; see <xref
81 linkend="guestadd-video" />.</para>
82 </glossdef>
83 </glossentry>
84
85 <glossentry>
86 <glossterm>Seamless windows</glossterm>
87
88 <glossdef>
89 <para>With this feature, the individual windows that are displayed
90 on the desktop of the virtual machine can be mapped on the host's
91 desktop, as if the underlying application was actually running on
92 the host. See <xref linkend="seamlesswindows" /> for
93 details.</para>
94 </glossdef>
95 </glossentry>
96
97 <glossentry>
98 <glossterm>Generic host/guest communication channels</glossterm>
99
100 <glossdef>
101 <para>The Guest Additions enable you to control and monitor guest
102 execution in ways other than those mentioned above. The so-called
103 "guest properties" provide a generic string-based mechanism to
104 exchange data bits between a guest and a host, some of which have
105 special meanings for controlling and monitoring the guest; see
106 <xref linkend="guestadd-guestprops" /> for details.</para>
107
108 <para>Additionally, applications can be started in a guest from
109 the host; see <xref linkend="guestadd-guestcontrol" />.</para>
110 </glossdef>
111 </glossentry>
112
113 <glossentry>
114 <glossterm>Time synchronization</glossterm>
115
116 <glossdef>
117 <para>With the Guest Additions installed, VirtualBox can ensure
118 that the guest's system time is better synchronized with that of
119 the host.</para>
120
121 <para>For various reasons, the time in the guest might run at a
122 slightly different rate than the time on the host. The host could
123 be receiving updates via NTP and its own time might not run
124 linearly. A VM could also be paused, which stops the flow of time
125 in the guest for a shorter or longer period of time. When the wall
126 clock time between the guest and host only differs slightly, the
127 time synchronization service attempts to gradually and smoothly
128 adjust the guest time in small increments to either "catch up" or
129 "lose" time. When the difference is too great (e.g., a VM paused
130 for hours or restored from saved state), the guest time is changed
131 immediately, without a gradual adjustment.</para>
132
133 <para>The Guest Additions will re-synchronize the time regularly.
134 See <xref linkend="changetimesync" /> for how to configure the
135 parameters of the time synchronization mechanism.</para>
136 </glossdef>
137 </glossentry>
138
139 <glossentry>
140 <glossterm>Shared clipboard</glossterm>
141
142 <glossdef>
143 <para>With the Guest Additions installed, the clipboard of the
144 guest operating system can optionally be shared with your host
145 operating system; see <xref linkend="generalsettings" />.</para>
146 </glossdef>
147 </glossentry>
148
149 <glossentry>
150 <glossterm>Automated logons (credentials passing)</glossterm>
151
152 <glossdef>
153 <para>For details, please see <xref linkend="autologon" />.</para>
154 </glossdef>
155 </glossentry>
156 </glosslist></para>
157
158 <para>Each version of VirtualBox, even minor releases, ship with their own
159 version of the Guest Additions. While the interfaces through which the
160 VirtualBox core communicates with the Guest Additions are kept stable so
161 that Guest Additions already installed in a VM should continue to work
162 when VirtualBox is upgraded on the host, for best results, it is
163 recommended to keep the Guest Additions at the same version.</para>
164
165 <para>Starting with VirtualBox 3.1, the Windows and Linux Guest Additions
166 therefore check automatically whether they have to be updated. If the host
167 is running a newer VirtualBox version than the Guest Additions, a
168 notification with further instructions is displayed in the guest.</para>
169
170 <para>To disable this update check for the Guest Additions of a given
171 virtual machine, set the value of its
172 <computeroutput>/VirtualBox/GuestAdd/CheckHostVersion</computeroutput>
173 guest property to <computeroutput>0</computeroutput>; see <xref
174 linkend="guestadd-guestprops" /> for details.</para>
175 </sect1>
176
177 <sect1>
178 <title>Installing and Maintaining Guest Additions</title>
179
180 <para>Guest Additions are available for virtual machines running Windows,
181 Linux, Solaris or OS/2. The following sections describe the specifics of
182 each variant in detail.</para>
183
184 <sect2 id="additions-windows">
185 <title>Guest Additions for Windows</title>
186
187 <para>The VirtualBox Windows Guest Additions are designed to be
188 installed in a virtual machine running a Windows operating system. The
189 following versions of Windows guests are supported:</para>
190
191 <itemizedlist>
192 <listitem>
193 <para>Microsoft Windows NT 4.0 (any service pack)</para>
194 </listitem>
195
196 <listitem>
197 <para>Microsoft Windows 2000 (any service pack)</para>
198 </listitem>
199
200 <listitem>
201 <para>Microsoft Windows XP (any service pack)</para>
202 </listitem>
203
204 <listitem>
205 <para>Microsoft Windows Server 2003 (any service pack)</para>
206 </listitem>
207
208 <listitem>
209 <para>Microsoft Windows Server 2008</para>
210 </listitem>
211
212 <listitem>
213 <para>Microsoft Windows Vista (all editions)</para>
214 </listitem>
215
216 <listitem>
217 <para>Microsoft Windows 7 (all editions)</para>
218 </listitem>
219 </itemizedlist>
220
221 <sect3 id="mountingadditionsiso">
222 <title>Installation</title>
223
224 <para>In the "Devices" menu in the virtual machine's menu bar,
225 VirtualBox has a handy menu item named "Install Guest Additions",
226 which either allows to upgrade already installed Guest Additions (only
227 Windows Guest Additions 4.0 and later) automatically or mounts the
228 Guest Additions ISO file inside your virtual machine to perform a
229 manual update.</para>
230
231 <para>In case of a manual update, a Windows guest should then
232 automatically start the Guest Additions installer, which allows to
233 install the Guest Additions into your Windows guest.</para>
234
235 <note>
236 <para>For Direct 3D acceleration to work in a Windows Guest, you
237 must install the Guest Additions in "Safe Mode"; see <xref
238 linkend="KnownIssues" /> for details.</para>
239 </note>
240
241 <para>If you prefer to mount the additions manually, you can perform
242 the following steps:</para>
243
244 <orderedlist>
245 <listitem>
246 <para>Start the virtual machine in which you have installed
247 Windows.</para>
248 </listitem>
249
250 <listitem>
251 <para>Select "Mount CD/DVD-ROM" from the "Devices" menu in the
252 virtual machine's menu bar and then "CD/DVD-ROM image". This
253 brings up the Virtual Media Manager described in <xref
254 linkend="vdis" />.</para>
255 </listitem>
256
257 <listitem>
258 <para>In the Virtual Media Manager, press the "Add" button and
259 browse your host file system for the
260 <computeroutput>VBoxGuestAdditions.iso</computeroutput>
261 file:<itemizedlist>
262 <listitem>
263 <para>On a Windows host, you can find this file in the
264 VirtualBox installation directory (usually under
265 <computeroutput>C:\Program
266 files\Oracle\VirtualBox</computeroutput> ).</para>
267 </listitem>
268
269 <listitem>
270 <para>On Mac OS X hosts, you can find this file in the
271 application bundle of VirtualBox. (Right click on the
272 VirtualBox icon in Finder and choose <emphasis>Show Package
273 Contents</emphasis>. There it is located in the
274 <computeroutput>Contents/MacOS</computeroutput>
275 folder.)</para>
276 </listitem>
277
278 <listitem>
279 <para>On a Linux host, you can find this file in the
280 <computeroutput>additions</computeroutput> folder under
281 where you installed VirtualBox (normally
282 <computeroutput>/opt/VirtualBox/</computeroutput>).</para>
283 </listitem>
284
285 <listitem>
286 <para>On Solaris hosts, you can find this file in the
287 <computeroutput>additions</computeroutput> folder under
288 where you installed VirtualBox (normally
289 <computeroutput>/opt/VirtualBox</computeroutput>).</para>
290 </listitem>
291 </itemizedlist></para>
292 </listitem>
293
294 <listitem>
295 <para>Back in the Virtual Media Manager, select that ISO file and
296 press the "Select" button. This will mount the ISO file and
297 present it to your Windows guest as a CD-ROM.</para>
298 </listitem>
299 </orderedlist>
300
301 <para>Unless you have the Autostart feature disabled in your Windows
302 guest, Windows will now autostart the VirtualBox Guest Additions
303 installation program from the Additions ISO. If the Autostart feature
304 has been turned off, choose
305 <computeroutput>VBoxWindowsAdditions.exe</computeroutput> from the
306 CD/DVD drive inside the guest to start the installer.</para>
307
308 <para>The installer will add several device drivers to the Windows
309 driver database and then invoke the hardware detection wizard.</para>
310
311 <para>Depending on your configuration, it might display warnings that
312 the drivers are not digitally signed. You must confirm these in order
313 to continue the installation and properly install the
314 Additions.</para>
315
316 <para>After installation, reboot your guest operating system to
317 activate the Additions.</para>
318 </sect3>
319
320 <sect3>
321 <title>Updating the Windows Guest Additions</title>
322
323 <para>Windows Guest Additions can be updated by running the
324 installation program again, as previously described. This will then
325 replace the previous Additions drivers with updated versions.</para>
326
327 <para>Alternatively, you may also open the Windows Device Manager and
328 select "Update driver..." for two devices:</para>
329
330 <orderedlist>
331 <listitem>
332 <para>the VirtualBox Graphics Adapter and</para>
333 </listitem>
334
335 <listitem>
336 <para>the VirtualBox System Device.</para>
337 </listitem>
338 </orderedlist>
339
340 <para>For each, choose to provide your own driver and use "Have Disk"
341 to point the wizard to the CD-ROM drive with the Guest
342 Additions.</para>
343 </sect3>
344
345 <sect3>
346 <title>Unattended Installation</title>
347
348 <para>In order to allow for completely unattended guest installations,
349 you can specify a command line parameter to the install
350 launcher:</para>
351
352 <screen>VBoxWindowsAdditions.exe /S</screen>
353
354 <para>This automatically installs the right files and drivers for the
355 corresponding platform (32- or 64-bit).</para>
356
357 <note>
358 <para>Because of the drivers are not yet WHQL certified, you still
359 might get some driver installation popups, depending on the Windows
360 guest version.</para>
361 </note>
362
363 <para>For more options regarding unattended guest installations,
364 consult the command line help by using the command:</para>
365
366 <screen>VBoxWindowsAdditions.exe /?</screen>
367 </sect3>
368
369 <sect3 id="windows-guest-file-extraction">
370 <title>Manual file extraction</title>
371
372 <para>If you would like to install the files and drivers manually, you
373 can extract the files from the Windows Guest Additions setup by
374 typing:</para>
375
376 <screen>VBoxWindowsAdditions.exe /extract</screen>
377
378 <para>To explicitly extract the Windows Guest Additions for another
379 platform than the current running one (e.g. 64-bit files on a 32-bit
380 system), you have to execute the appropriate platform installer
381 (<computeroutput>VBoxWindowsAdditions-x86.exe</computeroutput> or
382 <computeroutput>VBoxWindowsAdditions-amd64.exe</computeroutput>) with
383 the <computeroutput>/extract</computeroutput> parameter.</para>
384 </sect3>
385
386 <sect3 id="vista_networking">
387 <title>Windows Vista networking</title>
388
389 <para>If, for some reason, you want to use an AMD PCNet card with
390 Microsoft Windows Vista or later instead of the Intel E1000 card that
391 VirtualBox provides by default, you will need to install a driver for
392 that manually (see <xref linkend="nichardware" />).</para>
393
394 <para>As a convenience, VirtualBox ships with a 32-bit driver for the
395 AMD PCNet card, which comes with the Windows Guest Additions. If you
396 install these in a 32-bit Vista guest, the driver will automatically
397 be installed as well. If, for some reason, you would like to install
398 the driver manually, you can extract the required files from the
399 Windows Guest Additions setup. Please consult <xref
400 linkend="windows-guest-file-extraction" /> on how to achieve this. You
401 will then find the AMD PCNet driver files in the
402 <computeroutput>x86\Network\AMD\netamd.inf</computeroutput>
403 subdirectory of the default install directory.</para>
404
405 <para>Unfortunately, there is no 64-bit driver available for the AMD
406 PCNet card.</para>
407 </sect3>
408 </sect2>
409
410 <sect2>
411 <title>Guest Additions for Linux</title>
412
413 <para>Like the Windows Guest Additions, the VirtualBox Guest Additions
414 for Linux take the form of a set of device drivers and system
415 applications which may be installed in the guest operating
416 system.</para>
417
418 <para>The following Linux distributions are officially supported:</para>
419
420 <itemizedlist>
421 <listitem>
422 <para>Fedora as of Fedora Core 4;</para>
423 </listitem>
424
425 <listitem>
426 <para>Redhat Enterprise Linux as of version 3;</para>
427 </listitem>
428
429 <listitem>
430 <para>SUSE and openSUSE Linux as of version 9;</para>
431 </listitem>
432
433 <listitem>
434 <para>Ubuntu as of version 5.10.</para>
435 </listitem>
436 </itemizedlist>
437
438 <para>Many other distributions are known to work with the Guest
439 Additions.</para>
440
441 <para>The version of the Linux kernel supplied by default in SUSE and
442 openSUSE 10.2, Ubuntu 6.10 (all versions) and Ubuntu 6.06 (server
443 edition) contains a bug which can cause it to crash during startup when
444 it is run in a virtual machine. The Guest Additions work in those
445 distributions.</para>
446
447 <para>Note that some Linux distributions already come with VirtualBox
448 Guest Additions or a part thereof. You may keep the distribution's
449 version of the Guest Additions but often, these are not up to date and
450 limited in functionality. Therefore, you can choose the install the
451 Guest Additions that come with VirtualBox, overriding the already
452 installed version. The VirtualBox Linux Guest Additions installer tries
453 to detect existing installation and replace them but depending on how
454 the distribution integrates the Guest Additions, they may require some
455 manual interaction. It is highly recommended to take a snapshot of the
456 virtual machine before overriding the installation.</para>
457
458 <sect3>
459 <title>Installing the Linux Guest Additions</title>
460
461 <para>The VirtualBox Guest Additions for Linux are provided on the
462 same ISO CD-ROM as the Additions for Windows described above. They
463 also come with an installation program guiding you through the setup
464 process, although, due to the significant differences between Linux
465 distributions, installation may be slightly more complex.</para>
466
467 <para>Installation generally involves the following steps:</para>
468
469 <orderedlist>
470 <listitem>
471 <para>Before installing the Guest Additions, you will have to
472 prepare your guest system for building external kernel modules.
473 This works similarly as described in <xref
474 linkend="externalkernelmodules" />, except that this step must now
475 be performed in your Linux <emphasis>guest</emphasis> instead of
476 on a Linux host system, as described there.</para>
477
478 <para>Again, as with Linux hosts, we recommend using DKMS for
479 Linux guests as well. If it is not installed, use this command for
480 Ubuntu/Debian systems:<screen>sudo apt-get install dkms</screen>
481 or for Fedora systems: <screen>yum install dkms</screen></para>
482
483 <para>Make sure to nstall DKMS <emphasis>before</emphasis>
484 installing the Linux Guest Additions.</para>
485 </listitem>
486
487 <listitem>
488 <para>Mount the
489 <computeroutput>VBoxGuestAdditions.iso</computeroutput> file as
490 your Linux guest's virtual CD-ROM drive, exactly the same way as
491 described for a Windows guest in <xref
492 linkend="mountingadditionsiso" />.</para>
493 </listitem>
494
495 <listitem>
496 <para>Change to the directory where your CD-ROM drive is mounted
497 and execute as root:</para>
498
499 <screen>sh ./VBoxLinuxAdditions-x86.run</screen>
500
501 <para>In a 64-bit Linux guest, use
502 <computeroutput>VBoxLinuxAdditions-amd64.run</computeroutput>
503 instead.</para>
504 </listitem>
505 </orderedlist>
506
507 <para>For your convenience, the following step-by-step instructions
508 have been verified to work for freshly installed copies of the most
509 popular Linux distributions. After these preparational steps, you can
510 execute the VirtualBox Guest Additions installer as described
511 above.</para>
512
513 <sect4>
514 <title>Ubuntu 10.04 ("Lucid Lynx")</title>
515
516 <para><orderedlist>
517 <listitem>
518 <para>In order to update your system to the latest version of
519 the packets, open a terminal and as root, execute <screen>apt-get update</screen>
520 followed by <screen>apt-get upgrade</screen></para>
521 </listitem>
522
523 <listitem>
524 <para>Install DKMS using <screen>apt-get install dkms</screen></para>
525 </listitem>
526
527 <listitem>
528 <para>Reboot your guest system in order to activate the
529 updates and then proceed as described above.</para>
530 </listitem>
531 </orderedlist></para>
532 </sect4>
533
534 <sect4>
535 <title>Fedora 13 ("Goddard")</title>
536
537 <para><orderedlist>
538 <listitem>
539 <para>In order to update your system to the latest version of
540 the packets, open a terminal and as root, execute <screen>yum update</screen></para>
541 </listitem>
542
543 <listitem>
544 <para>Install DKMS and the GNU C compiler using <screen>yum install dkms</screen>
545 followed by <screen>yum install gcc</screen></para>
546 </listitem>
547
548 <listitem>
549 <para>Reboot your guest system in order to activate the
550 updates and then proceed as described above.</para>
551 </listitem>
552 </orderedlist></para>
553 </sect4>
554
555 <sect4>
556 <title>openSUSE 11.2</title>
557
558 <para><orderedlist>
559 <listitem>
560 <para>In order to update your system to the latest version of
561 the packets, open a terminal and as root, execute <screen>zypper update</screen></para>
562 </listitem>
563
564 <listitem>
565 <para>Install the make tool and the GNU C compiler using
566 <screen>zypper install make gcc</screen></para>
567 </listitem>
568
569 <listitem>
570 <para>Reboot your guest system in order to activate the
571 updates.</para>
572 </listitem>
573
574 <listitem>
575 <para>Find out which kernel you are running using <screen>uname -a</screen>
576 An example would be
577 <computeroutput>2.6.31.12-0.2-default</computeroutput> which
578 refers to the "default" kernel. Then install the correct
579 kernel development package. In the above example this would be
580 <screen>zypper install kernel-default-devel</screen></para>
581 </listitem>
582
583 <listitem>
584 <para>Make sure that your running kernel
585 (<computeroutput>uname -a</computeroutput>) and the kernel
586 packages you have installed (<computeroutput>rpm -qa
587 kernel\*</computeroutput>) have the exact same version number.
588 Proceed with the installation as described above.</para>
589 </listitem>
590 </orderedlist></para>
591 </sect4>
592
593 <sect4>
594 <title>SuSE Linux Enterprise Desktop (SLED) 11</title>
595
596 <para><orderedlist>
597 <listitem>
598 <para>In order to update your system to the latest version of
599 the packets, open a terminal and as root, execute <screen>zypper update</screen></para>
600 </listitem>
601
602 <listitem>
603 <para>Install the GNU C compiler using <screen>zypper install gcc</screen></para>
604 </listitem>
605
606 <listitem>
607 <para>Reboot your guest system in order to activate the
608 updates.</para>
609 </listitem>
610
611 <listitem>
612 <para>Find out which kernel you are running using <screen>uname -a</screen>
613 An example would be
614 <computeroutput>2.6.27.19-5.1-default</computeroutput> which
615 refers to the "default" kernel. Then install the correct
616 kernel development package. In the above example this would be
617 <screen>zypper install kernel-syms kernel-source</screen></para>
618 </listitem>
619
620 <listitem>
621 <para>Make sure that your running kernel
622 (<computeroutput>uname -a</computeroutput>) and the kernel
623 packages you have installed (<computeroutput>rpm -qa
624 kernel\*</computeroutput>) have the exact same version number.
625 Proceed with the installation as described above.</para>
626 </listitem>
627 </orderedlist></para>
628 </sect4>
629
630 <sect4>
631 <title>Mandrake 2010</title>
632
633 <para><orderedlist>
634 <listitem>
635 <para>Mandrake ships with the VirtualBox Guest Additions which
636 will be replaced if you follow these steps.</para>
637 </listitem>
638
639 <listitem>
640 <para>In order to update your system to the latest version of
641 the packets, open a terminal and as root and execute <screen>urpmi --auto-update</screen></para>
642 </listitem>
643
644 <listitem>
645 <para>Reboot your system in order to activate the
646 updates.</para>
647 </listitem>
648
649 <listitem>
650 <para>Install DKMS using <screen>urpmi dkms</screen> and make
651 sure to choose the correct kernel-devel package when asked by
652 the installer (use <computeroutput>uname -a</computeroutput>
653 to compare).</para>
654 </listitem>
655 </orderedlist></para>
656 </sect4>
657
658 <sect4>
659 <title>CentOS 5.5, Red Hat Enterprise Linux 5.5 and Oracle
660 Enterprise Linux 5.5</title>
661
662 <para><orderedlist>
663 <listitem>
664 <para>Add <computeroutput>divider=10</computeroutput> to the
665 kernel boot options in
666 <computeroutput>/etc/grub.conf</computeroutput> to reduce the
667 idle CPU load.</para>
668 </listitem>
669
670 <listitem>
671 <para>To update your system to the latest version of the
672 packets, open a terminal and as root, execute <screen>yum update</screen></para>
673 </listitem>
674
675 <listitem>
676 <para>Install the GNU C compiler and the kernel development
677 packages using <screen>yum install gcc</screen> followed by
678 <screen>yum install kernel-devel</screen></para>
679 </listitem>
680
681 <listitem>
682 <para>Reboot your guest system in order to activate the
683 updates and then proceed as described above.</para>
684 </listitem>
685
686 <listitem>
687 <para>Note that OpenGL support is not available unless you
688 update to a later Linux kernel.</para>
689
690 <para>In case Oracle Enterprise Linux does not find the
691 required packages, you either have to install them from a
692 different source (e.g. DVD) or use Oracle's public Yum server
693 located at <ulink
694 url="http://public-yum.oracle.com/">http://public-yum.oracle.com</ulink>.</para>
695 </listitem>
696 </orderedlist></para>
697 </sect4>
698
699 <sect4>
700 <title>Debian 5 ("Lenny")</title>
701
702 <para><orderedlist>
703 <listitem>
704 <para>In order to update your system to the latest version of
705 the packets, open a terminal and as root, execute <screen>apt-get update</screen>
706 followed by <screen>apt-get upgrade</screen></para>
707 </listitem>
708
709 <listitem>
710 <para>Install the make tool and the GNU C compiler using
711 <screen>apt-get install make gcc</screen></para>
712 </listitem>
713
714 <listitem>
715 <para>Reboot your guest system in order to activate the
716 updates.</para>
717 </listitem>
718
719 <listitem>
720 <para>Determine the exact version of your kernel using
721 <computeroutput>uname -a</computeroutput> and install the
722 correct version of the linux-headers package, e.g. using
723 <screen>apt-get install linux-headers-2.6.26-2-686</screen></para>
724
725 <para>Note that OpenGL support is not available unless you
726 update to a later Linux kernel.</para>
727 </listitem>
728 </orderedlist></para>
729 </sect4>
730 </sect3>
731
732 <sect3>
733 <title>Manual setup of selected guest services</title>
734
735 <para>The VirtualBox Guest Additions contain several different
736 drivers. If for any reason you do not wish to set them all up, you can
737 install the Guest Additions using the following command:</para>
738
739 <screen> sh ./VBoxLinuxAdditions-x86.run no_setup</screen>
740
741 <para>(substituting <computeroutput>VBoxLinuxAdditions-amd64
742 </computeroutput> on a 64-bit guest).</para>
743
744 <para>After this, you will need to at least compile the kernel modules
745 by running the command <screen> /usr/lib/VBoxGuestAdditions/vboxadd setup</screen>
746 as root (you will need to replace <emphasis>lib</emphasis> by
747 <emphasis>lib64</emphasis> on some 64bit guests), and on older guests
748 without the udev service you will need to add the
749 <emphasis>vboxadd</emphasis> service to the default runlevel to ensure
750 that the modules get loaded.</para>
751
752 <para>To setup the time synchronization service, run the command
753 <screen> /usr/lib/VBoxGuestAdditions/vboxadd-service setup</screen>
754 and add the service vboxadd-service to the default runlevel. To set up
755 the X11 and OpenGL part of the Guest Additions, run the command
756 <screen> /usr/lib/VBoxGuestAdditions/vboxadd-x11 setup</screen> (you
757 do not need to enable any services for this).</para>
758
759 <para>To recompile the guest kernel modules, use this command:
760 <screen> /usr/lib/VBoxGuestAdditions/vboxadd setup</screen> After
761 compilation you should reboot your guest to ensure that the new
762 modules are actually used.</para>
763 </sect3>
764
765 <sect3>
766 <title>Video acceleration and high resolution graphics modes</title>
767
768 <para>In Linux guests, VirtualBox video acceleration is available
769 through the X Window System. Typically, in today's Linux
770 distributions, this will be the X.Org server. During the installation
771 process, X will be set up to use the VirtualBox video driver shipped
772 with the Guest Additions.</para>
773
774 <para>For Linux and Solaris guests, the X.org server version 1.3 or
775 later is required for automatic resizing (the feature has been
776 disabled on Fedora 9 guests due to a bug in the X server they supply).
777 The server version can be checked with <computeroutput>Xorg
778 -version</computeroutput>.</para>
779
780 <para>You can also send video mode hints using the
781 <computeroutput>VBoxManage</computeroutput> tool.</para>
782
783 <para>If you are only using recent Linux guests systems, you can skip
784 the rest of this section. On older guest systems, whatever graphics
785 modes were set up before the installation will be used. If these modes
786 do not suit your requirements, you can change your setup by editing
787 the configuration file of the X server, usually found in
788 <computeroutput>/etc/X11/xorg.conf</computeroutput>.</para>
789
790 <para>VirtualBox can use any default X graphics mode which fits into
791 the virtual video memory allocated to the virtual machine, as
792 described in <xref linkend="generalsettings" />. You can also add your
793 own modes to the X server configuration file. You simply need to add
794 them to the "Modes" list in the "Display" subsection of the "Screen"
795 section. For example, the section shown here has a custom 2048x800
796 resolution mode added:</para>
797
798 <screen>Section "Screen"
799 Identifier "Default Screen"
800 Device "VirtualBox graphics card"
801 Monitor "Generic Monitor"
802 DefaultDepth 24
803 SubSection "Display"
804 Depth 24
805 Modes "2048x800" "800x600" "640x480"
806 EndSubSection
807EndSection</screen>
808 </sect3>
809
810 <sect3>
811 <title>Updating the Linux Guest Additions</title>
812
813 <para>The Guest Additions can simply be updated by going through the
814 installation procedure again with an updated CD-ROM image. This will
815 replace the drivers with updated versions. You should reboot after
816 updating the Guest Additions.</para>
817 </sect3>
818
819 <sect3>
820 <title>Uninstalling the Linux Guest Additions</title>
821
822 <para>If you have a version of the Guest Additions installed on your
823 virtual machine and wish to remove it without installing new ones, you
824 can do so by inserting the Guest Additions CD image into the virtual
825 CD-ROM drive as described above and running the installer for the
826 current Guest Additions with the "uninstall" parameter from the path
827 that the CD image is mounted on in the guest: <screen>sh ./VBoxLinuxAdditions-x86.run uninstall</screen></para>
828
829 <para>With a 64-bit guest, use
830 <computeroutput>VBoxLinuxAdditions-amd64</computeroutput> instead.
831 While this will normally work without issues, you may need to do some
832 manual cleanup of the guest (particularly of the XFree86Config or
833 xorg.conf file) in some cases, particularly if the Additions version
834 installed or the guest operating system were very old, or if you made
835 your own changes to the Guest Additions setup after you installed
836 them.</para>
837
838 <para>Starting with version 3.1.0, you can uninstall the Additions by
839 invoking <screen>/opt/VBoxGuestAdditions-$VBOX_VERSION_STRING/uninstall.sh</screen>Please
840 replace
841 <computeroutput>/opt/VBoxGuestAdditions-$VBOX_VERSION_STRING</computeroutput>
842 with the correct Guest Additions installation directory.</para>
843 </sect3>
844 </sect2>
845
846 <sect2>
847 <title>Guest Additions for Solaris</title>
848
849 <para>Like the Windows Guest Additions, the VirtualBox Guest Additions
850 for Solaris take the form of a set of device drivers and system
851 applications which may be installed in the guest operating
852 system.</para>
853
854 <para>The following Solaris distributions are officially
855 supported:</para>
856
857 <itemizedlist>
858 <listitem>
859 <para>Solaris 11 Express;</para>
860 </listitem>
861
862 <listitem>
863 <para>Solaris 10 (u5 and higher);</para>
864 </listitem>
865
866 <listitem>
867 <para>Solaris Nevada/SXDE/SXCE (build 82 and higher);</para>
868 </listitem>
869
870 <listitem>
871 <para>OpenSolaris (Developer Preview 2 and higher; this includes
872 OpenSolaris 2008.05, 2008.11 and 2009.06);</para>
873 </listitem>
874 </itemizedlist>
875
876 <para>Other distributions may work if they are based on comparable
877 software releases.</para>
878
879 <sect3>
880 <title>Installing the Solaris Guest Additions</title>
881
882 <para>The VirtualBox Guest Additions for Solaris are provided on the
883 same ISO CD-ROM as the Additions for Windows and Linux described
884 above. They also come with an installation program guiding you through
885 the setup process.</para>
886
887 <para>Installation involves the following steps:</para>
888
889 <orderedlist>
890 <listitem>
891 <para>Mount the
892 <computeroutput>VBoxGuestAdditions.iso</computeroutput> file as
893 your Solaris guest's virtual CD-ROM drive, exactly the same way as
894 described for a Windows guest in <xref
895 linkend="mountingadditionsiso" />.</para>
896
897 <para>If in case the CD-ROM drive on the guest doesn't get mounted
898 (observed on some versions of Solaris 10), execute as root:</para>
899
900 <screen>svcadm restart volfs</screen>
901 </listitem>
902
903 <listitem>
904 <para>Change to the directory where your CD-ROM drive is mounted
905 and execute as root:</para>
906
907 <screen>pkgadd -G -d ./VBoxSolarisAdditions.pkg</screen>
908 </listitem>
909
910 <listitem>
911 <para>Choose "1" and confirm installation of the Guest Additions
912 package. After the installation is complete, re-login to X server
913 on your guest to activate the X11 Guest Additions.</para>
914 </listitem>
915 </orderedlist>
916 </sect3>
917
918 <sect3>
919 <title>Uninstalling the Solaris Guest Additions</title>
920
921 <para>The Solaris Guest Additions can be safely removed by removing
922 the package from the guest. Open a root terminal session and
923 execute:</para>
924
925 <para><screen>pkgrm SUNWvboxguest</screen></para>
926 </sect3>
927
928 <sect3>
929 <title>Updating the Solaris Guest Additions</title>
930
931 <para>The Guest Additions should be updated by first uninstalling the
932 existing Guest Additions and then installing the new ones. Attempting
933 to install new Guest Additions without removing the existing ones is
934 not possible.</para>
935 </sect3>
936 </sect2>
937
938 <sect2>
939 <title>Guest Additions for OS/2</title>
940
941 <para>VirtualBox also ships with a set of drivers that improve running
942 OS/2 in a virtual machine. Due to restrictions of OS/2 itself, this
943 variant of the Guest Additions has a limited feature set; see <xref
944 linkend="KnownIssues" /> for details.</para>
945
946 <para>The OS/2 Guest Additions are provided on the same ISO CD-ROM as
947 those for the other platforms. As a result, mount the ISO in OS/2 as
948 described previously. The OS/2 Guest Additions are located in the
949 directory <computeroutput>\32bit\OS2</computeroutput>.</para>
950
951 <para>As we do not provide an automatic installer at this time, please
952 refer to the <computeroutput>readme.txt</computeroutput> file in that
953 directory, which describes how to install the OS/2 Guest Additions
954 manually.</para>
955 </sect2>
956 </sect1>
957
958 <sect1 id="sharedfolders">
959 <title>Shared folders</title>
960
961 <para>With the "shared folders" feature of VirtualBox, you can access
962 files of your host system from within the guest system. This is similar
963 how you would use network shares in Windows networks -- except that shared
964 folders do not need require networking, only the Guest Additions. Shared
965 Folders are supported with Windows (2000 or newer), Linux and Solaris
966 guests.</para>
967
968 <para>Shared folders must physically reside on the
969 <emphasis>host</emphasis> and are then shared with the guest, which uses a
970 special file system driver in the Guest Addition to talk to the host. For
971 Windows guests, shared folders are implemented as a pseudo-network
972 redirector; for Linux and Solaris guests, the Guest Additions provide a
973 virtual file system.</para>
974
975 <para>To share a host folder with a virtual machine in VirtualBox, you
976 must specify the path of that folder and choose for it a "share name" that
977 the guest can use to access it. Hence, first create the shared folder on
978 the host; then, within the guest, connect to it.</para>
979
980 <para>There are several ways in which shared folders can be set up for a
981 particular virtual machine:<itemizedlist>
982 <listitem>
983 <para>In the window of a running VM, you can select "Shared folders"
984 from the "Devices" menu, or click on the folder icon on the status
985 bar in the bottom right corner.</para>
986 </listitem>
987
988 <listitem>
989 <para>If a VM is not currently running, you can configure shared
990 folders in each virtual machine's "Settings" dialog.</para>
991 </listitem>
992
993 <listitem>
994 <para>From the command line, you can create shared folders using
995 VBoxManage, as follows: <screen>VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"</screen></para>
996
997 <para>See <xref linkend="vboxmanage-sharedfolder" /> for
998 details.</para>
999 </listitem>
1000 </itemizedlist></para>
1001
1002 <para>There are two types of shares:</para>
1003
1004 <orderedlist>
1005 <listitem>
1006 <para>VM shares which are only available to the VM for which they have
1007 been defined;</para>
1008 </listitem>
1009
1010 <listitem>
1011 <para>transient VM shares, which can be added and removed at runtime
1012 and do not persist after a VM has stopped; for these, add the
1013 <computeroutput>--transient</computeroutput> option to the above
1014 command line.</para>
1015 </listitem>
1016 </orderedlist>
1017
1018 <para>Shared folders have read/write access to the files at the host path
1019 by default. To restrict the guest to have read-only access, create a
1020 read-only shared folder. This can either be achieved using the GUI or by
1021 appending the parameter <computeroutput>--readonly</computeroutput> when
1022 creating the shared folder with VBoxManage.</para>
1023
1024 <para>Starting with version 4.0, VirtualBox shared folders also support
1025 symbolic links (<emphasis role="bold">symlinks</emphasis>), under the
1026 following conditions:<orderedlist>
1027 <listitem>
1028 <para>The host operating system must support symlinks (i.e. a Mac,
1029 Linux or Solaris host is required).</para>
1030 </listitem>
1031
1032 <listitem>
1033 <para>Currently only Linux Guest Additions support symlinks.</para>
1034 </listitem>
1035 </orderedlist></para>
1036
1037 <sect2 id="sf_mount_manual">
1038 <title>Manual mounting</title>
1039
1040 <para>You can mount the shared folder from inside a VM the same way as
1041 you would mount an ordinary network share:</para>
1042
1043 <para><itemizedlist>
1044 <listitem>
1045 <para>In a Windows guest, shared folders are browseable and
1046 therefore visible in Windows Explorer. So, to attach the host's
1047 shared folder to your Windows guest, open Windows Explorer and
1048 look for it under "My Networking Places" -&gt; "Entire Network"
1049 -&gt; "VirtualBox Shared Folders". By right-clicking on a shared
1050 folder and selecting "Map network drive" from the menu that pops
1051 up, you can assign a drive letter to that shared folder.</para>
1052
1053 <para>Alternatively, on the Windows command line, use the
1054 following:</para>
1055
1056 <screen>net use x: \\vboxsvr\sharename</screen>
1057
1058 <para>While <computeroutput>vboxsvr</computeroutput> is a fixed
1059 name (note that <computeroutput>vboxsrv</computeroutput> would
1060 also work), replace "x:" with the drive letter that you want to
1061 use for the share, and <computeroutput>sharename</computeroutput>
1062 with the share name specified with
1063 <computeroutput>VBoxManage</computeroutput>.</para>
1064 </listitem>
1065
1066 <listitem>
1067 <para>In a Linux guest, use the following command:</para>
1068
1069 <screen>mount -t vboxsf [-o OPTIONS] sharename mountpoint</screen>
1070
1071 <para>To mount a shared folder during boot, add the following
1072 entry to /etc/fstab:</para>
1073
1074 <screen>sharename mountpoint vboxsf defaults 0 0</screen>
1075 </listitem>
1076
1077 <listitem>
1078 <para>In a Solaris guest, use the following command:</para>
1079
1080 <screen>mount -F vboxfs [-o OPTIONS] sharename mountpoint</screen>
1081
1082 <para>Replace <computeroutput>sharename</computeroutput> (use
1083 lowercase) with the share name specified with
1084 <computeroutput>VBoxManage</computeroutput> or the GUI, and
1085 <computeroutput>mountpoint</computeroutput> with the path where
1086 you want the share to be mounted on the guest (e.g.
1087 <computeroutput>/mnt/share</computeroutput>). The usual mount
1088 rules apply, that is, create this directory first if it does not
1089 exist yet.</para>
1090
1091 <para>Here is an example of mounting the shared folder for the
1092 user "jack" on Solaris:</para>
1093
1094 <screen>$ id
1095uid=5000(jack) gid=1(other)
1096$ mkdir /export/home/jack/mount
1097$ pfexec mount -F vboxfs -o uid=5000,gid=1 jackshare /export/home/jack/mount
1098$ cd ~/mount
1099$ ls
1100sharedfile1.mp3 sharedfile2.txt
1101$</screen>
1102
1103 <para>Beyond the standard options supplied by the
1104 <computeroutput>mount</computeroutput> command, the following are
1105 available:</para>
1106
1107 <screen>iocharset CHARSET</screen>
1108
1109 <para>to set the character set used for I/O operations (utf8 by
1110 default) and</para>
1111
1112 <screen>convertcp CHARSET</screen>
1113
1114 <para>to specify the character set used for the shared folder name
1115 (utf8 by default).</para>
1116
1117 <para>The generic mount options (documented in the mount manual
1118 page) apply also. Especially useful are the options
1119 <computeroutput>uid</computeroutput>,
1120 <computeroutput>gid</computeroutput> and
1121 <computeroutput>mode</computeroutput>, as they allow access by
1122 normal users (in read/write mode, depending on the settings) even
1123 if root has mounted the filesystem.</para>
1124 </listitem>
1125 </itemizedlist></para>
1126 </sect2>
1127
1128 <sect2 id="sf_mount_auto">
1129 <title>Automatic mounting</title>
1130
1131 <para>Starting with version 4.0, VirtualBox can mount shared folders
1132 automatically, at your option. If automatic mounting is enabled for a
1133 specific shared folder, the Guest Additions will automatically mount
1134 that folder as soon as a user logs into the guest OS. The details depend
1135 on the guest OS type:<itemizedlist>
1136 <listitem>
1137 <para>With <emphasis role="bold">Windows guests,</emphasis> any
1138 auto-mounted shared folder will receive its own drive letter (e.g.
1139 <computeroutput>E:</computeroutput>) depending on the free drive
1140 letters remaining in the guest.</para>
1141
1142 <para>If there no free drive letters left, auto-mounting will
1143 fail; as a result, the number of auto-mounted shared folders is
1144 typically limited to 22 or less with Windows guests.</para>
1145 </listitem>
1146
1147 <listitem>
1148 <para>With <emphasis role="bold">Linux guests,</emphasis>
1149 auto-mounted shared folders are mounted into the
1150 <computeroutput>/media</computeroutput> directory, along with the
1151 prefix <computeroutput>sf_</computeroutput>. For example, the
1152 shared folder <computeroutput>myfiles</computeroutput> would be
1153 mounted to <computeroutput>/media/sf_myfiles</computeroutput> on
1154 Linux and <computeroutput>/mnt/sf_myfiles</computeroutput> on
1155 Solaris.</para>
1156
1157 <para>The guest property
1158 <computeroutput>/VirtualBox/GuestAdd/SharedFolders/MountPrefix</computeroutput>
1159 determines the prefix that is used. Change that guest property to
1160 a value other than "sf" to change that prefix; see <xref
1161 linkend="guestadd-guestprops" /> for details.<note>
1162 <para>Read/write access to auto-mounted shared folders is only
1163 granted to the user group
1164 <computeroutput>vboxsf</computeroutput>, which is created by
1165 the VirtualBox Guest Additions installer. You must therefore
1166 add user accounts to that group for a user to have read/write
1167 access. Other users are granted read-only access, even if the
1168 shared folder in question has been defined as
1169 read/write.</para>
1170 </note></para>
1171
1172 <para>To change the mount directory to something other than
1173 <computeroutput>/media</computeroutput>, you can set the guest
1174 property
1175 <computeroutput>/VirtualBox/GuestAdd/SharedFolders/MountDir</computeroutput>.</para>
1176 </listitem>
1177
1178 <listitem>
1179 <para><emphasis role="bold">Solaris guests</emphasis> behave like
1180 Linux guests except that <computeroutput>/mnt</computeroutput> is
1181 used as the default mount directory instead of
1182 <computeroutput>/media</computeroutput>.</para>
1183 </listitem>
1184 </itemizedlist></para>
1185
1186 <para>To have any changes to auto-mounted shared folders applied while a
1187 VM is running, the guest OS needs to be rebooted. (This applies only to
1188 auto-mounted shared folders, not the ones which are mounted
1189 manually.)</para>
1190 </sect2>
1191 </sect1>
1192
1193 <sect1 id="guestadd-video">
1194 <title>Hardware-accelerated graphics</title>
1195
1196 <sect2 id="guestadd-3d">
1197 <title>Hardware 3D acceleration (OpenGL and Direct3D 8/9)</title>
1198
1199 <para>The VirtualBox Guest Additions contain experimental hardware 3D
1200 support for Windows, Linux and Solaris guests.<footnote>
1201 <para>OpenGL support for Windows guests was added with VirtualBox
1202 2.1; support for Linux and Solaris followed with VirtualBox 2.2.
1203 With VirtualBox 3.0, Direct3D 8/9 support was added for Windows
1204 guests. OpenGL 2.0 is now supported as well.</para>
1205 </footnote></para>
1206
1207 <para>With this feature, if an application inside your virtual machine
1208 uses 3D features through the OpenGL or Direct3D 8/9 programming
1209 interfaces, instead of emulating them in software (which would be slow),
1210 VirtualBox will attempt to use your host's 3D hardware. This works for
1211 all supported host platforms (Windows, Mac, Linux, Solaris), provided
1212 that your host operating system can make use of your accelerated 3D
1213 hardware in the first place.</para>
1214
1215 <para>The 3D acceleration currently has the following
1216 preconditions:<orderedlist>
1217 <listitem>
1218 <para>It is only available for certain Windows, Linux and Solaris
1219 guests. In particular:<itemizedlist>
1220 <listitem>
1221 <para>For Windows guests, support is restricted to 32-bit
1222 versions of XP and Vista. Both OpenGL and Direct3D 8/9 are
1223 supported (experimental).</para>
1224 </listitem>
1225
1226 <listitem>
1227 <para>OpenGL on Linux requires kernel 2.6.27 and higher as
1228 well as X.org server version 1.5 and higher. Ubuntu 8.10 and
1229 Fedora 10 have been tested and confirmed as working.</para>
1230 </listitem>
1231
1232 <listitem>
1233 <para>OpenGL on Solaris guests requires X.org server version
1234 1.5 and higher.</para>
1235 </listitem>
1236 </itemizedlist></para>
1237 </listitem>
1238
1239 <listitem>
1240 <para>The Guest Additions must be installed.<note>
1241 <para>For Direct 3D acceleration to work in a Windows Guest,
1242 VirtualBox needs to replace Windows system files in the
1243 virtual machine. As a result, the Guest Additions installation
1244 program offers Direct 3D acceleration as an option that must
1245 be explicitly enabled. Also, you must install the Guest
1246 Additions in "Safe Mode"; see <xref linkend="KnownIssues" />
1247 for details.</para>
1248 </note></para>
1249 </listitem>
1250
1251 <listitem>
1252 <para>Because 3D support is still experimental at this time, it is
1253 disabled by default and must be <emphasis role="bold">manually
1254 enabled</emphasis> in the VM settings (see <xref
1255 linkend="generalsettings" />).<note>
1256 <para>Enabling 3D acceleration may expose security holes to
1257 malicious software running in the guest. The third-party code
1258 that VirtualBox uses for this purpose (Chromium) is not
1259 hardened enough to prevent every risky 3D operation on the
1260 host.</para>
1261 </note></para>
1262 </listitem>
1263 </orderedlist></para>
1264
1265 <para>Technically, VirtualBox implements this by installing an
1266 additional hardware 3D driver inside your guest when the Guest Additions
1267 are installed. This driver acts as a hardware 3D driver and reports to
1268 the guest operating system that the (virtual) hardware is capable of 3D
1269 hardware acceleration. When an application in the guest then requests
1270 hardware acceleration through the OpenGL or Direct3D programming
1271 interfaces, these are sent to the host through a special communication
1272 tunnel implemented by VirtualBox, and then the <emphasis>host</emphasis>
1273 performs the requested 3D operation via the host's programming
1274 interfaces.</para>
1275 </sect2>
1276
1277 <sect2 id="guestadd-2d">
1278 <title>Hardware 2D video acceleration for Windows guests</title>
1279
1280 <para>Starting with version 3.1, the VirtualBox Guest Additions contain
1281 experimental hardware 2D video acceleration support for Windows
1282 guests.</para>
1283
1284 <para>With this feature, if an application (e.g. a video player) inside
1285 your Windows VM uses 2D video overlays to play a movie clip, then
1286 VirtualBox will attempt to use your host's video acceleration hardware
1287 instead of performing overlay stretching and color conversion in
1288 software (which would be slow). This currently works for Windows, Linux
1289 and Mac host platforms, provided that your host operating system can
1290 make use of 2D video acceleration in the first place.</para>
1291
1292 <para>The 2D video acceleration currently has the following
1293 preconditions:<orderedlist>
1294 <listitem>
1295 <para>It is only available for Windows guests (XP or
1296 later).</para>
1297 </listitem>
1298
1299 <listitem>
1300 <para>The Guest Additions must be installed.</para>
1301 </listitem>
1302
1303 <listitem>
1304 <para>Because 2D support is still experimental at this time, it is
1305 disabled by default and must be <emphasis role="bold">manually
1306 enabled</emphasis> in the VM settings (see <xref
1307 linkend="generalsettings" />).</para>
1308 </listitem>
1309 </orderedlist></para>
1310
1311 <para>Technically, VirtualBox implements this by exposing video overlay
1312 DirectDraw capabilities in the Guest Additions video driver. The driver
1313 sends all overlay commands to the host through a special communication
1314 tunnel implemented by VirtualBox. On the host side, OpenGL is then used
1315 to implement color space transformation and scaling</para>
1316 </sect2>
1317 </sect1>
1318
1319 <sect1 id="seamlesswindows">
1320 <title>Seamless windows</title>
1321
1322 <para>With the "seamless windows" feature of VirtualBox, you can have the
1323 windows that are displayed within a virtual machine appear side by side
1324 next to the windows of your host. This feature is supported for the
1325 following guest operating systems (provided that the Guest Additions are
1326 installed):<itemizedlist>
1327 <listitem>
1328 <para>Windows guests (support added with VirtualBox 1.5);</para>
1329 </listitem>
1330
1331 <listitem>
1332 <para>Linux or Solaris guests with an X.org server version 1.3 or
1333 higher<footnote>
1334 <para>The X server version is not the same as the version of the
1335 entire X.org suite. You can type <computeroutput>X
1336 -version</computeroutput> in a terminal to find out about the
1337 X.org server version level that is currently installed.</para>
1338 </footnote> (support added with VirtualBox 1.6). The exception is
1339 Fedora 9, due to a bug in its X server.</para>
1340 </listitem>
1341 </itemizedlist></para>
1342
1343 <para>After seamless windows are enabled (see below), VirtualBox
1344 suppresses the display of the Desktop background of your guest, allowing
1345 you to run the windows of your guest operating system seamlessly next to
1346 the windows of your host:</para>
1347
1348 <para><mediaobject>
1349 <imageobject>
1350 <imagedata align="center" fileref="images/seamless.png" width="10cm" />
1351 </imageobject>
1352 </mediaobject>To enable seamless mode, after starting the virtual
1353 machine, press the Host key (normally the right control key) together with
1354 "L". This will enlarge the size of the VM's display to the size of your
1355 host screen and mask out the guest operating system's background. To go
1356 back to the "normal" VM display (i.e. to disable seamless windows), press
1357 the Host key and "L" again.</para>
1358 </sect1>
1359
1360 <sect1 id="guestadd-guestprops">
1361 <title>Guest properties</title>
1362
1363 <para>Starting with version 2.1, VirtualBox allows for requesting certain
1364 properties from a running guest, provided that the VirtualBox Guest
1365 Additions are installed and the VM is running. This is good for two
1366 things:<orderedlist>
1367 <listitem>
1368 <para>A number of predefined VM characteristics are automatically
1369 maintained by VirtualBox and can be retrieved on the host, e.g. to
1370 monitor VM performance and statistics.</para>
1371 </listitem>
1372
1373 <listitem>
1374 <para>In addition, arbitrary string data can be exchanged between
1375 guest and host. This works in both directions.</para>
1376 </listitem>
1377 </orderedlist></para>
1378
1379 <para>To accomplish this, VirtualBox establishes a private communication
1380 channel between the VirtualBox Guest Additions and the host, and software
1381 on both sides can use this channel to exchange string data for arbitrary
1382 purposes. Guest properties are simply string keys to which a value is
1383 attached. They can be set (written to) by either the host and the guest,
1384 and they can also be read from both sides.</para>
1385
1386 <para>In addition to establishing the general mechanism of reading and
1387 writing values, a set of predefined guest properties is automatically
1388 maintained by the VirtualBox Guest Additions to allow for retrieving
1389 interesting guest data such as the guest's exact operating system and
1390 service pack level, the installed version of the Guest Additions, users
1391 that are currently logged into the guest OS, network statistics and more.
1392 These predefined properties are all prefixed with
1393 <computeroutput>/VirtualBox/</computeroutput> and organized into a
1394 hierarchical tree of keys.</para>
1395
1396 <para>Some of this runtime information is shown when you select "Session
1397 Information Dialog" from a virtual machine's "Machine" menu.</para>
1398
1399 <para>A more flexible way to use this channel is via the
1400 <computeroutput>VBoxManage guestproperty</computeroutput> command set; see
1401 <xref linkend="vboxmanage-guestproperty" /> for details. For example, to
1402 have <emphasis>all</emphasis> the available guest properties for a given
1403 running VM listed with their respective values, use this:<screen>$ VBoxManage guestproperty enumerate "Windows Vista III"
1404VirtualBox Command Line Management Interface Version $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD
1405(C) 2005-$VBOX_C_YEAR $VBOX_VENDOR
1406All rights reserved.
1407
1408Name: /VirtualBox/GuestInfo/OS/Product, value: Windows Vista Business Edition,
1409 timestamp: 1229098278843087000, flags:
1410Name: /VirtualBox/GuestInfo/OS/Release, value: 6.0.6001,
1411 timestamp: 1229098278950553000, flags:
1412Name: /VirtualBox/GuestInfo/OS/ServicePack, value: 1,
1413 timestamp: 1229098279122627000, flags:
1414Name: /VirtualBox/GuestAdd/InstallDir,
1415 value: C:/Program Files/Oracle/VirtualBox
1416 Guest Additions, timestamp: 1229098279269739000, flags:
1417Name: /VirtualBox/GuestAdd/Revision, value: 40720,
1418 timestamp: 1229098279345664000, flags:
1419Name: /VirtualBox/GuestAdd/Version, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD,
1420 timestamp: 1229098279479515000, flags:
1421Name: /VirtualBox/GuestAdd/Components/VBoxControl.exe, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1422 timestamp: 1229098279651731000, flags:
1423Name: /VirtualBox/GuestAdd/Components/VBoxHook.dll, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1424 timestamp: 1229098279804835000, flags:
1425Name: /VirtualBox/GuestAdd/Components/VBoxDisp.dll, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1426 timestamp: 1229098279880611000, flags:
1427Name: /VirtualBox/GuestAdd/Components/VBoxMRXNP.dll, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1428 timestamp: 1229098279882618000, flags:
1429Name: /VirtualBox/GuestAdd/Components/VBoxService.exe, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1430 timestamp: 1229098279883195000, flags:
1431Name: /VirtualBox/GuestAdd/Components/VBoxTray.exe, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1432 timestamp: 1229098279885027000, flags:
1433Name: /VirtualBox/GuestAdd/Components/VBoxGuest.sys, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1434 timestamp: 1229098279886838000, flags:
1435Name: /VirtualBox/GuestAdd/Components/VBoxMouse.sys, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1436 timestamp: 1229098279890600000, flags:
1437Name: /VirtualBox/GuestAdd/Components/VBoxSF.sys, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1438 timestamp: 1229098279893056000, flags:
1439Name: /VirtualBox/GuestAdd/Components/VBoxVideo.sys, value: $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILDr40720,
1440 timestamp: 1229098279895767000, flags:
1441Name: /VirtualBox/GuestInfo/OS/LoggedInUsers, value: 1,
1442 timestamp: 1229099826317660000, flags:
1443Name: /VirtualBox/GuestInfo/OS/NoLoggedInUsers, value: false,
1444 timestamp: 1229098455580553000, flags:
1445Name: /VirtualBox/GuestInfo/Net/Count, value: 1,
1446 timestamp: 1229099826299785000, flags:
1447Name: /VirtualBox/HostInfo/GUI/LanguageID, value: C,
1448 timestamp: 1229098151272771000, flags:
1449Name: /VirtualBox/GuestInfo/Net/0/V4/IP, value: 192.168.2.102,
1450 timestamp: 1229099826300088000, flags:
1451Name: /VirtualBox/GuestInfo/Net/0/V4/Broadcast, value: 255.255.255.255,
1452 timestamp: 1229099826300220000, flags:
1453Name: /VirtualBox/GuestInfo/Net/0/V4/Netmask, value: 255.255.255.0,
1454 timestamp: 1229099826300350000, flags:
1455Name: /VirtualBox/GuestInfo/Net/0/Status, value: Up,
1456 timestamp: 1229099826300524000, flags:
1457Name: /VirtualBox/GuestInfo/OS/LoggedInUsersList, value: username,
1458 timestamp: 1229099826317386000, flags:</screen></para>
1459
1460 <para>To query the value of a single property, use the "get" subcommand
1461 like this:<screen>$ VBoxManage guestproperty get "Windows Vista III"
1462 "/VirtualBox/GuestInfo/OS/Product"
1463VirtualBox Command Line Management Interface Version $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD
1464(C) 2005-$VBOX_C_YEAR $VBOX_VENDOR
1465All rights reserved.
1466
1467Value: Windows Vista Business Edition
1468</screen></para>
1469
1470 <para>To add or change guest properties from the guest, use the tool
1471 <computeroutput>VBoxControl</computeroutput>. This tool is included in the
1472 Guest Additions of VirtualBox 2.2 or later. When started from a Linux
1473 guest, this tool requires root privileges for security reasons:<screen>$ sudo VBoxControl guestproperty enumerate
1474VirtualBox Guest Additions Command Line Management Interface Version $VBOX_VERSION_MAJOR.$VBOX_VERSION_MINOR.$VBOX_VERSION_BUILD
1475(C) 2009-$VBOX_C_YEAR $VBOX_VENDOR
1476All rights reserved.
1477
1478Name: /VirtualBox/GuestInfo/OS/Release, value: 2.6.28-18-generic,
1479 timestamp: 1265813265835667000, flags: &lt;NULL&gt;
1480Name: /VirtualBox/GuestInfo/OS/Version, value: #59-Ubuntu SMP Thu Jan 28 01:23:03 UTC 2010,
1481 timestamp: 1265813265836305000, flags: &lt;NULL&gt;
1482 ...</screen></para>
1483
1484 <para>For more complex needs, you can use the VirtualBox programming
1485 interfaces; see <xref linkend="VirtualBoxAPI" />.</para>
1486 </sect1>
1487
1488 <sect1 id="guestadd-guestcontrol">
1489 <title>Guest control</title>
1490
1491 <para>Starting with version 3.2, the Guest Additions of VirtualBox allow
1492 starting applications inside a VM from the host system.</para>
1493
1494 <para>For this to work, the application needs to be installed inside the
1495 guest; no additional software needs to be installed on the host.
1496 Additionally, text mode output (to stdout and stderr) can be shown on the
1497 host for further processing along with options to specify user credentials
1498 and a timeout value (in milliseconds) to limit time the application is
1499 able to run.</para>
1500
1501 <para>This feature can be used to automate deployment of software within
1502 the guest.</para>
1503
1504 <para>Starting with version 4.0, the Guest Additions for Windows allow for
1505 automatic updating (only already installed Guest Additions 4.0 or later).
1506 Also, copying files from host to the guest as well as remotely creating
1507 guest directories is available.</para>
1508
1509 <para>To use these feature, use the VirtualBox command line or the GUI.
1510 See <xref linkend="mountingadditionsiso" /> for automatically updating the
1511 Guest Additions or <xref linkend="vboxmanage-guestcontrol" /> for
1512 executing guest programs, copying files from the host or creating guest
1513 directories.</para>
1514 </sect1>
1515
1516 <sect1>
1517 <title>Memory overcommitment</title>
1518
1519 <para>In server environments with many VMs; the Guest Additions can be
1520 used to share physical host memory between several VMs, reducing the total
1521 amount of memory in use by the VMs. If memory usage is the limiting factor
1522 and CPU resources are still available, this can help with packing more VMs
1523 on each host.</para>
1524
1525 <sect2 id="guestadd-balloon">
1526 <title>Memory ballooning</title>
1527
1528 <para>Starting with version 3.2, the Guest Additions of VirtualBox can
1529 change the amount of host memory that a VM uses while the machine is
1530 running. Because of how this is implemented, this feature is called
1531 "memory ballooning".</para>
1532
1533 <note>
1534 <para>VirtualBox supports memory ballooning only on 64-bit hosts, and
1535 it is not supported on Mac OS X hosts.</para>
1536 </note>
1537
1538 <para>Normally, to change the amount of memory allocated to a virtual
1539 machine, one has to shut down the virtual machine entirely and modify
1540 its settings. With memory ballooning, memory that was allocated for a
1541 virtual machine can be given to another virtual machine without having
1542 to shut the machine down.</para>
1543
1544 <para>When memory ballooning is requested, the VirtualBox Guest
1545 Additions (which run inside the guest) allocate physical memory from the
1546 guest operating system on the kernel level and lock this memory down in
1547 the guest. This ensures that the guest will not use that memory any
1548 longer: no guest applications can allocate it, and the guest kernel will
1549 not use it either. VirtualBox can then re-use this memory and give it to
1550 another virtual machine.</para>
1551
1552 <para>The memory made available through the ballooning mechanism is only
1553 available for re-use by VirtualBox. It is <emphasis>not</emphasis>
1554 returned as free memory to the host. Requesting balloon memory from a
1555 running guest will therefore not increase the amount of free,
1556 unallocated memory on the host. Effectively, memory ballooning is
1557 therefore a memory overcommitment mechanism for multiple virtual
1558 machines while they are running. This can be useful to temporarily start
1559 another machine, or in more complicated environments, for sophisticated
1560 memory management of many virtual machines that may be running in
1561 parallel depending on how memory is used by the guests.</para>
1562
1563 <para>At this time, memory ballooning is only supported through
1564 VBoxManage. Use the following command to increase or decrease the size
1565 of the memory balloon within a running virtual machine that has Guest
1566 Additions installed: <screen>VBoxManage controlvm "VM name" guestmemoryballoon &lt;n&gt;</screen>where
1567 <computeroutput>"VM name"</computeroutput> is the name or UUID of the
1568 virtual machine in question and
1569 <computeroutput>&lt;n&gt;</computeroutput> is the amount of memory to
1570 allocate from the guest in megabytes. See <xref
1571 linkend="vboxmanage-controlvm" /> for more information.</para>
1572
1573 <para>You can also set a default balloon that will automatically be
1574 requested from the VM every time after it has started up with the
1575 following command: <screen>VBoxManage modifyvm "VM name" --guestmemoryballoon &lt;n&gt;</screen></para>
1576
1577 <para>By default, no balloon memory is allocated. This is a VM setting,
1578 like other <computeroutput>modifyvm</computeroutput> settings, and
1579 therefore can only be set while the machine is shut down; see <xref
1580 linkend="vboxmanage-modifyvm" />.</para>
1581 </sect2>
1582
1583 <sect2 id="guestadd-pagefusion">
1584 <title>Page Fusion</title>
1585
1586 <para>Whereas memory ballooning simply reduces the amount of RAM that is
1587 available to a VM, Page Fusion works differently: it avoids memory
1588 duplication between several similar running VMs.</para>
1589
1590 <para>In a server environment running several similar VMs (e.g. with
1591 identical operating systems) on the same host, lots of memory pages are
1592 identical. VirtualBox's Page Fusion technology, introduced with
1593 VirtualBox 3.2, is a novel technique to efficiently identify these
1594 identical memory pages and share them between multiple VMs.<note>
1595 <para>VirtualBox supports Page Fusion only on 64-bit hosts, and it
1596 is not supported on Mac OS X hosts. Page Fusion currently works only
1597 with Windows guests (2000 and later).</para>
1598 </note></para>
1599
1600 <para>The more similar the VMs on a given host are, the more efficiently
1601 Page Fusion can reduce the amount of host memory that is in use. It
1602 therefore works best if all VMs on a host run identical operating
1603 systems (e.g. Windows XP Service Pack 2). Instead of having a complete
1604 copy of each operating system in each VM, Page Fusion identifies the
1605 identical memory pages in use by these operating systems and eliminates
1606 the duplicates, sharing host memory between several machines
1607 ("deduplication"). If a VM tries to modify a page that has been shared
1608 with other VMs, a new page is allocated again for that VM with a copy of
1609 the shared page ("copy on write"). All this is fully transparent to the
1610 virtual machine.</para>
1611
1612 <para>You may be familiar with this kind of memory overcommitment from
1613 other hypervisor products, which call this feature "page sharing" or
1614 "same page merging". However, Page Fusion differs significantly from
1615 those other solutions, whose approaches have several
1616 drawbacks:<orderedlist>
1617 <listitem>
1618 <para>Traditional hypervisors scan <emphasis>all</emphasis> guest
1619 memory and compute checksums (hashes) for every single memory
1620 page. Then, they look for pages with identical hashes and compare
1621 the entire content of those pages; if two pages produce the same
1622 hash, it is very likely that the pages are identical in content.
1623 This, of course, can take rather long, especially if the system is
1624 not idling. As a result, the additional memory only becomes
1625 available after a significant amount of time (this can be hours or
1626 even days!). Even worse, this kind of page sharing algorithm
1627 generally consumes significant CPU resources and increases the
1628 virtualization overhead by 10-20%.</para>
1629
1630 <para>Page Fusion in VirtualBox uses logic in the VirtualBox Guest
1631 Additions to quickly identify memory cells that are most likely
1632 identical across VMs. It can therefore achieve most of the
1633 possible savings of page sharing almost immediately and with
1634 almost no overhead.</para>
1635 </listitem>
1636
1637 <listitem>
1638 <para>Page Fusion is also much less likely to be confused by
1639 identical memory that it will eliminate just to learn seconds
1640 later that the memory will now change and having to perform a
1641 highly expensive and often service-disrupting reallocation.</para>
1642 </listitem>
1643 </orderedlist></para>
1644
1645 <para>At this time, Page Fusion can only be controlled with VBoxManage,
1646 and only while a VM is shut down. To enable Page Fusion for a VM, use
1647 the following command:<screen>VBoxManage modifyvm "VM name" --pagefusion on</screen></para>
1648
1649 <para>You can observe Page Fusion operation using some metrics.
1650 <computeroutput>RAM/VMM/Shared</computeroutput> shows the total amount
1651 of fused pages, whereas the per-VM metric
1652 <computeroutput>Guest/RAM/Usage/Shared</computeroutput> will return the
1653 amount of fused memory for a given VM. Please refer to <xref
1654 linkend="metrics" /> for information on how to query metrics.</para>
1655 </sect2>
1656 </sect1>
1657</chapter>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette