VirtualBox

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

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

wddm: doc update

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

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