VirtualBox

source: vbox/trunk/doc/manual/en_US/user_AdvancedTopics.xml@ 35285

Last change on this file since 35285 was 35193, checked in by vboxsync, 14 years ago

UserManual: VRDE updates.

File size: 65.9 KB
Line 
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 id="AdvancedTopics">
5 <title>Advanced topics</title>
6
7 <sect1 id="vboxsdl">
8 <title>VBoxSDL, the simplified VM displayer</title>
9
10 <sect2>
11 <title>Introduction</title>
12
13 <para>VBoxSDL is a simple graphical user interface (GUI) that lacks the
14 nice point-and-click support which VirtualBox, our main GUI, provides.
15 VBoxSDL is currently primarily used internally for debugging VirtualBox
16 and therefore not officially supported. Still, you may find it useful
17 for environments where the virtual machines are not necessarily
18 controlled by the same person that uses the virtual machine.<note>
19 <para>VBoxSDL is not available on the Mac OS X host platform.</para>
20 </note></para>
21
22 <para>As you can see in the following screenshot, VBoxSDL does indeed
23 only provide a simple window that contains only the "pure" virtual
24 machine, without menus or other controls to click upon and no additional
25 indicators of virtual machine activity:</para>
26
27 <para><mediaobject>
28 <imageobject>
29 <imagedata align="center" fileref="images/vbox-sdl.png"
30 width="10cm" />
31 </imageobject>
32 </mediaobject></para>
33
34 <para>To start a virtual machine with VBoxSDL instead of the VirtualBox
35 GUI, enter the following on a command line:<screen>VBoxSDL --startvm &lt;vm&gt;</screen></para>
36
37 <para>where <computeroutput>&lt;vm&gt;</computeroutput> is, as usual
38 with VirtualBox command line parameters, the name or UUID of an existing
39 virtual machine.</para>
40 </sect2>
41
42 <sect2>
43 <title>Secure labeling with VBoxSDL</title>
44
45 <para>When running guest operating systems in fullscreen mode, the guest
46 operating system usually has control over the whole screen. This could
47 present a security risk as the guest operating system might fool the
48 user into thinking that it is either a different system (which might
49 have a higher security level) or it might present messages on the screen
50 that appear to stem from the host operating system.</para>
51
52 <para>In order to protect the user against the above mentioned security
53 risks, the secure labeling feature has been developed. Secure labeling
54 is currently available only for VBoxSDL. When enabled, a portion of the
55 display area is reserved for a label in which a user defined message is
56 displayed. The label height in set to 20 pixels in VBoxSDL. The label
57 font color and background color can be optionally set as hexadecimal RGB
58 color values. The following syntax is used to enable secure
59 labeling:</para>
60
61 <screen>VBoxSDL --startvm "VM name"
62 --securelabel --seclabelfnt ~/fonts/arial.ttf
63 --seclabelsiz 14 --seclabelfgcol 00FF00 --seclabelbgcol 00FFFF</screen>
64
65 <para>In addition to enabling secure labeling, a TrueType font has to be
66 supplied. To use another font size than 12 point use the parameter
67 <computeroutput>--seclabelsiz</computeroutput>.</para>
68
69 <para>The label text can be set with <screen>VBoxManage setextradata "VM name" "VBoxSDL/SecureLabel" "The Label"</screen>
70 Changing this label will take effect immediately.</para>
71
72 <para>Typically, full screen resolutions are limited to certain
73 "standard" geometries such as 1024 x 768. Increasing this by twenty
74 lines is not usually feasible, so in most cases, VBoxSDL will chose the
75 next higher resolution, e.g. 1280 x 1024 and the guest's screen will not
76 cover the whole display surface. If VBoxSDL is unable to choose a higher
77 resolution, the secure label will be painted on top of the guest's
78 screen surface. In order to address the problem of the bottom part of
79 the guest screen being hidden, VBoxSDL can provide custom video modes to
80 the guest that are reduced by the height of the label. For Windows
81 guests and recent Solaris and Linux guests, the VirtualBox Guest
82 Additions automatically provide the reduced video modes. Additionally,
83 the VESA BIOS has been adjusted to duplicate its standard mode table
84 with adjusted resolutions. The adjusted mode IDs can be calculated using
85 the following formula:</para>
86
87 <screen>reduced_modeid = modeid + 0x30</screen>
88
89 <para>For example, in order to start Linux with 1024 x 748 x 16, the
90 standard mode 0x117 (1024 x 768 x 16) is used as a base. The Linux video
91 mode kernel parameter can then be calculated using:</para>
92
93 <screen>vga = 0x200 | 0x117 + 0x30
94vga = 839</screen>
95
96 <para>The reason for duplicating the standard modes instead of only
97 supplying the adjusted modes is that most guest operating systems
98 require the standard VESA modes to be fixed and refuse to start with
99 different modes.</para>
100
101 <para>When using the X.org VESA driver, custom modelines have to be
102 calculated and added to the configuration (usually in
103 <literal>/etc/X11/xorg.conf</literal>. A handy tool to determine
104 modeline entries can be found at <literal><ulink
105 url="http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html">http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html</ulink></literal>.)</para>
106 </sect2>
107
108 <sect2>
109 <title>Releasing modifiers with VBoxSDL on Linux</title>
110
111 <para>When switching from a X virtual terminal (VT) to another VT using
112 Ctrl-Alt-Fx while the VBoxSDL window has the input focus, the guest will
113 receive Ctrl and Alt keypress events without receiving the corresponding
114 key release events. This is an architectural limitation of Linux. In
115 order to reset the modifier keys, it is possible to send
116 <computeroutput>SIGUSR1</computeroutput> to the VBoxSDL main thread
117 (first entry in the <computeroutput>ps</computeroutput> list). For
118 example, when switching away to another VT and saving the virtual
119 machine from this terminal, the following sequence can be used to make
120 sure the VM is not saved with stuck modifiers:</para>
121
122 <para><screen>kill -usr1 &lt;pid&gt;
123VBoxManage controlvm "Windows 2000" savestate</screen></para>
124 </sect2>
125 </sect1>
126
127 <sect1>
128 <title id="autologon">Automated guest logons</title>
129
130 <para>VirtualBox provides Guest Addition modules for Windows, Linux and
131 Solaris to enable automated logons on the guest.</para>
132
133 <para>When a guest operating system is running in a virtual machine, it
134 might be desirable to perform coordinated and automated logons using
135 credentials from a master logon system. (With "credentials", we are
136 referring to logon information consisting of user name, password and
137 domain name, where each value might be empty.)</para>
138
139 <sect2 id="autologon_win">
140 <title>Automated Windows guest logons</title>
141
142 <para>Since Windows NT, Windows has provided a modular system logon
143 subsystem ("Winlogon") which can be customized and extended by means of
144 so-called GINA modules (Graphical Identification and Authentication).
145 With Windows Vista and Windows 7, the GINA modules were replaced with a
146 new mechanism called "credential providers". The VirtualBox Guest
147 Additions for Windows come with both, a GINA and a credential provider
148 module, and therefore enable any Windows guest to perform automated
149 logons.</para>
150
151 <para>To activate the VirtualBox GINA or credential provider module,
152 install the Guest Additions with using the command line switch
153 <computeroutput>/with_autologon</computeroutput>. All the following
154 manual steps required for installing these modules will be then done by
155 the installer.</para>
156
157 <para>To manually install the VirtualBox GINA module, extract the Guest
158 Additions (see <xref linkend="windows-guest-file-extraction" />) and
159 copy the file <computeroutput>VBoxGINA.dll</computeroutput> to the
160 Windows <computeroutput>SYSTEM32</computeroutput> directory. Then, in
161 the registry, create the following key: <screen>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GinaDLL</screen>
162 with a value of <computeroutput>VBoxGINA.dll</computeroutput>.</para>
163
164 <note>
165 <para>The VirtualBox GINA module is implemented as a wrapper around
166 the standard Windows GINA module
167 (<computeroutput>MSGINA.DLL</computeroutput>). As a result, it will
168 most likely not work correctly with 3rd party GINA modules.</para>
169 </note>
170
171 <para>To manually install the VirtualBox credential module, extract the
172 Guest Additions (see <xref linkend="windows-guest-file-extraction" />)
173 and copy the file <computeroutput>VBoxCredProv.dll</computeroutput> to
174 the Windows <computeroutput>SYSTEM32</computeroutput> directory. Then,
175 in the registry, create the following keys:<screen>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
176 Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}
177
178HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}
179
180HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32</screen></para>
181
182 <para>with all default values (the key named
183 <computeroutput>(Default)</computeroutput> in each key) set to
184 <computeroutput>VBoxCredProv</computeroutput>. After that a new string
185 named <screen>HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32\ThreadingModel</screen>
186 with a value of <computeroutput>Apartment</computeroutput> has to be
187 created.</para>
188
189 <para>To set credentials, use the following command on a
190 <emphasis>running</emphasis> VM:</para>
191
192 <screen>VBoxManage controlvm "Windows XP" setcredentials "John Doe" "secretpassword" "DOMTEST"</screen>
193
194 <para>While the VM is running, the credentials can be queried by the
195 VirtualBox logon modules (GINA or credential provider) using the
196 VirtualBox Guest Additions device driver. When Windows is in "logged
197 out" mode, the logon modules will constantly poll for credentials and if
198 they are present, a logon will be attempted. After retrieving the
199 credentials, the logon modules will erase them so that the above command
200 will have to be repeated for subsequent logons.</para>
201
202 <para>For security reasons, credentials are not stored in any persistent
203 manner and will be lost when the VM is reset. Also, the credentials are
204 "write-only", i.e. there is no way to retrieve the credentials from the
205 host side. Credentials can be reset from the host side by setting empty
206 values.</para>
207
208 <para>Depending on the particular variant of the Windows guest, the
209 following restrictions apply: <orderedlist>
210 <listitem>
211 <para>For <emphasis role="bold">Windows XP guests,</emphasis> the
212 logon subsystem needs to be configured to use the classic logon
213 dialog as the VirtualBox GINA module does not support the XP-style
214 welcome dialog.</para>
215 </listitem>
216
217 <listitem>
218 <para>For <emphasis role="bold">Windows Vista and Windows 7
219 guests,</emphasis> the logon subsystem does not support the
220 so-called Secure Attention Sequence
221 (<computeroutput>CTRL+ALT+DEL</computeroutput>). As a result, the
222 guest's group policy settings need to be changed to not use the
223 Secure Attention Sequence. Also, the user name given is only
224 compared to the true user name, not the user friendly name. This
225 means that when you rename a user, you still have to supply the
226 original user name (internally, Windows never renames user
227 accounts).</para>
228 </listitem>
229 </orderedlist></para>
230
231 <para>The following command forces VirtualBox to keep the credentials
232 after they were read by the guest and on VM reset: <screen>VBoxManage setextradata "Windows XP" VBoxInternal/Devices/VMMDev/0/Config/KeepCredentials 1</screen>Note
233 that this is a potential security risk as a malicious application
234 running on the guest could request this information using the proper
235 interface.</para>
236 </sect2>
237
238 <sect2 id="autologon_unix">
239 <title>Automated Linux/Unix guest logons</title>
240
241 <para>Starting with version 3.2, VirtualBox provides a custom PAM module
242 (Pluggable Authentication Module) which can be used to perform automated
243 guest logons on platforms which support this framework. Virtually all
244 modern Linux/Unix distributions rely on PAM.</para>
245
246 <para>The <computeroutput>pam_vbox.so</computeroutput> module itself
247 <emphasis role="bold">does not</emphasis> do an actual verification of
248 the credentials passed to the guest OS; instead it relies on other
249 modules such as <computeroutput>pam_unix.so</computeroutput> or
250 <computeroutput>pam_unix2.so</computeroutput> down in the PAM stack to
251 do the actual validation using the credentials retrieved by
252 <computeroutput>pam_vbox.so</computeroutput>. Therefore
253 <computeroutput>pam_vbox.so</computeroutput> has to be on top of the
254 authentication PAM service list.</para>
255
256 <note>
257 <para>The <computeroutput>pam_vbox.so</computeroutput> only supports
258 the <computeroutput>auth</computeroutput> primitive. Other primitives
259 such as <computeroutput>account</computeroutput>,
260 <computeroutput>session</computeroutput> or
261 <computeroutput>password</computeroutput> are not supported.</para>
262 </note>
263
264 <para>The <computeroutput>pam_vbox.so</computeroutput> module is shipped
265 as part of the Guest Additions but it is not installed and/or activated
266 on the guest OS by default. In order to install it, it has to be copied
267 from
268 <computeroutput>/opt/VBoxGuestAdditions-&lt;version&gt;/lib/VBoxGuestAdditions/</computeroutput>
269 to the security modules directory, usually
270 <computeroutput>/lib/security/</computeroutput>. Please refer to your
271 guest OS documentation for the correct PAM module directory.</para>
272
273 <para>For example, to use <computeroutput>pam_vbox.so</computeroutput>
274 with a Ubuntu Linux guest OS and GDM (the GNOME Desktop Manager) to
275 logon users automatically with the credentials passed by the host, the
276 guest OS has to be configured like the following:</para>
277
278 <orderedlist>
279 <listitem>
280 <para>The <computeroutput>pam_vbox.so</computeroutput> module has to
281 be copied to the security modules directory, in this case it is
282 <computeroutput>/lib/security</computeroutput>.</para>
283 </listitem>
284
285 <listitem>
286 <para>Edit the PAM configuration file for GDM found at
287 <computeroutput>/etc/pam.d/gdm</computeroutput>, adding the line
288 <computeroutput>auth requisite pam_vbox.so</computeroutput> at the
289 top. Additionaly, in most Linux distributions there is a file called
290 <computeroutput>/etc/pam.d/common-auth</computeroutput>. This file
291 is included in many other services (like the GDM file mentioned
292 above). There you also have to add add the line <computeroutput>auth
293 requisite pam_vbox.so</computeroutput>.</para>
294 </listitem>
295
296 <listitem>
297 <para>If authentication against the shadow database using
298 <computeroutput>pam_unix.so</computeroutput> or
299 <computeroutput>pam_unix2.so</computeroutput> is desired, the
300 argument <computeroutput>try_first_pass</computeroutput> is needed
301 in order to pass the credentials from the VirtualBox module to the
302 shadow database authentication module. For Ubuntu, this needs to be
303 added to <computeroutput>/etc/pam.d/common-auth</computeroutput>, to
304 the end of the line referencing
305 <computeroutput>pam_unix.so</computeroutput>. This argument tells
306 the PAM module to use credentials already present in the stack, i.e.
307 the ones provided by the VirtualBox PAM module.</para>
308 </listitem>
309 </orderedlist>
310
311 <para><warning>
312 <para>An incorrectly configured PAM stack can effectively prevent
313 you from logging into your guest system!</para>
314 </warning></para>
315
316 <para>To make deployment easier, you can pass the argument
317 <computeroutput>debug</computeroutput> right after the
318 <computeroutput>pam_vbox.so</computeroutput> statement. Debug log output
319 will then be recorded using syslog.</para>
320
321 <para><warning>
322 <para>At present, the GDM display manager only retrieves credentials
323 at startup so unless the credentials have been supplied to the guest
324 before GDM starts, automatic logon will not work. This limitation
325 needs to be addressed by the GDM developers or another display
326 manager must be used.</para>
327 </warning></para>
328 </sect2>
329 </sect1>
330
331 <sect1>
332 <title>Advanced configuration for Windows guests</title>
333
334 <sect2 id="sysprep">
335 <title>Automated Windows system preparation</title>
336
337 <para>Beginning with Windows NT 4.0, Microsoft offers a "system
338 preparation" tool (in short: Sysprep) to prepare a Windows system for
339 deployment or redistribution. Whereas Windows 2000 and XP ship with
340 Sysprep on the installation medium, the tool also is available for
341 download on the Microsoft web site. In a standard installation of
342 Windows Vista and 7, Sysprep is already included. Sysprep mainly
343 consists of an executable called
344 <computeroutput>sysprep.exe</computeroutput> which is invoked by the
345 user to put the Windows installation into preparation mode.</para>
346
347 <para>Starting with VirtualBox 3.2.2, the Guest Additions offer a way to
348 launch a system preparation on the guest operating system in an
349 automated way, controlled from the host system. To achieve that, see
350 <xref linkend="guestadd-guestcontrol" /> for using the feature with the
351 special identifier <computeroutput>sysprep</computeroutput> as the
352 program to execute, along with the user name
353 <computeroutput>sysprep</computeroutput> and password
354 <computeroutput>sysprep</computeroutput> for the credentials. Sysprep
355 then gets launched with the required system rights.</para>
356
357 <note>
358 <para>Specifying the location of "sysprep.exe" is <emphasis
359 role="bold">not possible</emphasis> -- instead the following paths are
360 used (based on the operating system): <itemizedlist>
361 <listitem>
362 <para><computeroutput>C:\sysprep\sysprep.exe</computeroutput>
363 for Windows NT 4.0, 2000 and XP</para>
364 </listitem>
365
366 <listitem>
367 <para><computeroutput>%WINDIR%\System32\Sysprep\sysprep.exe</computeroutput>
368 for Windows Vista, 2008 Server and 7</para>
369 </listitem>
370 </itemizedlist> The Guest Additions will automatically use the
371 appropriate path to execute the system preparation tool.</para>
372 </note>
373 </sect2>
374 </sect1>
375
376 <sect1 id="cpuhotplug">
377 <title>CPU hot-plugging</title>
378
379 <para>With virtual machines running modern server operating systems,
380 VirtualBox supports CPU hot-plugging.<footnote>
381 <para>Support for CPU hot-plugging was introduced with VirtualBox
382 3.2.</para>
383 </footnote> Whereas on a physical computer this would mean that a CPU
384 can be added or removed while the machine is running, VirtualBox supports
385 adding and removing virtual CPUs while a virtual machine is
386 running.</para>
387
388 <para>CPU hot-plugging works only with guest operating systems that
389 support it. So far this applies only to Linux and Windows Server 2008 x64
390 Data Center Edition. Windows supports only hot-add while Linux supports
391 hot-add and hot-remove but to use this feature with more than 8 CPUs a
392 64bit Linux guest is required.</para>
393
394 <para>At this time, CPU hot-plugging requires using the VBoxManage
395 command-line interface. First, hot-plugging needs to be enabled for a
396 virtual machine:<screen>VBoxManage modifyvm "VM name" --cpuhotplug on</screen></para>
397
398 <para>After that, the --cpus option specifies the maximum number of CPUs
399 that the virtual machine can have:<screen>VBoxManage modifyvm "VM name" --cpus 8</screen>When
400 the VM is off, you can then add and remove virtual CPUs with the modifyvm
401 --plugcpu and --unplugcpu subcommands, which take the number of the
402 virtual CPU as a parameter, like this:<screen>VBoxManage modifyvm "VM name" --plugcpu 3
403VBoxManage modifyvm "VM name" --unplugcpu 3</screen>Note that CPU 0 can never
404 be removed.</para>
405
406 <para>While the VM is running, CPUs can be added with the
407 <computeroutput>controlvm plugcpu/unplugcpu</computeroutput> commands
408 instead:<screen>VBoxManage controlvm "VM name" plugcpu 3
409VBoxManage controlvm "VM name" unplugcpu 3</screen></para>
410
411 <para>See <xref linkend="vboxmanage-modifyvm" /> and <xref
412 linkend="vboxmanage-controlvm" /> for details.</para>
413
414 <para>With Linux guests, the following applies: To prevent ejection while
415 the CPU is still used it has to be ejected from within the guest before.
416 The Linux Guest Additions contain a service which receives hot-remove
417 events and ejects the CPU. Also, after a CPU is added to the VM it is not
418 automatically used by Linux. The Linux Guest Additions service will take
419 care of that if installed. If not a CPU can be started with the following
420 command:<screen>echo 1 &gt; /sys/devices/system/cpu/cpu&lt;id&gt;/online</screen></para>
421 </sect1>
422
423 <sect1>
424 <title>Advanced display configuration</title>
425
426 <sect2>
427 <title>Custom VESA resolutions</title>
428
429 <para>Apart from the standard VESA resolutions, the VirtualBox VESA BIOS
430 allows you to add up to 16 custom video modes which will be reported to
431 the guest operating system. When using Windows guests with the
432 VirtualBox Guest Additions, a custom graphics driver will be used
433 instead of the fallback VESA solution so this information does not
434 apply.</para>
435
436 <para>Additional video modes can be configured for each VM using the
437 extra data facility. The extra data key is called
438 <literal>CustomVideoMode&lt;x&gt;</literal> with <literal>x</literal>
439 being a number from 1 to 16. Please note that modes will be read from 1
440 until either the following number is not defined or 16 is reached. The
441 following example adds a video mode that corresponds to the native
442 display resolution of many notebook computers:</para>
443
444 <screen>VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16"</screen>
445
446 <para>The VESA mode IDs for custom video modes start at
447 <literal>0x160</literal>. In order to use the above defined custom video
448 mode, the following command line has be supplied to Linux:</para>
449
450 <screen>vga = 0x200 | 0x160
451vga = 864</screen>
452
453 <para>For guest operating systems with VirtualBox Guest Additions, a
454 custom video mode can be set using the video mode hint feature.</para>
455 </sect2>
456
457 <sect2>
458 <title>Configuring the maximum resolution of guests when using the
459 graphical frontend</title>
460
461 <para>When guest systems with the Guest Additions installed are started
462 using the graphical frontend (the normal VirtualBox application), they
463 will not be allowed to use screen resolutions greater than the host's
464 screen size unless the user manually resizes them by dragging the
465 window, switching to fullscreen or seamless mode or sending a video mode
466 hint using VBoxManage. This behavior is what most users will want, but
467 if you have different needs, it is possible to change it by issuing one
468 of the following commands from the command line:</para>
469
470 <screen>VBoxManage setextradata global GUI/MaxGuestResolution any</screen>
471
472 <para>will remove all limits on guest resolutions.</para>
473
474 <screen>VBoxManage setextradata global GUI/MaxGuestResolution &gt;width,height&lt;</screen>
475
476 <para>manually specifies a maximum resolution.</para>
477
478 <screen>VBoxManage setextradata global GUI/MaxGuestResolution auto</screen>
479
480 <para>restores the default settings. Note that these settings apply
481 globally to all guest systems, not just to a single machine.</para>
482 </sect2>
483
484 </sect1>
485
486 <sect1>
487 <title>Advanced storage configuration</title>
488
489 <sect2 id="rawdisk">
490 <title>Using a raw host hard disk from a guest</title>
491
492 <para>Starting with version 1.4, as an alternative to using virtual disk
493 images (as described in detail in <xref linkend="storage" />),
494 VirtualBox can also present either entire physical hard disks or
495 selected partitions thereof as virtual disks to virtual machines.</para>
496
497 <para>With VirtualBox, this type of access is called "raw hard disk
498 access"; it allows a guest operating system to access its virtual hard
499 disk without going through the host OS file system. The actual
500 performance difference for image files vs. raw disk varies greatly
501 depending on the overhead of the host file system, whether dynamically
502 growing images are used and on host OS caching strategies. The caching
503 indirectly also affects other aspects such as failure behavior, i.e.
504 whether the virtual disk contains all data written before a host OS
505 crash. Consult your host OS documentation for details on this.</para>
506
507 <para><warning>
508 <para>Raw hard disk access is for expert users only. Incorrect use
509 or use of an outdated configuration can lead to <emphasis
510 role="bold">total loss of data </emphasis>on the physical disk. Most
511 importantly, <emphasis>do not</emphasis> attempt to boot the
512 partition with the currently running host operating system in a
513 guest. This will lead to severe data corruption.</para>
514 </warning></para>
515
516 <para>Raw hard disk access -- both for entire disks and individual
517 partitions -- is implemented as part of the VMDK image format support.
518 As a result, you will need to create a special VMDK image file which
519 defines where the data will be stored. After creating such a special
520 VMDK image, you can use it like a regular virtual disk image. For
521 example, you can use the Virtual Media Manager (<xref linkend="vdis" />)
522 or <computeroutput>VBoxManage</computeroutput> to assign the image to a
523 virtual machine.</para>
524
525 <sect3>
526 <title>Access to entire physical hard disk</title>
527
528 <para>While this variant is the simplest to set up, you must be aware
529 that this will give a guest operating system direct and full access to
530 an <emphasis>entire physical disk</emphasis>. If your
531 <emphasis>host</emphasis> operating system is also booted from this
532 disk, please take special care to not access the partition from the
533 guest at all. On the positive side, the physical disk can be
534 repartitioned in arbitrary ways without having to recreate the image
535 file that gives access to the raw disk.</para>
536
537 <para>To create an image that represents an entire physical hard disk
538 (which will not contain any actual data, as this will all be stored on
539 the physical disk), on a Linux host, use the command<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
540 -rawdisk /dev/sda</screen>This creates the image
541 <code>/path/to/file.vmdk</code> (must be absolute), and all data will
542 be read and written from <code>/dev/sda</code>.</para>
543
544 <para>On a Windows host, instead of the above device specification,
545 use e.g. <code>\\.\PhysicalDrive0</code>. On a Mac OS X host, instead
546 of the above device specification use e.g. <code>/dev/disk1</code>.
547 Note that on OS X you can only get access to an entire disk if no
548 volume is mounted from it.</para>
549
550 <para>Creating the image requires read/write access for the given
551 device. Read/write access is also later needed when using the image
552 from a virtual machine.</para>
553
554 <para>Just like with regular disk images, this does not automatically
555 register the newly created image in the internal registry of hard
556 disks. If you want this done automatically, add
557 <code>-register</code>: <screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
558 -rawdisk /dev/sda -register</screen>After registering, you can assign
559 the newly created image to a virtual machine with e.g. <screen>VBoxManage storageattach WindowsXP --storagectl "IDE Controller"
560 --port 0 --device 0 --type hdd --medium /path/to/file.vmdk</screen>When
561 this is done the selected virtual machine will boot from the specified
562 physical disk.</para>
563 </sect3>
564
565 <sect3>
566 <title>Access to individual physical hard disk partitions</title>
567
568 <para>This "raw partition support" is quite similar to the "full hard
569 disk" access described above. However, in this case, any partitioning
570 information will be stored inside the VMDK image, so you can e.g.
571 install a different boot loader in the virtual hard disk without
572 affecting the host's partitioning information. While the guest will be
573 able to <emphasis>see</emphasis> all partitions that exist on the
574 physical disk, access will be filtered in that reading from partitions
575 for which no access is allowed the partitions will only yield zeroes,
576 and all writes to them are ignored.</para>
577
578 <para>To create a special image for raw partition support (which will
579 contain a small amount of data, as already mentioned), on a Linux
580 host, use the command<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
581 -rawdisk /dev/sda -partitions 1,5</screen></para>
582
583 <para>As you can see, the command is identical to the one for "full
584 hard disk" access, except for the additional
585 <computeroutput>-partitions</computeroutput> parameter. This example
586 would create the image <code>/path/to/file.vmdk</code> (which, again,
587 must be absolute), and partitions 1 and 5 of <code>/dev/sda</code>
588 would be made accessible to the guest.</para>
589
590 <para>VirtualBox uses the same partition numbering as your Linux host.
591 As a result, the numbers given in the above example would refer to the
592 first primary partition and the first logical drive in the extended
593 partition, respectively.</para>
594
595 <para>On a Windows host, instead of the above device specification,
596 use e.g. <code>\\.\PhysicalDrive0</code>. On a Mac OS X host, instead
597 of the above device specification use e.g. <code>/dev/disk1</code>.
598 Note that on OS X you can only use partitions which are not mounted
599 (eject the respective volume first). Partition numbers are the same on
600 Linux, Windows and Mac OS X hosts.</para>
601
602 <para>The numbers for the list of partitions can be taken from the
603 output of<screen>VBoxManage internalcommands listpartitions -rawdisk /dev/sda</screen>The
604 output lists the partition types and sizes to give the user enough
605 information to identify the partitions necessary for the guest.</para>
606
607 <para>Images which give access to individual partitions are specific
608 to a particular host disk setup. You cannot transfer these images to
609 another host; also, whenever the host partitioning changes, the image
610 <emphasis>must be recreated</emphasis>.</para>
611
612 <para>Creating the image requires read/write access for the given
613 device. Read/write access is also later needed when using the image
614 from a virtual machine. If this is not feasible, there is a special
615 variant for raw partition access (currently only available on Linux
616 hosts) that avoids having to give the current user access to the
617 entire disk. To set up such an image, use<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
618 -rawdisk /dev/sda -partitions 1,5 -relative</screen>When used from a
619 virtual machine, the image will then refer not to the entire disk, but
620 only to the individual partitions (in the example
621 <code>/dev/sda1</code> and <code>/dev/sda5</code>). As a consequence,
622 read/write access is only required for the affected partitions, not
623 for the entire disk. During creation however, read-only access to the
624 entire disk is required to obtain the partitioning information.</para>
625
626 <para>In some configurations it may be necessary to change the MBR
627 code of the created image, e.g. to replace the Linux boot loader that
628 is used on the host by another boot loader. This allows e.g. the guest
629 to boot directly to Windows, while the host boots Linux from the
630 "same" disk. For this purpose the
631 <computeroutput>-mbr</computeroutput> parameter is provided. It
632 specifies a file name from which to take the MBR code. The partition
633 table is not modified at all, so a MBR file from a system with totally
634 different partitioning can be used. An example of this is<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
635 -rawdisk /dev/sda -partitions 1,5 -mbr winxp.mbr</screen>The modified
636 MBR will be stored inside the image, not on the host disk.</para>
637
638 <para>For each of the above variants, you can register the resulting
639 image for immediate use in VirtualBox by adding
640 <computeroutput>-register</computeroutput> to the respective command
641 line. The image will then immediately appear in the list of registered
642 disk images. An example is<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
643 -rawdisk /dev/sda -partitions 1,5 -relative -register</screen> which
644 creates an image referring to individual partitions, and registers it
645 when the image is successfully created.</para>
646 </sect3>
647 </sect2>
648
649 <sect2 id="changevpd">
650 <title>Configuring the hard disk vendor product data (VPD)</title>
651
652 <para>VirtualBox reports vendor product data for its virtual hard disks
653 which consist of hard disk serial number, firmware revision and model
654 number. These can be changed using the following commands:</para>
655
656 <screen>VBoxManage setextradata "VM name"
657 "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "serial"
658VBoxManage setextradata "VM name"
659 "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "firmware"
660VBoxManage setextradata "VM name"
661 "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "model"</screen>
662
663 <para>The serial number is a 20 byte alphanumeric string, the firmware
664 revision an 8 byte alphanumeric string and the model number a 40 byte
665 alphanumeric string. Instead of "Port0" (referring to the first port),
666 specify the desired SATA hard disk port.</para>
667
668 <para>Additional three parameters are needed for CD/DVD drives to report
669 the vendor product data:</para>
670
671 <screen>VBoxManage setextradata "VM name"
672 "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIVendorId" "vendor"
673VBoxManage setextradata "VM name"
674 "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIProductId" "product"
675VBoxManage setextradata "VM name"
676 "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIRevision" "revision"</screen>
677
678 <para>The vendor id is an 8 byte alphanumeric string, the product id an
679 16 byte alphanumeric string and the revision a 4 byte alphanumeric
680 string. Instead of "Port0" (referring to the first port), specify the
681 desired SATA hard disk port.</para>
682 </sect2>
683
684 <sect2>
685 <title id="iscsi-intnet">Access iSCSI targets via Internal
686 Networking</title>
687
688 <para>As an experimental feature, VirtualBox allows for accessing an
689 iSCSI target running in a virtual machine which is configured for using
690 Internal Networking mode. Please see <xref linkend="storage-iscsi" />;
691 <xref linkend="network_internal" />; and <xref
692 linkend="vboxmanage-storageattach" /> for additional information.</para>
693
694 <para>The IP stack accessing Internal Networking must be configured in
695 the virtual machine which accesses the iSCSI target. A free static IP
696 and a MAC address not used by other virtual machines must be chosen. In
697 the example below, adapt the name of the virtual machine, the MAC
698 address, the IP configuration and the Internal Networking name
699 ("MyIntNet") according to your needs. The following seven commands must
700 first be issued:<screen>VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Trusted 1
701VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Config/MAC 08:00:27:01:02:0f
702VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Config/IP 10.0.9.1
703VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Config/Netmask 255.255.255.0
704VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/LUN#0/Driver IntNet
705VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/LUN#0/Config/Network MyIntNet
706VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/LUN#0/Config/IsService 1</screen></para>
707
708 <para>Finally the iSCSI disk must be attached with the
709 <computeroutput>--intnet</computeroutput> option to tell the iSCSI
710 initiator to use internal networking:<screen>VBoxManage storageattach ... --medium iscsi
711 --server 10.0.9.30 --target iqn.2008-12.com.sun:sampletarget --intnet</screen></para>
712
713 <para>Compared to a "regular" iSCSI setup, IP address of the target
714 <emphasis>must</emphasis> be specified as a numeric IP address, as there
715 is no DNS resolver for internal networking.</para>
716
717 <para>The virtual machine with the iSCSI target should be started before
718 the VM using it is powered on. If a virtual machine using an iSCSI disk
719 is started without having the iSCSI target powered up, it can take up to
720 200 seconds to detect this situation. The VM will fail to power
721 up.</para>
722 </sect2>
723 </sect1>
724
725 <sect1>
726 <title>Launching more than 120 VMs on Solaris hosts</title>
727
728 <para>Solaris hosts have a fixed number of IPC semaphores IDs per process
729 preventing users from starting more than 120 VMs. While trying to launch
730 more VMs you would be shown a "Cannot create IPC semaphore" error.</para>
731
732 <para>In order to run more VMs, you will need to bump the semaphore ID
733 limit of the VBoxSVC process. Execute as root the
734 <computeroutput>prctl</computeroutput> command as shown below. The process
735 ID of VBoxSVC can be obtained using the
736 <computeroutput>ps</computeroutput> list command.</para>
737
738 <para><screen>prctl -r -n project.max-sem-ids -v 2048 &lt;pid-of-VBoxSVC&gt;</screen></para>
739 </sect1>
740
741 <sect1>
742 <title>Legacy commands for using serial ports</title>
743
744 <para>Starting with version 1.4, VirtualBox provided support for virtual
745 serial ports, which, at the time, was rather complicated to set up with a
746 sequence of <computeroutput>VBoxManage setextradata</computeroutput>
747 statements. Since version 1.5, that way of setting up serial ports is no
748 longer necessary and <emphasis>deprecated.</emphasis> To set up virtual
749 serial ports, use the methods now described in <xref
750 linkend="serialports" />.<note>
751 <para>For backwards compatibility, the old
752 <computeroutput>setextradata</computeroutput> statements, whose
753 description is retained below from the old version of the manual, take
754 <emphasis>precedence</emphasis> over the new way of configuring serial
755 ports. As a result, if configuring serial ports the new way doesn't
756 work, make sure the VM in question does not have old configuration
757 data such as below still active.</para>
758 </note></para>
759
760 <para>The old sequence of configuring a serial port used the following 6
761 commands:</para>
762
763 <screen>VBoxManage setextradata "VM name"
764 "VBoxInternal/Devices/serial/0/Config/IRQ" 4
765VBoxManage setextradata "VM name"
766 "VBoxInternal/Devices/serial/0/Config/IOBase" 0x3f8
767VBoxManage setextradata "VM name"
768 "VBoxInternal/Devices/serial/0/LUN#0/Driver" Char
769VBoxManage setextradata "VM name"
770 "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Driver" NamedPipe
771VBoxManage setextradata "VM name"
772 "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Config/Location" "\\.\pipe\vboxCOM1"
773VBoxManage setextradata "VM name"
774 "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Config/IsServer" 1</screen>
775
776 <para>This sets up a serial port in the guest with the default settings
777 for COM1 (IRQ 4, I/O address 0x3f8) and the
778 <computeroutput>Location</computeroutput> setting assumes that this
779 configuration is used on a Windows host, because the Windows named pipe
780 syntax is used. Keep in mind that on Windows hosts a named pipe must
781 always start with <computeroutput>\\.\pipe\</computeroutput>. On Linux the
782 same config settings apply, except that the path name for the
783 <computeroutput>Location</computeroutput> can be chosen more freely. Local
784 domain sockets can be placed anywhere, provided the user running
785 VirtualBox has the permission to create a new file in the directory. The
786 final command above defines that VirtualBox acts as a server, i.e. it
787 creates the named pipe itself instead of connecting to an already existing
788 one.</para>
789 </sect1>
790
791 <sect1 id="changenat">
792 <title>Fine-tuning the VirtualBox NAT engine</title>
793
794 <sect2>
795 <title>Configuring the address of a NAT network interface</title>
796
797 <para>In NAT mode, the guest network interface is assigned to the IPv4
798 range <computeroutput>10.0.x.0/24</computeroutput> by default where
799 <computeroutput>x</computeroutput> corresponds to the instance of the
800 NAT interface +2. So <computeroutput>x</computeroutput> is 2 when there
801 is only one NAT instance active. In that case the guest is assigned to
802 the address <computeroutput>10.0.2.15</computeroutput>, the gateway is
803 set to <computeroutput>10.0.2.2</computeroutput> and the name server can
804 be found at <computeroutput>10.0.2.3</computeroutput>.</para>
805
806 <para>If, for any reason, the NAT network needs to be changed, this can
807 be achieved with the following command:</para>
808
809 <screen>VBoxManage modifyvm "VM name" --natnet1 "192.168/16"</screen>
810
811 <para>This command would reserve the network addresses from
812 <computeroutput>192.168.0.0</computeroutput> to
813 <computeroutput>192.168.254.254</computeroutput> for the first NAT
814 network instance of "VM name". The guest IP would be assigned to
815 <computeroutput>192.168.0.15</computeroutput> and the default gateway
816 could be found at <computeroutput>192.168.0.2</computeroutput>.</para>
817 </sect2>
818
819 <sect2 id="nat-adv-tftp">
820 <title>Configuring the boot server (next server) of a NAT network
821 interface</title>
822
823 <para>For network booting in NAT mode, by default VirtualBox uses a
824 built-in TFTP server at the IP address 10.0.2.3. This default behavior
825 should work fine for typical remote-booting scenarios. However, it is
826 possible to change the boot server IP and the location of the boot image
827 with the following commands: <screen>VBoxManage modifyvm "VM name" --nattftpserver1 10.0.2.2
828VBoxManage modifyvm "VM name" --nattftpfile1 /srv/tftp/boot/MyPXEBoot.pxe</screen></para>
829 </sect2>
830
831 <sect2 id="nat-adv-settings">
832 <title>Tuning TCP/IP buffers for NAT</title>
833
834 <para>The VirtualBox NAT stack performance is often determined by its
835 interaction with the host's TCP/IP stack and the size of several buffers
836 (<computeroutput>SO_RCVBUF</computeroutput> and
837 <computeroutput>SO_SNDBUF</computeroutput>). For certain setups users
838 might want to adjust the buffer size for a better performance. This can
839 by achieved using the following commands (values are in kilobytes and
840 can range from 8 to 1024): <screen>VBoxManage modifyvm "VM name" --natsettings1 16000,128,128,0,0</screen>
841 This example illustrates tuning the NAT settings. The first parameter is
842 the MTU, then the size of the socket's send buffer and the size of the
843 socket's receive buffer, the initial size of the TCP send window, and
844 lastly the initial size of the TCP receive window. Note that specifying
845 zero means fallback to the default value.</para>
846
847 <para>Each of these buffers has a default size of 64KB and default MTU
848 is 1500.</para>
849 </sect2>
850
851 <sect2>
852 <title>Binding NAT sockets to a specific interface</title>
853
854 <para>By default, VirtualBox's NAT engine will route TCP/IP packets
855 through the default interface assigned by the host's TCP/IP stack. (The
856 technical reason for this is that the NAT engine uses sockets for
857 communication.) If, for some reason, you want to change this behavior,
858 you can tell the NAT engine to bind to a particular IP address instead.
859 Use the following command: <screen>VBoxManage modifyvm "VM name" --natbindip1 "10.45.0.2"</screen></para>
860
861 <para>After this, all outgoing traffic will be sent through the
862 interface with the IP address 10.45.0.2. Please make sure that this
863 interface is up and running prior to this assignment.</para>
864 </sect2>
865
866 <sect2 id="nat-adv-dns">
867 <title>Enabling DNS proxy in NAT mode</title>
868
869 <para>The NAT engine by default offers the same DNS servers to the guest
870 that are configured on the host. In some scenarios, it can be desirable
871 to hide the DNS server IPs from the guest, for example when this
872 information can change on the host due to expiring DHCP leases. In this
873 case, you can tell the NAT engine to act as DNS proxy using the
874 following command: <screen>VBoxManage modifyvm "VM name" --natdnsproxy1 on</screen></para>
875 </sect2>
876
877 <sect2 id="nat_host_resolver_proxy">
878 <title>Using the host's resolver as a DNS proxy in NAT mode</title>
879
880 <para>For resolving network names, the DHCP server of the NAT engine
881 offers a list of registered DNS servers of the host. If for some reason
882 you need to hide this DNS server list and use the host's resolver
883 settings, thereby forcing the VirtualBox NAT engine to intercept DNS
884 requests and forward them to host's resolver, use the following command:
885 <screen>VBoxManage modifyvm "VM name" --natdnshostresolver1 on</screen>
886 Note that this setting is similar to the DNS proxy mode, however whereas
887 the proxy mode just forwards DNS requests to the appropriate servers,
888 the resolver mode will interpret the DNS requests and use the host's DNS
889 API to query the information and return it to the guest.</para>
890 </sect2>
891
892 <sect2 id="nat-adv-alias">
893 <title>Configuring aliasing of the NAT engine</title>
894
895 <para>By default, the NAT core uses aliasing and uses random ports when
896 generating an alias for a connection. This works well for the most
897 protocols like SSH, FTP and so on. Though some protocols might need a
898 more transparent behavior or may depend on the real port number the
899 packet was sent from. It is possible to change the NAT mode via the
900 VBoxManage frontend with the following commands: <screen>VBoxManage modifyvm "VM name" --nataliasmode proxyonly</screen>
901 and <screen>VBoxManage modifyvm "Linux Guest" --nataliasmode sameports</screen>
902 The first example disables aliasing and switches NAT into transparent
903 mode, the second example enforces preserving of port values. These modes
904 can be combined if necessary.</para>
905 </sect2>
906 </sect1>
907
908 <sect1 id="changedmi">
909 <title>Configuring the BIOS DMI information</title>
910
911 <para>The DMI data VirtualBox provides to guests can be changed for a
912 specific VM. Use the following commands to configure the DMI BIOS
913 information:</para>
914
915 <screen>VBoxManage setextradata "VM name"
916 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "BIOS Vendor"
917VBoxManage setextradata "VM name"
918 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "BIOS Version"
919VBoxManage setextradata "VM name"
920 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "BIOS Release Date"
921VBoxManage setextradata "VM name"
922 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMajor" 1
923VBoxManage setextradata "VM name"
924 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMinor" 2
925VBoxManage setextradata "VM name"
926 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMajor" 3
927VBoxManage setextradata "VM name"
928 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMinor" 4
929VBoxManage setextradata "VM name"
930 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "System Vendor"
931VBoxManage setextradata "VM name"
932 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "System Product"
933VBoxManage setextradata "VM name"
934 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "System Version"
935VBoxManage setextradata "VM name"
936 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "System Serial"
937VBoxManage setextradata "VM name"
938 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSKU" "System SKU"
939VBoxManage setextradata "VM name"
940 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily" "System Family"
941VBoxManage setextradata "VM name"
942 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid"
943 "9852bf98-b83c-49db-a8de-182c42c7226b"</screen>
944
945 <para>If a DMI string is not set, the default value of VirtualBox is used.
946 To set an empty string use
947 <computeroutput>"&lt;EMPTY&gt;"</computeroutput>.</para>
948
949 <para>Note that in the above list, all quoted parameters (DmiBIOSVendor,
950 DmiBIOSVersion but not DmiBIOSReleaseMajor) are expected to be strings. If
951 such a string is a valid number, the parameter is treated as number and
952 the VM will most probably refuse to start with an
953 <computeroutput>VERR_CFGM_NOT_STRING</computeroutput> error. In that case,
954 use <computeroutput>"string:&lt;value&gt;"</computeroutput>, for instance
955 <screen>VBoxManage setextradata "VM name"
956 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "string:1234"</screen></para>
957
958 <para>Changing this information can be necessary to provide the DMI
959 information of the host to the guest to prevent Windows from asking for a
960 new product key. On Linux hosts the DMI BIOS information can be obtained
961 with <screen>dmidecode -t0</screen>and the DMI system information can be
962 obtained with <screen>dmidecode -t1</screen></para>
963 </sect1>
964
965 <sect1>
966 <title>Fine-tuning timers and time synchronization</title>
967
968 <sect2 id="changetscmode">
969 <title>Configuring the guest time stamp counter (TSC) to reflect guest
970 execution</title>
971
972 <para>By default, VirtualBox keeps all sources of time visible to the
973 guest synchronized to a single time source, the monotonic host time.
974 This reflects the assumptions of many guest operating systems, which
975 expect all time sources to reflect "wall clock" time. In special
976 circumstances it may be useful however to make the TSC (time stamp
977 counter) in the guest reflect the time actually spent executing the
978 guest.</para>
979
980 <para>This special TSC handling mode can be enabled on a per-VM basis,
981 and for best results must be used only in combination with hardware
982 virtualization. To enable this mode use the following command:</para>
983
984 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/TSCTiedToExecution" 1</screen>
985
986 <para>To revert to the default TSC handling mode use:</para>
987
988 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/TSCTiedToExecution"</screen>
989
990 <para>Note that if you use the special TSC handling mode with a guest
991 operating system which is very strict about the consistency of time
992 sources you may get a warning or error message about the timing
993 inconsistency. It may also cause clocks to become unreliable with some
994 guest operating systems depending on they use the TSC.</para>
995 </sect2>
996
997 <sect2 id="warpguest">
998 <title>Accelerate or slow down the guest clock</title>
999
1000 <para>For certain purposes it can be useful to accelerate or to slow
1001 down the (virtual) guest clock. This can be achieved as follows:</para>
1002
1003 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 200</screen>
1004
1005 <para>The above example will double the speed of the guest clock
1006 while</para>
1007
1008 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 50</screen>
1009
1010 <para>will halve the speed of the guest clock. Note that changing the
1011 rate of the virtual clock can confuse the guest and can even lead to
1012 abnormal guest behavior. For instance, a higher clock rate means shorter
1013 timeouts for virtual devices with the result that a slightly increased
1014 response time of a virtual device due to an increased host load can
1015 cause guest failures. Note further that any time synchronization
1016 mechanism will frequently try to resynchronize the guest clock with the
1017 reference clock (which is the host clock if the VirtualBox Guest
1018 Additions are active). Therefore any time synchronization should be
1019 disabled if the rate of the guest clock is changed as described above
1020 (see <xref linkend="changetimesync" />).</para>
1021 </sect2>
1022
1023 <sect2 id="changetimesync">
1024 <title>Tuning the Guest Additions time synchronization
1025 parameters</title>
1026
1027 <para>The VirtualBox Guest Additions ensure that the guest's system time
1028 is synchronized with the host time. There are several parameters which
1029 can be tuned. The parameters can be set for a specific VM using the
1030 following command:</para>
1031
1032 <screen>VBoxManage guestproperty set VM_NAME "/VirtualBox/GuestAdd/VBoxService/PARAMETER" VALUE</screen>
1033
1034 <para>where <computeroutput>PARAMETER</computeroutput> is one of the
1035 following:</para>
1036
1037 <para><glosslist>
1038 <glossentry>
1039 <glossterm><computeroutput>--timesync-interval</computeroutput></glossterm>
1040
1041 <glossdef>
1042 <para>Specifies the interval at which to synchronize the time
1043 with the host. The default is 10000 ms (10 seconds).</para>
1044 </glossdef>
1045 </glossentry>
1046
1047 <glossentry>
1048 <glossterm><computeroutput>--timesync-min-adjust</computeroutput></glossterm>
1049
1050 <glossdef>
1051 <para>The minimum absolute drift value measured in milliseconds
1052 to make adjustments for. The default is 1000 ms on OS/2 and 100
1053 ms elsewhere.</para>
1054 </glossdef>
1055 </glossentry>
1056
1057 <glossentry>
1058 <glossterm><computeroutput>--timesync-latency-factor</computeroutput></glossterm>
1059
1060 <glossdef>
1061 <para>The factor to multiply the time query latency with to
1062 calculate the dynamic minimum adjust time. The default is 8
1063 times, that means in detail: Measure the time it takes to
1064 determine the host time (the guest has to contact the VM host
1065 service which may take some time), multiply this value by 8 and
1066 do an adjustment only if the time difference between host and
1067 guest is bigger than this value. Don't do any time adjustment
1068 otherwise.</para>
1069 </glossdef>
1070 </glossentry>
1071
1072 <glossentry>
1073 <glossterm><computeroutput>--timesync-max-latency</computeroutput></glossterm>
1074
1075 <glossdef>
1076 <para>The max host timer query latency to accept. The default is
1077 250 ms.</para>
1078 </glossdef>
1079 </glossentry>
1080
1081 <glossentry>
1082 <glossterm><computeroutput>--timesync-set-threshold</computeroutput></glossterm>
1083
1084 <glossdef>
1085 <para>The absolute drift threshold, given as milliseconds where
1086 to start setting the time instead of trying to smoothly adjust
1087 it. The default is 20 minutes.</para>
1088 </glossdef>
1089 </glossentry>
1090
1091 <glossentry>
1092 <glossterm><computeroutput>--timesync-set-start</computeroutput></glossterm>
1093
1094 <glossdef>
1095 <para>Set the time when starting the time sync service.</para>
1096 </glossdef>
1097 </glossentry>
1098
1099 <glossentry>
1100 <glossterm><computeroutput>--timesync-set-on-restore
1101 0|1</computeroutput></glossterm>
1102
1103 <glossdef>
1104 <para>Set the time after the VM was restored from a saved state
1105 when passing 1 as parameter (default). Disable by passing 0. In
1106 the latter case, the time will be adjusted smoothly which can
1107 take a long time.</para>
1108 </glossdef>
1109 </glossentry>
1110 </glosslist></para>
1111
1112 <para>All these parameters can be specified as command line parameters
1113 to VBoxService as well.</para>
1114 </sect2>
1115 </sect1>
1116
1117 <sect1 id="addhostonlysolaris">
1118 <title>Configuring multiple host-only network interfaces on Solaris
1119 hosts</title>
1120
1121 <para>By default VirtualBox provides you with one host-only network
1122 interface. Adding more host-only network interfaces on Solaris hosts
1123 requires manual configuration. Here's how to add two more host-only
1124 network interfaces.</para>
1125
1126 <para>You first need to stop all running VMs and unplumb all existing
1127 "vboxnet" interfaces. Execute the following commands as root:</para>
1128
1129 <screen>ifconfig vboxnet0 unplumb</screen>
1130
1131 <para>Once you make sure all vboxnet interfaces are unplumbed, remove the
1132 driver using:</para>
1133
1134 <para><screen>rem_drv vboxnet</screen>then edit the file
1135 <computeroutput>/platform/i86pc/kernel/drv/vboxnet.conf</computeroutput>
1136 and add a line for the new interfaces:</para>
1137
1138 <para><screen>name="vboxnet" parent="pseudo" instance=1;
1139name="vboxnet" parent="pseudo" instance=2;</screen>Add as many of these lines
1140 as required and make sure "instance" number is uniquely incremented. Next
1141 reload the vboxnet driver using:</para>
1142
1143 <para><screen>add_drv vboxnet</screen>Now plumb all the interfaces using
1144 <computeroutput>ifconfig vboxnetX plumb</computeroutput> (where X can be
1145 0, 1 or 2 in this case) and once plumbed you can then configure the
1146 interface like any other network interface.</para>
1147
1148 <para>To make your newly added interfaces' settings persistent across
1149 reboots you will need to edit the files
1150 <computeroutput>/etc/netmasks</computeroutput>, and if you are using NWAM
1151 <computeroutput>/etc/nwam/llp</computeroutput> and add the appropriate
1152 entries to set the netmask and static IP for each of those interfaces. The
1153 VirtualBox installer only updates these configuration files for the one
1154 "vboxnet0" interface it creates by default.</para>
1155 </sect1>
1156
1157 <sect1 id="solariscodedumper">
1158 <title>Configuring the VirtualBox CoreDumper on Solaris hosts</title>
1159
1160 <para>VirtualBox is capable of producing its own core files when things go
1161 wrong and for more extensive debugging. Currently this is only available
1162 on Solaris hosts.</para>
1163
1164 <para>The VirtualBox CoreDumper can be enabled using the following
1165 command:</para>
1166
1167 <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpEnabled 1</screen></para>
1168
1169 <para>You can specify which directory to use for core dumps with this
1170 command:</para>
1171
1172 <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpDir &lt;path-to-directory&gt;</screen>Make
1173 sure the directory you specify is on a volume with sufficient free space
1174 and that the VirtualBox process has sufficient permissions to write files
1175 to this directory. If you skip this command and don't specify any core
1176 dump directory, the current directory of the VirtualBox executable will be
1177 used (which would most likely fail when writing cores as they are
1178 protected with root permissions). It is recommended you explicity set a
1179 core dump directory.</para>
1180
1181 <para>You must specify when the VirtualBox CoreDumper should be triggered.
1182 This is done using the following commands:</para>
1183
1184 <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpReplaceSystemDump 1
1185VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpLive 1</screen>At
1186 least one of the above two commands will have to be provided if you have
1187 enabled the VirtualBox CoreDumper.</para>
1188
1189 <para>Setting <computeroutput>CoreDumpReplaceSystemDump</computeroutput>
1190 sets up the VM to override the host's core dumping mechanism and in the
1191 event of any crash only the VirtualBox CoreDumper would produce the core
1192 file.</para>
1193
1194 <para>Setting <computeroutput>CoreDumpLive</computeroutput> sets up the VM
1195 to produce cores whenever the VM receives a
1196 <computeroutput>SIGUSR2</computeroutput> signal. After producing the core
1197 file, the VM will not be terminated and will continue to run. You can then
1198 take cores of the VM process using:</para>
1199
1200 <para><screen>kill -s SIGUSR2 &lt;VM-process-id&gt;</screen></para>
1201
1202 <para>Core files produced by the VirtualBox CoreDumper are of the form
1203 <computeroutput>core.vb.&lt;ProcessName&gt;.&lt;ProcessID&gt;</computeroutput>,
1204 e.g.<computeroutput>core.vb.VBoxHeadless.11321</computeroutput>.</para>
1205 </sect1>
1206
1207 <sect1 id="guitweaks">
1208 <title>Locking down the VirtualBox manager GUI</title>
1209
1210 <para>There are several advanced customization settings for locking down
1211 the VirtualBox manager, that is, removing some features that the user
1212 should not see.<screen>VBoxManage setextradata global GUI/Customizations OPTION[,OPTION...]</screen></para>
1213
1214 <para>where <computeroutput>OPTION</computeroutput> is one of the
1215 following keywords:<glosslist>
1216 <glossentry>
1217 <glossterm><computeroutput>noSelector</computeroutput></glossterm>
1218
1219 <glossdef>
1220 <para>Don't allow to start the VirtualBox manager. Trying to do so
1221 will show a window containing a proper error message.</para>
1222 </glossdef>
1223 </glossentry>
1224
1225 <glossentry>
1226 <glossterm><computeroutput>noMenuBar</computeroutput></glossterm>
1227
1228 <glossdef>
1229 <para>VM windows will not contain a menu bar.</para>
1230 </glossdef>
1231 </glossentry>
1232
1233 <glossentry>
1234 <glossterm><computeroutput>noStatusBar</computeroutput></glossterm>
1235
1236 <glossdef>
1237 <para>VM windows will not contain a status bar.</para>
1238 </glossdef>
1239 </glossentry>
1240 </glosslist></para>
1241
1242 <para>To disable any GUI customization do <screen>VBoxManage setextradata global GUI/Customizations</screen></para>
1243
1244 <para>To disable all host key combinations, open the preferences and
1245 change the host key to <emphasis>None</emphasis>. This might be useful
1246 when using VirtualBox in a kiosk mode.</para>
1247
1248 <para>Furthermore, you can disallow certain actions when terminating a VM.
1249 To disallow specific actions, type:</para>
1250
1251 <para><screen>VBoxManage setextradata "VM name" GUI/RestrictedCloseActions OPTION[,OPTION...]</screen></para>
1252
1253 <para>where <computeroutput>OPTION</computeroutput> is one of the
1254 following keywords:<glosslist>
1255 <glossentry>
1256 <glossterm><computeroutput>SaveState</computeroutput></glossterm>
1257
1258 <glossdef>
1259 <para>Don't allow the user to save the VM state when terminating
1260 the VM.</para>
1261 </glossdef>
1262 </glossentry>
1263
1264 <glossentry>
1265 <glossterm><computeroutput>Shutdown</computeroutput></glossterm>
1266
1267 <glossdef>
1268 <para>Don't allow the user to shutdown the VM by sending the ACPI
1269 power-off event to the guest.</para>
1270 </glossdef>
1271 </glossentry>
1272
1273 <glossentry>
1274 <glossterm><computeroutput>PowerOff</computeroutput></glossterm>
1275
1276 <glossdef>
1277 <para>Don't allow the user to power off the VM.</para>
1278 </glossdef>
1279 </glossentry>
1280
1281 <glossentry>
1282 <glossterm><computeroutput>Restore</computeroutput></glossterm>
1283
1284 <glossdef>
1285 <para>Don't allow the user to return to the last snapshot when
1286 powering off the VM.</para>
1287 </glossdef>
1288 </glossentry>
1289 </glosslist></para>
1290
1291 <para>Any combination of the above is allowed. If all options are
1292 specified, the VM cannot be shut down at all.</para>
1293 </sect1>
1294
1295 <sect1 id="vboxwebsrv-daemon">
1296 <title>Starting the VirtualBox web service automatically</title>
1297
1298 <para>The VirtualBox web service
1299 (<computeroutput>vboxwebsrv</computeroutput>) is used for controlling
1300 VirtualBox remotely. It is documented in detail in the VirtualBox Software
1301 Development Kit (SDK); please see <xref linkend="VirtualBoxAPI" />. As the
1302 client base using this interface is growing, we added start scripts for
1303 the various operation systems we support. The following describes how to
1304 use them. <itemizedlist>
1305 <listitem>
1306 <para>On Mac OS X, launchd is used. An example configuration file
1307 can be found in
1308 <computeroutput>$HOME/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist</computeroutput>.
1309 It can be enabled by changing the
1310 <computeroutput>Disabled</computeroutput> key from
1311 <computeroutput>true</computeroutput> to
1312 <computeroutput>false</computeroutput>. To manually start the
1313 service use the following command: <screen>launchctl load ~/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist</screen>
1314 For additional information on how launchd services could be
1315 configured see <literal><ulink
1316 url="http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html">http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html</ulink></literal>.</para>
1317 </listitem>
1318 </itemizedlist></para>
1319 </sect1>
1320</chapter>
Note: See TracBrowser for help on using the repository browser.

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