VirtualBox

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

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

Manual: changelog, document scale mode

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

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