VirtualBox

source: vbox/trunk/doc/manual/en_US/user_Technical.xml@ 96388

最後變更 在這個檔案從96388是 96301,由 vboxsync 提交於 3 年 前

doc: comment fixes

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 33.7 KB
 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright (C) 2006-2022 Oracle Corporation
4
5 This file is part of VirtualBox Open Source Edition (OSE), as
6 available from http://www.alldomusa.eu.org. This file is free software;
7 you can redistribute it and/or modify it under the terms of the GNU
8 General Public License (GPL) as published by the Free Software
9 Foundation, in version 2 as it comes in the "COPYING" file of the
10 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
11 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
12-->
13<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
14"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[
15<!ENTITY % all.entities SYSTEM "all-entities.ent">
16%all.entities;
17]>
18<chapter id="TechnicalBackground">
19
20 <title>Technical Background</title>
21
22 <para>
23 This chapter provides additional information for readers who are
24 familiar with computer architecture and technology and wish to find
25 out more about how &product-name; works <emphasis>under the
26 hood</emphasis>. The contents of this chapter are not required
27 reading in order to use &product-name; successfully.
28 </para>
29
30 <sect1 id="vboxconfigdata">
31
32 <title>Where &product-name; Stores its Files</title>
33
34 <para>
35 In &product-name;, a virtual machine and its settings are
36 described in a virtual machine settings file in XML format. In
37 addition, most virtual machines have one or more virtual hard
38 disks. These are typically represented by disk images, such as
39 those in VDI format. The location of these files may vary,
40 depending on the host operating system. See
41 <xref linkend="vboxconfigdata-machine-folder"/>.
42 </para>
43
44 <para>
45 Global configuration data for &product-name; is maintained in
46 another location on the host. See
47 <xref linkend="vboxconfigdata-global"/>.
48 </para>
49
50 <sect2 id="vboxconfigdata-machine-folder">
51
52 <title>The Machine Folder</title>
53
54 <para>
55 By default, each virtual machine has a directory on your host
56 computer where all the files of that machine are stored: the XML
57 settings file, with a <filename>.vbox</filename> file extension,
58 and its disk images. This is called the <emphasis>machine
59 folder</emphasis>.
60 </para>
61
62 <para>
63 By default, this machine folder is located in a common folder
64 called <filename>VirtualBox VMs</filename>, which &product-name;
65 creates in the current system user's home directory. The
66 location of this home directory depends on the conventions of
67 the host operating system, as follows:
68 </para>
69
70 <itemizedlist>
71
72 <listitem>
73 <para>
74 On Windows, this is the location returned by the
75 <literal>SHGetFolderPath</literal> function of the Windows
76 system library Shell32.dll, asking for the user profile. A
77 typical location is
78 <filename>C:\Users\<replaceable>username</replaceable></filename>.
79 </para>
80 </listitem>
81
82 <listitem>
83 <para>
84 On Linux, Mac OS X, and Oracle Solaris, this is generally
85 taken from the environment variable
86 <filename>$HOME</filename>, except for the user
87 <literal>root</literal> where it is taken from the account
88 database. This is a workaround for the frequent trouble
89 caused by users using &product-name; in combination with the
90 tool <command>sudo</command>, which by default does not
91 reset the environment variable <filename>$HOME</filename>.
92 </para>
93
94 <para>
95 A typical location on Linux and Oracle Solaris is
96 <filename>/home/<replaceable>username</replaceable></filename>
97 and on Mac OS X is
98 <filename>/Users/<replaceable>username</replaceable></filename>.
99 </para>
100 </listitem>
101
102 </itemizedlist>
103
104 <para>
105 For simplicity, we abbreviate the location of the home directory
106 as <filename>$HOME</filename>. Using that convention, the common
107 folder for all virtual machines is <filename>$HOME/VirtualBox
108 VMs</filename>.
109 </para>
110
111 <para>
112 As an example, when you create a virtual machine called "Example
113 VM", &product-name; creates the following:
114 </para>
115
116 <itemizedlist>
117
118 <listitem>
119 <para>
120 A machine folder: <filename>$HOME/VirtualBox VMs/Example
121 VM/</filename>
122 </para>
123 </listitem>
124
125 <listitem>
126 <para>
127 In the machine folder, a settings file: <filename>Example
128 VM.vbox</filename>
129 </para>
130 </listitem>
131
132 <listitem>
133 <para>
134 In the machine folder, a virtual disk image:
135 <filename>Example VM.vdi</filename>.
136 </para>
137 </listitem>
138
139 </itemizedlist>
140
141 <para>
142 This is the default layout if you use the
143 <emphasis role="bold">Create New Virtual Machine</emphasis>
144 wizard described in <xref linkend="gui-createvm" />. Once you
145 start working with the VM, additional files are added. Log files
146 are in a subfolder called <filename>Logs</filename>, and if you
147 have taken snapshots, they are in a
148 <filename>Snapshots</filename> subfolder. For each VM, you can
149 change the location of its snapshots folder in the VM settings.
150 </para>
151
152 <para>
153 You can change the default machine folder by selecting
154 <emphasis role="bold">Preferences</emphasis> from the
155 <emphasis role="bold">File</emphasis> menu in the &product-name;
156 main window. Then, in the displayed window, click on the
157 <emphasis role="bold">General</emphasis> tab. Alternatively, use
158 the <command>VBoxManage setproperty machinefolder</command>
159 command. See <xref linkend="vboxmanage-setproperty" />.
160 </para>
161
162 </sect2>
163
164 <sect2 id="vboxconfigdata-global">
165
166 <title>Global Settings</title>
167
168 <para>
169 In addition to the files for the virtual machines,
170 &product-name; maintains global configuration data in the
171 following directory:
172 </para>
173
174 <itemizedlist>
175
176 <listitem>
177 <para>
178 <emphasis role="bold">Linux and Oracle Solaris:</emphasis>
179 <filename>$HOME/.config/VirtualBox</filename>.
180 </para>
181 </listitem>
182
183 <listitem>
184 <para>
185 <emphasis role="bold">Windows:</emphasis>
186 <filename>$HOME/.VirtualBox</filename>.
187 </para>
188 </listitem>
189
190 <listitem>
191 <para>
192 <emphasis role="bold">Mac OS X:</emphasis>
193 <filename>$HOME/Library/VirtualBox</filename>.
194 </para>
195 </listitem>
196
197 </itemizedlist>
198
199 <para>
200 &product-name; creates this configuration directory
201 automatically, if necessary. You can specify an alternate
202 configuration directory by either setting the
203 <literal>VBOX_USER_HOME</literal> environment variable, or on
204 Linux or Oracle Solaris by using the standard
205 <literal>XDG_CONFIG_HOME</literal> variable. Since the global
206 <filename>VirtualBox.xml</filename> settings file points to all
207 other configuration files, this enables switching between
208 several &product-name; configurations.
209 </para>
210
211 <para>
212 In this configuration directory, &product-name; stores its
213 global settings file, an XML file called
214 <filename>VirtualBox.xml</filename>. This file includes global
215 configuration options and a list of registered virtual machines
216 with pointers to their XML settings files.
217 </para>
218
219 </sect2>
220
221 <sect2 id="vboxconfigdata-summary-locations">
222
223 <title>Summary of Configuration Data Locations</title>
224
225 <para>
226 The following table gives a brief overview of the configuration
227 data locations on an &product-name; host.
228 </para>
229
230 <table id="table-config-summary" tabstyle="oracle-all">
231 <title>Configuration File Locations</title>
232 <tgroup cols="2">
233 <thead>
234 <row>
235 <entry><para>
236 <emphasis role="bold">Setting</emphasis>
237 </para></entry>
238 <entry><para>
239 <emphasis role="bold">Location</emphasis>
240 </para></entry>
241 </row>
242 </thead>
243 <tbody>
244 <row>
245 <entry><para>
246 Default machines folder
247 </para></entry>
248 <entry><para>
249 <filename>$HOME/VirtualBox VMs</filename>
250 </para></entry>
251 </row>
252 <row>
253 <entry><para>
254 Default disk image location
255 </para></entry>
256 <entry><para>
257 In each machine's folder
258 </para></entry>
259 </row>
260 <row>
261 <entry><para>
262 Machine settings file extension
263 </para></entry>
264 <entry><para>
265 <filename>.vbox</filename>
266 </para></entry>
267 </row>
268 <row>
269 <entry><para>
270 Media registry
271 </para></entry>
272 <entry><para>
273 Each machine settings file
274 </para>
275
276
277
278 <para>
279 Media registration is done automatically when a
280 storage medium is attached to a VM
281 </para></entry>
282 </row>
283 </tbody>
284 </tgroup>
285 </table>
286
287 </sect2>
288
289 <sect2 id="vboxconfigdata-XML-files">
290
291 <title>&product-name; XML Files</title>
292
293 <para>
294 &product-name; uses XML for both the machine settings files and
295 the global configuration file,
296 <filename>VirtualBox.xml</filename>.
297 </para>
298
299 <para>
300 All &product-name; XML files are versioned. When a new settings
301 file is created, for example because a new virtual machine is
302 created, &product-name; automatically uses the settings format
303 of the current &product-name; version. These files may not be
304 readable if you downgrade to an earlier version of
305 &product-name;. However, when &product-name; encounters a
306 settings file from an earlier version, such as after upgrading
307 &product-name;, it attempts to preserve the settings format as
308 much as possible. It will only silently upgrade the settings
309 format if the current settings cannot be expressed in the old
310 format, for example because you enabled a feature that was not
311 present in an earlier version of &product-name;.
312 </para>
313
314 <para>
315 In such cases, &product-name; backs up the old settings file in
316 the virtual machine's configuration directory. If you need to go
317 back to the earlier version of &product-name;, then you will
318 need to manually copy these backup files back.
319 </para>
320
321 <para>
322 We intentionally do not document the specifications of the
323 &product-name; XML files, as we must reserve the right to modify
324 them in the future. We therefore strongly suggest that you do
325 not edit these files manually. &product-name; provides complete
326 access to its configuration data through its the
327 <command>VBoxManage</command> command line tool, see
328 <xref linkend="vboxmanage" /> and its API, see
329 <xref linkend="VirtualBoxAPI" />.
330 </para>
331
332 </sect2>
333
334 </sect1>
335
336 <sect1 id="technical-components">
337
338 <title>&product-name; Executables and Components</title>
339
340 <para>
341 &product-name; was designed to be modular and flexible. When the
342 &product-name; graphical user interface (GUI) is opened and a VM
343 is started, at least the following three processes are running:
344 </para>
345
346 <itemizedlist>
347
348 <listitem>
349 <para>
350 <command>VBoxSVC</command>, the &product-name; service process
351 which always runs in the background. This process is started
352 automatically by the first &product-name; client process and
353 exits a short time after the last client exits. The first
354 &product-name; service can be the GUI,
355 <command>VBoxManage</command>,
356 <command>VBoxHeadless</command>, the web service amongst
357 others. The service is responsible for bookkeeping,
358 maintaining the state of all VMs, and for providing
359 communication between &product-name; components. This
360 communication is implemented using COM/XPCOM.
361 </para>
362
363 <note>
364 <para>
365 When we refer to <emphasis>clients</emphasis> here, we mean
366 the local clients of a particular <command>VBoxSVC</command>
367 server process, not clients in a network. &product-name;
368 employs its own client/server design to allow its processes
369 to cooperate, but all these processes run under the same
370 user account on the host operating system, and this is
371 totally transparent to the user.
372 </para>
373 </note>
374 </listitem>
375
376 <listitem>
377 <para>
378 The GUI process, <command>VirtualBoxVM</command>, a client
379 application based on the cross-platform Qt library. When
380 started without the <option>--startvm</option> option, this
381 application acts as the VirtualBox Manager, displaying the VMs
382 and their settings. It then communicates settings and state
383 changes to <command>VBoxSVC</command> and also reflects
384 changes effected through other means, such as the
385 <command>VBoxManage</command> command.
386 </para>
387 </listitem>
388
389 <listitem>
390 <para>
391 If the <command>VirtualBoxVM</command> client application is
392 started with the <option>--startvm</option> argument, it loads
393 the VMM library which includes the actual hypervisor and then
394 runs a virtual machine and provides the input and output for
395 the guest.
396 </para>
397 </listitem>
398
399 </itemizedlist>
400
401 <para>
402 Any &product-name; front-end, or client, will communicate with the
403 service process and can both control and reflect the current
404 state. For example, either the VM selector or the VM window or
405 VBoxManage can be used to pause the running VM, and other
406 components will always reflect the changed state.
407 </para>
408
409 <para>
410 The &product-name; GUI application is only one of several
411 available front ends, or clients. The complete list shipped with
412 &product-name; is as follows:
413 </para>
414
415 <itemizedlist>
416
417 <listitem>
418 <para>
419 <command>VirtualBoxVM</command>: The Qt front end implementing
420 the VirtualBox Manager and running VMs.
421 </para>
422 </listitem>
423
424 <listitem>
425 <para>
426 <command>VBoxManage</command>: A less user-friendly but more
427 powerful alternative. See <xref linkend="vboxmanage" />.
428 </para>
429 </listitem>
430
431 <listitem>
432 <para>
433 <command>VBoxHeadless</command>: A VM front end which does not
434 directly provide any video output and keyboard or mouse input,
435 but enables redirection through the VirtualBox Remote Desktop
436 Extension. See <xref linkend="vboxheadless" />.
437 </para>
438 </listitem>
439
440 <listitem>
441 <para>
442 <command>vboxwebsrv</command>: The &product-name; web service
443 process which enables control of an &product-name; host
444 remotely. This is described in detail in the &product-name;
445 Software Development Kit (SDK) reference. See
446 <xref linkend="VirtualBoxAPI" />.
447 </para>
448 </listitem>
449
450 <listitem>
451 <para>
452 The &product-name; Python shell: A Python alternative to
453 <command>VBoxManage</command>. This is also described in the
454 SDK reference.
455 </para>
456 </listitem>
457
458 </itemizedlist>
459
460 <para>
461 Internally, &product-name; consists of many more or less separate
462 components. You may encounter these when analyzing &product-name;
463 internal error messages or log files. These include the following:
464 </para>
465
466 <itemizedlist>
467
468 <listitem>
469 <para>
470 IPRT: A portable runtime library which abstracts file access,
471 threading, and string manipulation. Whenever &product-name;
472 accesses host operating features, it does so through this
473 library for cross-platform portability.
474 </para>
475 </listitem>
476
477 <listitem>
478 <para>
479 VMM (Virtual Machine Monitor): The heart of the hypervisor.
480 </para>
481 </listitem>
482
483 <listitem>
484 <para>
485 EM (Execution Manager): Controls execution of guest code.
486 </para>
487 </listitem>
488
489 <listitem>
490 <para>
491 TRPM (Trap Manager): Intercepts and processes guest traps and
492 exceptions.
493 </para>
494 </listitem>
495
496 <listitem>
497 <para>
498 HM (Hardware Acceleration Manager): Provides support for VT-x
499 and AMD-V.
500 </para>
501 </listitem>
502
503 <listitem>
504 <para>
505 GIM (Guest Interface Manager): Provides support for various
506 paravirtualization interfaces to the guest.
507 </para>
508 </listitem>
509
510 <listitem>
511 <para>
512 PDM (Pluggable Device Manager): An abstract interface between
513 the VMM and emulated devices which separates device
514 implementations from VMM internals and makes it easy to add
515 new emulated devices. Through PDM, third-party developers can
516 add new virtual devices to &product-name; without having to
517 change &product-name; itself.
518 </para>
519 </listitem>
520
521 <listitem>
522 <para>
523 PGM (Page Manager): A component that controls guest paging.
524 </para>
525 </listitem>
526
527 <listitem>
528 <para>
529 TM (Time Manager): Handles timers and all aspects of time
530 inside guests.
531 </para>
532 </listitem>
533
534 <listitem>
535 <para>
536 CFGM (Configuration Manager): Provides a tree structure which
537 holds configuration settings for the VM and all emulated
538 devices.
539 </para>
540 </listitem>
541
542 <listitem>
543 <para>
544 SSM (Saved State Manager): Saves and loads VM state.
545 </para>
546 </listitem>
547
548 <listitem>
549 <para>
550 VUSB (Virtual USB): A USB layer which separates emulated USB
551 controllers from the controllers on the host and from USB
552 devices. This component also enables remote USB.
553 </para>
554 </listitem>
555
556 <listitem>
557 <para>
558 DBGF (Debug Facility): A built-in VM debugger.
559 </para>
560 </listitem>
561
562 <listitem>
563 <para>
564 &product-name; emulates a number of devices to provide the
565 hardware environment that various guests need. Most of these
566 are standard devices found in many PC compatible machines and
567 widely supported by guest operating systems. For network and
568 storage devices in particular, there are several options for
569 the emulated devices to access the underlying hardware. These
570 devices are managed by PDM.
571 </para>
572 </listitem>
573
574 <listitem>
575 <para>
576 Guest Additions for various guest operating systems. This is
577 code that is installed from within a virtual machine. See
578 <xref linkend="guestadditions" />.
579 </para>
580 </listitem>
581
582 <listitem>
583 <para>
584 The "Main" component is special. It ties all the above bits
585 together and is the only public API that &product-name;
586 provides. All the client processes listed above use only this
587 API and never access the hypervisor components directly. As a
588 result, third-party applications that use the &product-name;
589 Main API can rely on the fact that it is always well-tested
590 and that all capabilities of &product-name; are fully exposed.
591 It is this API that is described in the &product-name; SDK.
592 See <xref linkend="VirtualBoxAPI" />.
593 </para>
594 </listitem>
595
596 </itemizedlist>
597
598 </sect1>
599
600 <sect1 id="hwvirt">
601
602 <title>Hardware Virtualization</title>
603
604 <para>
605 &product-name; enables software in the virtual machine to run
606 directly on the processor of the host, but an array of complex
607 techniques is employed to intercept operations that would
608 interfere with your host. Whenever the guest attempts to do
609 something that could be harmful to your computer and its data,
610 &product-name; steps in and takes action. In particular, for lots
611 of hardware that the guest believes to be accessing,
612 &product-name; simulates a certain <emphasis>virtual</emphasis>
613 environment according to how you have configured a virtual
614 machine. For example, when the guest attempts to access a hard
615 disk, &product-name; redirects these requests to whatever you have
616 configured to be the virtual machine's virtual hard disk. This is
617 normally an image file on your host.
618 </para>
619
620 <para>
621 Unfortunately, the x86 platform was never designed to be
622 virtualized. Detecting situations in which &product-name; needs to
623 take control over the guest code that is executing, as described
624 above, is difficult. To achieve this, &product-name; uses
625 <emphasis>hardware virtualization</emphasis>.
626 </para>
627
628 <para>
629 Intel and AMD processors have support for hardware virtualization.
630 This means that these processors can help &product-name; to
631 intercept potentially dangerous operations that a guest operating
632 system may be attempting and also makes it easier to present
633 virtual hardware to a virtual machine.
634 </para>
635
636 <para>
637 These hardware features differ between Intel and AMD processors.
638 Intel named its technology VT-x, AMD calls theirs AMD-V. The Intel
639 and AMD support for virtualization is very different in detail,
640 but not very different in principle.
641 </para>
642
643 <note>
644 <para>
645 On many systems, the hardware virtualization features first need
646 to be enabled in the BIOS before &product-name; can use them.
647 </para>
648 </note>
649
650 <para>
651 Enabling hardware virtualization is <emphasis>required</emphasis>
652 in the following scenarios:
653 </para>
654
655 <itemizedlist>
656
657 <listitem>
658 <para>
659 Certain rare guest operating systems like OS/2 make use of
660 very esoteric processor instructions. For virtual machines
661 that are configured to use such an operating system, hardware
662 virtualization is enabled automatically.
663 </para>
664 </listitem>
665
666 <listitem>
667 <para>
668 &product-name;'s 64-bit guest and multiprocessing (SMP)
669 support both require hardware virtualization to be enabled.
670 This is not much of a limitation since the vast majority of
671 64-bit and multicore CPUs ship with hardware virtualization.
672 The exceptions to this rule are some legacy Intel and AMD
673 CPUs.
674 </para>
675 </listitem>
676
677 </itemizedlist>
678
679 <warning>
680 <para>
681 Do not run other hypervisors, either open source or commercial
682 virtualization products, together with &product-name;. While
683 several hypervisors can normally be
684 <emphasis>installed</emphasis> in parallel, do not attempt to
685 <emphasis>run</emphasis> several virtual machines from competing
686 hypervisors at the same time. &product-name; cannot track what
687 another hypervisor is currently attempting to do on the same
688 host, and especially if several products attempt to use hardware
689 virtualization features such as VT-x, this can crash the entire
690 host.
691 </para>
692 </warning>
693
694 <para>
695 See <xref linkend="hwvirt-details"/> for a technical discussion of
696 hardware virtualization.
697 </para>
698
699 </sect1>
700
701 <sect1 id="hwvirt-details">
702
703 <title>Details About Hardware Virtualization</title>
704
705 <para>
706 With Intel VT-x, there are two distinct modes of CPU operation:
707 VMX root mode and non-root mode.
708 </para>
709
710 <itemizedlist>
711
712 <listitem>
713 <para>
714 In root mode, the CPU operates much like older generations of
715 processors without VT-x support. There are four privilege
716 levels, called rings, and the same instruction set is
717 supported, with the addition of several virtualization
718 specific instruction. Root mode is what a host operating
719 system without virtualization uses, and it is also used by a
720 hypervisor when virtualization is active.
721 </para>
722 </listitem>
723
724 <listitem>
725 <para>
726 In non-root mode, CPU operation is significantly different.
727 There are still four privilege rings and the same instruction
728 set, but a new structure called VMCS (Virtual Machine Control
729 Structure) now controls the CPU operation and determines how
730 certain instructions behave. Non-root mode is where guest
731 systems run.
732 </para>
733 </listitem>
734
735 </itemizedlist>
736
737 <para>
738 Switching from root mode to non-root mode is called "VM entry",
739 the switch back is "VM exit". The VMCS includes a guest and host
740 state area which is saved/restored at VM entry and exit. Most
741 importantly, the VMCS controls which guest operations will cause
742 VM exits.
743 </para>
744
745 <para>
746 The VMCS provides fairly fine-grained control over what the guests
747 can and cannot do. For example, a hypervisor can allow a guest to
748 write certain bits in shadowed control registers, but not others.
749 This enables efficient virtualization in cases where guests can be
750 allowed to write control bits without disrupting the hypervisor,
751 while preventing them from altering control bits over which the
752 hypervisor needs to retain full control. The VMCS also provides
753 control over interrupt delivery and exceptions.
754 </para>
755
756 <para>
757 Whenever an instruction or event causes a VM exit, the VMCS
758 contains information about the exit reason, often with
759 accompanying detail. For example, if a write to the CR0 register
760 causes an exit, the offending instruction is recorded, along with
761 the fact that a write access to a control register caused the
762 exit, and information about source and destination register. Thus
763 the hypervisor can efficiently handle the condition without
764 needing advanced techniques such as CSAM and PATM described above.
765 </para>
766
767 <para>
768 VT-x inherently avoids several of the problems which software
769 virtualization faces. The guest has its own completely separate
770 address space not shared with the hypervisor, which eliminates
771 potential clashes. Additionally, guest OS kernel code runs at
772 privilege ring 0 in VMX non-root mode, obviating the problems by
773 running ring 0 code at less privileged levels. For example the
774 SYSENTER instruction can transition to ring 0 without causing
775 problems. Naturally, even at ring 0 in VMX non-root mode, any I/O
776 access by guest code still causes a VM exit, allowing for device
777 emulation.
778 </para>
779
780 <para>
781 The biggest difference between VT-x and AMD-V is that AMD-V
782 provides a more complete virtualization environment. VT-x requires
783 the VMX non-root code to run with paging enabled, which precludes
784 hardware virtualization of real-mode code and non-paged
785 protected-mode software. This typically only includes firmware and
786 OS loaders, but nevertheless complicates VT-x hypervisor
787 implementation. AMD-V does not have this restriction.
788 </para>
789
790 <para>
791 Of course hardware virtualization is not perfect. Compared to
792 software virtualization, the overhead of VM exits is relatively
793 high. This causes problems for devices whose emulation requires
794 high number of traps. One example is a VGA device in 16-color
795 mode, where not only every I/O port access but also every access
796 to the framebuffer memory must be trapped.
797 </para>
798
799 </sect1>
800
801 <sect1 id="gimproviders">
802
803 <title>Paravirtualization Providers</title>
804
805 <para>
806 &product-name; enables the exposure of a paravirtualization
807 interface, to facilitate accurate and efficient execution of
808 software within a virtual machine. These interfaces require the
809 guest operating system to recognize their presence and make use of
810 them in order to leverage the benefits of communicating with the
811 &product-name; hypervisor.
812 </para>
813
814 <para>
815 Most modern, mainstream guest operating systems, including Windows
816 and Linux, ship with support for one or more paravirtualization
817 interfaces. Hence, there is typically no need to install
818 additional software in the guest to take advantage of this
819 feature.
820 </para>
821
822 <para>
823 Exposing a paravirtualization provider to the guest operating
824 system does not rely on the choice of host platforms. For example,
825 the <emphasis>Hyper-V</emphasis> paravirtualization provider can
826 be used for VMs to run on any host platform supported by
827 &product-name; and not just Windows.
828 </para>
829
830 <para>
831 &product-name; provides the following interfaces:
832 </para>
833
834 <itemizedlist>
835
836 <listitem>
837 <para>
838 <emphasis role="bold">Minimal</emphasis>: Announces the
839 presence of a virtualized environment. Additionally, reports
840 the TSC and APIC frequency to the guest operating system. This
841 provider is mandatory for running any Mac OS X guests.
842 </para>
843 </listitem>
844
845 <listitem>
846 <para>
847 <emphasis role="bold">KVM</emphasis>: Presents a Linux KVM
848 hypervisor interface which is recognized by Linux kernels
849 version 2.6.25 or later. &product-name;'s implementation
850 currently supports paravirtualized clocks and SMP spinlocks.
851 This provider is recommended for Linux guests.
852 </para>
853 </listitem>
854
855 <listitem>
856 <para>
857 <emphasis role="bold">Hyper-V</emphasis>: Presents a Microsoft
858 Hyper-V hypervisor interface which is recognized by Windows 7
859 and newer operating systems. &product-name;'s implementation
860 currently supports paravirtualized clocks, APIC frequency
861 reporting, guest debugging, guest crash reporting and relaxed
862 timer checks. This provider is recommended for Windows guests.
863 </para>
864 </listitem>
865
866 </itemizedlist>
867
868 </sect1>
869
870 <sect1 id="nestedpaging">
871
872 <title>Nested Paging and VPIDs</title>
873
874 <para>
875 In addition to normal hardware virtualization, your processor may
876 also support the following additional sophisticated techniques:
877 </para>
878
879 <itemizedlist>
880
881 <listitem>
882 <para>
883 Nested paging implements some memory management in hardware,
884 which can greatly accelerate hardware virtualization since
885 these tasks no longer need to be performed by the
886 virtualization software.
887 </para>
888
889 <para>
890 With nested paging, the hardware provides another level of
891 indirection when translating linear to physical addresses.
892 Page tables function as before, but linear addresses are now
893 translated to "guest physical" addresses first and not
894 physical addresses directly. A new set of paging registers now
895 exists under the traditional paging mechanism and translates
896 from guest physical addresses to host physical addresses,
897 which are used to access memory.
898 </para>
899
900 <para>
901 Nested paging eliminates the overhead caused by VM exits and
902 page table accesses. In essence, with nested page tables the
903 guest can handle paging without intervention from the
904 hypervisor. Nested paging thus significantly improves
905 virtualization performance.
906 </para>
907
908 <para>
909 On AMD processors, nested paging has been available starting
910 with the Barcelona (K10) architecture. They now call it rapid
911 virtualization indexing (RVI). Intel added support for nested
912 paging, which they call extended page tables (EPT), with their
913 Core i7 (Nehalem) processors.
914 </para>
915
916 <para>
917 If nested paging is enabled, the &product-name; hypervisor can
918 also use <emphasis>large pages</emphasis> to reduce TLB usage
919 and overhead. This can yield a performance improvement of up
920 to 5%. To enable this feature for a VM, you use the
921 <command>VBoxManage modifyvm --large-pages</command> command.
922 See <xref linkend="vboxmanage-modifyvm" />.
923 </para>
924
925 <para>
926 If you have an Intel CPU with EPT, please consult
927 <xref linkend="sec-rec-cve-2018-3646" /> for security concerns
928 regarding EPT.
929 </para>
930 </listitem>
931
932 <listitem>
933 <para>
934 On Intel CPUs, a hardware feature called Virtual Processor
935 Identifiers (VPIDs) can greatly accelerate context switching
936 by reducing the need for expensive flushing of the processor's
937 Translation Lookaside Buffers (TLBs).
938 </para>
939
940 <para>
941 To enable these features for a VM, you use the
942 <command>VBoxManage modifyvm --vtx-vpid</command> and
943 <command>VBoxManage modifyvm --large-pages</command> commands.
944 See <xref linkend="vboxmanage-modifyvm" />.
945 </para>
946 </listitem>
947
948 </itemizedlist>
949
950 </sect1>
951
952</chapter>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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