VirtualBox

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

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

doc/manual: typo, better wording.

File size: 86.6 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 provider module,
172 extract the Guest Additions (see <xref
173 linkend="windows-guest-file-extraction" />) and copy the file
174 <computeroutput>VBoxCredProv.dll</computeroutput> to the Windows
175 <computeroutput>SYSTEM32</computeroutput> directory. Then, in the
176 registry, create the following keys:<screen>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
177 Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}
178
179HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}
180
181HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32</screen></para>
182
183 <para>with all default values (the key named
184 <computeroutput>(Default)</computeroutput> in each key) set to
185 <computeroutput>VBoxCredProv</computeroutput>. After that a new string
186 named <screen>HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32\ThreadingModel</screen>
187 with a value of <computeroutput>Apartment</computeroutput> has to be
188 created.</para>
189
190 <para>To set credentials, use the following command on a
191 <emphasis>running</emphasis> VM:</para>
192
193 <screen>VBoxManage controlvm "Windows XP" setcredentials "John Doe" "secretpassword" "DOMTEST"</screen>
194
195 <para>While the VM is running, the credentials can be queried by the
196 VirtualBox logon modules (GINA or credential provider) using the
197 VirtualBox Guest Additions device driver. When Windows is in "logged
198 out" mode, the logon modules will constantly poll for credentials and if
199 they are present, a logon will be attempted. After retrieving the
200 credentials, the logon modules will erase them so that the above command
201 will have to be repeated for subsequent logons.</para>
202
203 <para>For security reasons, credentials are not stored in any persistent
204 manner and will be lost when the VM is reset. Also, the credentials are
205 "write-only", i.e. there is no way to retrieve the credentials from the
206 host side. Credentials can be reset from the host side by setting empty
207 values.</para>
208
209 <para>Depending on the particular variant of the Windows guest, the
210 following restrictions apply: <orderedlist>
211 <listitem>
212 <para>For <emphasis role="bold">Windows XP guests,</emphasis> the
213 logon subsystem needs to be configured to use the classic logon
214 dialog as the VirtualBox GINA module does not support the XP-style
215 welcome dialog.</para>
216 </listitem>
217
218 <listitem>
219 <para>For <emphasis role="bold">Windows Vista and Windows 7
220 guests,</emphasis> the logon subsystem does not support the
221 so-called Secure Attention Sequence
222 (<computeroutput>CTRL+ALT+DEL</computeroutput>). As a result, the
223 guest's group policy settings need to be changed to not use the
224 Secure Attention Sequence. Also, the user name given is only
225 compared to the true user name, not the user friendly name. This
226 means that when you rename a user, you still have to supply the
227 original user name (internally, Windows never renames user
228 accounts).</para>
229 </listitem>
230
231 <listitem>
232 <para>Auto-logon handling of the built-in Windows Remote Desktop
233 Service (formerly known as Terminal Services) is disabled by
234 default. To enable it, create the registry key <screen>HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\VirtualBox Guest Additions\AutoLogon</screen>
235 with a <computeroutput>DWORD</computeroutput> value of
236 <computeroutput>1</computeroutput>.</para>
237 </listitem>
238 </orderedlist></para>
239
240 <para>The following command forces VirtualBox to keep the credentials
241 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
242 that this is a potential security risk as a malicious application
243 running on the guest could request this information using the proper
244 interface.</para>
245 </sect2>
246
247 <sect2 id="autologon_unix">
248 <title>Automated Linux/Unix guest logons</title>
249
250 <para>Starting with version 3.2, VirtualBox provides a custom PAM module
251 (Pluggable Authentication Module) which can be used to perform automated
252 guest logons on platforms which support this framework. Virtually all
253 modern Linux/Unix distributions rely on PAM.</para>
254
255 <para>The <computeroutput>pam_vbox.so</computeroutput> module itself
256 <emphasis role="bold">does not</emphasis> do an actual verification of
257 the credentials passed to the guest OS; instead it relies on other
258 modules such as <computeroutput>pam_unix.so</computeroutput> or
259 <computeroutput>pam_unix2.so</computeroutput> down in the PAM stack to
260 do the actual validation using the credentials retrieved by
261 <computeroutput>pam_vbox.so</computeroutput>. Therefore
262 <computeroutput>pam_vbox.so</computeroutput> has to be on top of the
263 authentication PAM service list.</para>
264
265 <note>
266 <para>The <computeroutput>pam_vbox.so</computeroutput> only supports
267 the <computeroutput>auth</computeroutput> primitive. Other primitives
268 such as <computeroutput>account</computeroutput>,
269 <computeroutput>session</computeroutput> or
270 <computeroutput>password</computeroutput> are not supported.</para>
271 </note>
272
273 <para>The <computeroutput>pam_vbox.so</computeroutput> module is shipped
274 as part of the Guest Additions but it is not installed and/or activated
275 on the guest OS by default. In order to install it, it has to be copied
276 from
277 <computeroutput>/opt/VBoxGuestAdditions-&lt;version&gt;/lib/VBoxGuestAdditions/</computeroutput>
278 to the security modules directory, usually
279 <computeroutput>/lib/security/</computeroutput> on 32-bit guest Linuxes
280 or <computeroutput>/lib64/security/</computeroutput> on 64-bit ones.
281 Please refer to your guest OS documentation for the correct PAM module
282 directory.</para>
283
284 <para>For example, to use <computeroutput>pam_vbox.so</computeroutput>
285 with a Ubuntu Linux guest OS and GDM (the GNOME Desktop Manager) to
286 logon users automatically with the credentials passed by the host, the
287 guest OS has to be configured like the following:</para>
288
289 <orderedlist>
290 <listitem>
291 <para>The <computeroutput>pam_vbox.so</computeroutput> module has to
292 be copied to the security modules directory, in this case it is
293 <computeroutput>/lib/security</computeroutput>.</para>
294 </listitem>
295
296 <listitem>
297 <para>Edit the PAM configuration file for GDM found at
298 <computeroutput>/etc/pam.d/gdm</computeroutput>, adding the line
299 <computeroutput>auth requisite pam_vbox.so</computeroutput> at the
300 top. Additionaly, in most Linux distributions there is a file called
301 <computeroutput>/etc/pam.d/common-auth</computeroutput>. This file
302 is included in many other services (like the GDM file mentioned
303 above). There you also have to add the line <computeroutput>auth
304 requisite pam_vbox.so</computeroutput>.</para>
305 </listitem>
306
307 <listitem>
308 <para>If authentication against the shadow database using
309 <computeroutput>pam_unix.so</computeroutput> or
310 <computeroutput>pam_unix2.so</computeroutput> is desired, the
311 argument <computeroutput>try_first_pass</computeroutput> for
312 <computeroutput>pam_unix.so</computeroutput> or
313 <computeroutput>use_first_pass</computeroutput> for
314 <computeroutput>pam_unix2.so</computeroutput> is needed in order to
315 pass the credentials from the VirtualBox module to the shadow
316 database authentication module. For Ubuntu, this needs to be added
317 to <computeroutput>/etc/pam.d/common-auth</computeroutput>, to the
318 end of the line referencing
319 <computeroutput>pam_unix.so</computeroutput>. This argument tells
320 the PAM module to use credentials already present in the stack, i.e.
321 the ones provided by the VirtualBox PAM module.</para>
322 </listitem>
323 </orderedlist>
324
325 <para><warning>
326 <para>An incorrectly configured PAM stack can effectively prevent
327 you from logging into your guest system!</para>
328 </warning></para>
329
330 <para>To make deployment easier, you can pass the argument
331 <computeroutput>debug</computeroutput> right after the
332 <computeroutput>pam_vbox.so</computeroutput> statement. Debug log output
333 will then be recorded using syslog.</para>
334
335 <para><note>
336 <para>By default, pam_vbox will not wait for credentials to arrive
337 from the host, in other words: When a login prompt is shown (for
338 example by GDM/KDM or the text console) and pam_vbox does not yet
339 have credentials it does not wait until they arrive. Instead the
340 next module in the PAM stack (depending on the PAM configuration)
341 will have the chance for authentication.</para>
342 </note></para>
343
344 <para>Starting with VirtualBox 4.1.4 pam_vbox supports various guest
345 property parameters which all reside in
346 <computeroutput>/VirtualBox/GuestAdd/PAM/</computeroutput>. These
347 parameters allow pam_vbox to wait for credentials to be provided by the
348 host and optionally can show a message while waiting for those. The
349 following guest properties can be set:</para>
350
351 <orderedlist>
352 <listitem>
353 <para><computeroutput>CredsWait</computeroutput>: Set to "1" if
354 pam_vbox should start waiting until credentials arrive from the
355 host. Until then no other authentication methods such as manually
356 logging in will be available. If this property is empty or get
357 deleted no waiting for credentials will be performed and pam_vbox
358 will act like before (see paragraph above). This property must be
359 set read-only for the guest
360 (<computeroutput>RDONLYGUEST</computeroutput>).</para>
361 </listitem>
362
363 <listitem>
364 <para><computeroutput>CredsChanged</computeroutput>: Acts as
365 "beacon" and is also read- and writeable from the guest. If set o
366 any value (e.g. to "1") waiting for credentials will be aborted. If
367 credentials are provided before setting
368 <computeroutput>CredsChanged</computeroutput>, these credentials
369 will be taken for authentication. To disable another round of
370 waiting for new credentials to arrive the property
371 <computeroutput>CredsWait</computeroutput> can be set to empty
372 (deleted) before.</para>
373 </listitem>
374
375 <listitem>
376 <para><computeroutput>CredsWaitTimeout</computeroutput>: Timeout (in
377 seconds) to let pam_vbox wait for credentials to arrive. When no
378 credentials arrive within this timeout, authentication of pam_vbox
379 will be set to failed and the next PAM module in chain will be
380 asked. If this property is not specified, set to "0" or an invalid
381 value, an infinite timeout will be used. This property must be set
382 read-only for the guest
383 (<computeroutput>RDONLYGUEST</computeroutput>).</para>
384 </listitem>
385 </orderedlist>
386
387 <para>To customize pam_vbox further there are the following guest
388 properties:</para>
389
390 <orderedlist>
391 <listitem>
392 <para><computeroutput>CredsMsgWaiting</computeroutput>: Custom
393 message showed while pam_vbox is waiting for credentials from the
394 host. This property must be set read-only for the guest
395 (<computeroutput>RDONLYGUEST</computeroutput>).</para>
396 </listitem>
397
398 <listitem>
399 <para><computeroutput>CredsMsgWaitTimeout</computeroutput>: Custom
400 message showed when waiting for credentials by pam_vbox timed out,
401 e.g. did not arrive within time. This property must be set read-only
402 for the guest (<computeroutput>RDONLYGUEST</computeroutput>).</para>
403 </listitem>
404 </orderedlist>
405
406 <para><note>
407 <para>If a pam_vbox guest property does not have set the right flags
408 (<computeroutput>RDONLYGUEST</computeroutput>) this property will be
409 ignored then and - depending on the property - a default value will
410 be set. This can result in pam_vbox not waiting for credentials.
411 Consult the appropriate syslog file for more information and use the
412 <computeroutput>debug</computeroutput> option.</para>
413 </note></para>
414 </sect2>
415 </sect1>
416
417 <sect1>
418 <title>Advanced configuration for Windows guests</title>
419
420 <sect2 id="sysprep">
421 <title>Automated Windows system preparation</title>
422
423 <para>Beginning with Windows NT 4.0, Microsoft offers a "system
424 preparation" tool (in short: Sysprep) to prepare a Windows system for
425 deployment or redistribution. Whereas Windows 2000 and XP ship with
426 Sysprep on the installation medium, the tool also is available for
427 download on the Microsoft web site. In a standard installation of
428 Windows Vista and 7, Sysprep is already included. Sysprep mainly
429 consists of an executable called
430 <computeroutput>sysprep.exe</computeroutput> which is invoked by the
431 user to put the Windows installation into preparation mode.</para>
432
433 <para>Starting with VirtualBox 3.2.2, the Guest Additions offer a way to
434 launch a system preparation on the guest operating system in an
435 automated way, controlled from the host system. To achieve that, see
436 <xref linkend="guestadd-guestcontrol" /> for using the feature with the
437 special identifier <computeroutput>sysprep</computeroutput> as the
438 program to execute, along with the user name
439 <computeroutput>sysprep</computeroutput> and password
440 <computeroutput>sysprep</computeroutput> for the credentials. Sysprep
441 then gets launched with the required system rights.</para>
442
443 <note>
444 <para>Specifying the location of "sysprep.exe" is <emphasis
445 role="bold">not possible</emphasis> -- instead the following paths are
446 used (based on the operating system): <itemizedlist>
447 <listitem>
448 <para><computeroutput>C:\sysprep\sysprep.exe</computeroutput>
449 for Windows NT 4.0, 2000 and XP</para>
450 </listitem>
451
452 <listitem>
453 <para><computeroutput>%WINDIR%\System32\Sysprep\sysprep.exe</computeroutput>
454 for Windows Vista, 2008 Server and 7</para>
455 </listitem>
456 </itemizedlist> The Guest Additions will automatically use the
457 appropriate path to execute the system preparation tool.</para>
458 </note>
459 </sect2>
460 </sect1>
461
462 <sect1>
463 <title>Advanced configuration for Linux and Solaris guests</title>
464
465 <sect2>
466 <title>Manual setup of selected guest services on Linux</title>
467
468 <para>The VirtualBox Guest Additions contain several different drivers.
469 If for any reason you do not wish to set them all up, you can install
470 the Guest Additions using the following command:</para>
471
472 <screen> sh ./VBoxLinuxAdditions.run no_setup</screen>
473
474 <para>After this, you will need to at least compile the kernel modules
475 by running the command <screen> /usr/lib/VBoxGuestAdditions/vboxadd setup</screen>
476 as root (you will need to replace <emphasis>lib</emphasis> by
477 <emphasis>lib64</emphasis> on some 64bit guests), and on older guests
478 without the udev service you will need to add the
479 <emphasis>vboxadd</emphasis> service to the default runlevel to ensure
480 that the modules get loaded.</para>
481
482 <para>To setup the time synchronization service, run the command
483 <screen> /usr/lib/VBoxGuestAdditions/vboxadd-service setup</screen> and
484 add the service vboxadd-service to the default runlevel. To set up the
485 X11 and OpenGL part of the Guest Additions, run the command <screen> /usr/lib/VBoxGuestAdditions/vboxadd-x11 setup</screen>
486 (you do not need to enable any services for this).</para>
487
488 <para>To recompile the guest kernel modules, use this command: <screen> /usr/lib/VBoxGuestAdditions/vboxadd setup</screen>
489 After compilation you should reboot your guest to ensure that the new
490 modules are actually used.</para>
491 </sect2>
492
493 <sect2 id="guestxorgsetup">
494 <title>Guest graphics and mouse driver setup in depth</title>
495
496 <para>This section assumes that you are familiar with configuring the
497 X.Org server using xorg.conf and optionally the newer mechanisms using
498 hal or udev and xorg.conf.d. If not you can learn about them by studying
499 the documentation which comes with X.Org.</para>
500
501 <para>The VirtualBox Guest Additions come with drivers for X.Org
502 versions <itemizedlist>
503 <listitem>
504 X11R6.8/X11R6.9 and XFree86 version 4.3 (vboxvideo_drv_68.o and vboxmouse_drv_68.o)
505 </listitem>
506
507 <listitem>
508 X11R7.0 (vboxvideo_drv_70.so and vboxmouse_drv_70.so)
509 </listitem>
510
511 <listitem>
512 X11R7.1 (vboxvideo_drv_71.so and vboxmouse_drv_71.so)
513 </listitem>
514
515 <listitem>
516 X.Org Server versions 1.3 and later (vboxvideo_drv_13.so and vboxmouse_drv_13.so and so on).
517 </listitem>
518 </itemizedlist> By default these drivers can be found in the
519 directory</para>
520
521 <para><computeroutput>/opt/VBoxGuestAdditions-&lt;version&gt;/lib/VBoxGuestAdditions</computeroutput></para>
522
523 <para>and the correct versions for the X server are symbolically linked
524 into the X.Org driver directories.</para>
525
526 <para>For graphics integration to work correctly, the X server must load
527 the vboxvideo driver (many recent X server versions look for it
528 automatically if they see that they are running in VirtualBox) and for
529 an optimal user experience the guest kernel drivers must be loaded and
530 the Guest Additions tool VBoxClient must be running as a client in the X
531 session. For mouse integration to work correctly, the guest kernel
532 drivers must be loaded and in addition, in X servers from X.Org X11R6.8
533 to X11R7.1 and in XFree86 version 4.3 the right vboxmouse driver must be
534 loaded and associated with /dev/mouse or /dev/psaux; in X.Org server 1.3
535 or later a driver for a PS/2 mouse must be loaded and the right
536 vboxmouse driver must be associated with /dev/vboxguest.</para>
537
538 <para>The VirtualBox guest graphics driver can use any graphics
539 configuration for which the virtual resolution fits into the virtual
540 video memory allocated to the virtual machine (minus a small amount used
541 by the guest driver) as described in <xref
542 linkend="settings-display" />. The driver will offer a range of standard
543 modes at least up to the default guest resolution for all active guest
544 monitors. In X.Org Server 1.3 and later the default mode can be changed
545 by setting the output property VBOX_MODE to
546 "&lt;width&gt;x&lt;height&gt;" for any guest monitor. When VBoxClient
547 and the kernel drivers are active this is done automatically when the
548 host requests a mode change. The driver for older versions can only
549 receive new modes by querying the host for requests at regular
550 intervals.</para>
551
552 <para>With pre-1.3 X Servers you can also add your own modes to the X
553 server configuration file. You simply need to add them to the "Modes"
554 list in the "Display" subsection of the "Screen" section. For example,
555 the section shown here has a custom 2048x800 resolution mode
556 added:</para>
557
558 <screen>Section "Screen"
559 Identifier "Default Screen"
560 Device "VirtualBox graphics card"
561 Monitor "Generic Monitor"
562 DefaultDepth 24
563 SubSection "Display"
564 Depth 24
565 Modes "2048x800" "800x600" "640x480"
566 EndSubSection
567EndSection</screen>
568 </sect2>
569 </sect1>
570
571 <sect1 id="cpuhotplug">
572 <title>CPU hot-plugging</title>
573
574 <para>With virtual machines running modern server operating systems,
575 VirtualBox supports CPU hot-plugging.<footnote>
576 <para>Support for CPU hot-plugging was introduced with VirtualBox
577 3.2.</para>
578 </footnote> Whereas on a physical computer this would mean that a CPU
579 can be added or removed while the machine is running, VirtualBox supports
580 adding and removing virtual CPUs while a virtual machine is
581 running.</para>
582
583 <para>CPU hot-plugging works only with guest operating systems that
584 support it. So far this applies only to Linux and Windows Server 2008 x64
585 Data Center Edition. Windows supports only hot-add while Linux supports
586 hot-add and hot-remove but to use this feature with more than 8 CPUs a
587 64bit Linux guest is required.</para>
588
589 <para>At this time, CPU hot-plugging requires using the VBoxManage
590 command-line interface. First, hot-plugging needs to be enabled for a
591 virtual machine:<screen>VBoxManage modifyvm "VM name" --cpuhotplug on</screen></para>
592
593 <para>After that, the --cpus option specifies the maximum number of CPUs
594 that the virtual machine can have:<screen>VBoxManage modifyvm "VM name" --cpus 8</screen>When
595 the VM is off, you can then add and remove virtual CPUs with the modifyvm
596 --plugcpu and --unplugcpu subcommands, which take the number of the
597 virtual CPU as a parameter, like this:<screen>VBoxManage modifyvm "VM name" --plugcpu 3
598VBoxManage modifyvm "VM name" --unplugcpu 3</screen>Note that CPU 0 can never
599 be removed.</para>
600
601 <para>While the VM is running, CPUs can be added with the
602 <computeroutput>controlvm plugcpu/unplugcpu</computeroutput> commands
603 instead:<screen>VBoxManage controlvm "VM name" plugcpu 3
604VBoxManage controlvm "VM name" unplugcpu 3</screen></para>
605
606 <para>See <xref linkend="vboxmanage-modifyvm" /> and <xref
607 linkend="vboxmanage-controlvm" /> for details.</para>
608
609 <para>With Linux guests, the following applies: To prevent ejection while
610 the CPU is still used it has to be ejected from within the guest before.
611 The Linux Guest Additions contain a service which receives hot-remove
612 events and ejects the CPU. Also, after a CPU is added to the VM it is not
613 automatically used by Linux. The Linux Guest Additions service will take
614 care of that if installed. If not a CPU can be started with the following
615 command:<screen>echo 1 &gt; /sys/devices/system/cpu/cpu&lt;id&gt;/online</screen></para>
616 </sect1>
617
618 <sect1 id="pcipassthrough">
619 <title>PCI passthrough</title>
620
621 <para>When running on Linux hosts, with a recent enough kernel (at least
622 version <computeroutput>2.6.31</computeroutput>) experimental host PCI
623 devices passthrough is available.<footnote>
624 <para>Experimental support for PCI passthrough was introduced with
625 VirtualBox 4.1.</para>
626 </footnote></para>
627
628 <note>
629 <para>The PCI passthrough module is shipped as a VirtualBox extension
630 package, which must be installed separately. See <xref
631 linkend="intro-installing" /> for more information.</para>
632 </note>
633
634 <para>Essentially this feature allows to directly use physical PCI devices
635 on the host by the guest even if host doesn't have drivers for this
636 particular device. Both, regular PCI and some PCI Express cards, are
637 supported. AGP and certain PCI Express cards are not supported at the
638 moment if they rely on GART (Graphics Address Remapping Table) unit
639 programming for texture management as it does rather nontrivial operations
640 with pages remapping interfering with IOMMU. This limitation may be lifted
641 in future releases.</para>
642
643 <para>To be fully functional, PCI passthrough support in VirtualBox
644 depends upon an IOMMU hardware unit which is not yet too widely available.
645 If the device uses bus mastering (i.e. it performs DMA to the OS memory on
646 its own), then an IOMMU is required, otherwise such DMA transactions may
647 write to the wrong physical memory address as the device DMA engine is
648 programmed using a device-specific protocol to perform memory
649 transactions. The IOMMU functions as translation unit mapping physical
650 memory access requests from the device using knowledge of the guest
651 physical address to host physical addresses translation rules.</para>
652
653 <para>Intel's solution for IOMMU is marketed as "Intel Virtualization
654 Technology for Directed I/O" (VT-d), and AMD's one is called AMD-Vi. So
655 please check if your motherboard datasheet has appropriate technology.
656 Even if your hardware doesn't have a IOMMU, certain PCI cards may work
657 (such as serial PCI adapters), but the guest will show a warning on boot
658 and the VM execution will terminate if the guest driver will attempt to
659 enable card bus mastering.</para>
660
661 <para>It is very common that the BIOS or the host OS disables the IOMMU by
662 default. So before any attempt to use it please make sure that
663 <orderedlist>
664 <listitem>
665 <para>Your motherboard has an IOMMU unit.</para>
666 </listitem>
667
668 <listitem>
669 <para>Your CPU supports the IOMMU.</para>
670 </listitem>
671
672 <listitem>
673 <para>The IOMMU is enabled in the BIOS.</para>
674 </listitem>
675
676 <listitem>
677 <para>The VM must run with VT-x/AMD-V and nested paging
678 enabled.</para>
679 </listitem>
680
681 <listitem>
682 <para>Your Linux kernel was compiled with IOMMU support (including
683 DMA remapping, see <computeroutput>CONFIG_DMAR</computeroutput>
684 kernel compilation option). The PCI stub driver
685 (<computeroutput>CONFIG_PCI_STUB</computeroutput>) is required as
686 well.</para>
687 </listitem>
688
689 <listitem>
690 <para>Your Linux kernel recognizes and uses the IOMMU unit
691 (<computeroutput>intel_iommu=on</computeroutput> boot option could
692 be needed). Search for DMAR and PCI-DMA in kernel boot log.</para>
693 </listitem>
694 </orderedlist></para>
695
696 <para>Once you made sure that the host kernel supports the IOMMU, the next
697 step is to select the PCI card and attach it to the guest. To figure out
698 the list of available PCI devices, use the
699 <computeroutput>lspci</computeroutput> command. The output will look like
700 this <screen>
701 01:00.0 VGA compatible controller: ATI Technologies Inc Cedar PRO [Radeon HD 5450]
702 01:00.1 Audio device: ATI Technologies Inc Manhattan HDMI Audio [Mobility Radeon HD 5000 Series]
703 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
704 03:00.0 SATA controller: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03)
705 03:00.1 IDE interface: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03)
706 06:00.0 VGA compatible controller: nVidia Corporation G86 [GeForce 8500 GT] (rev a1)
707 </screen> The first column is a PCI address (in format
708 <computeroutput>bus:device.function</computeroutput>). This address could
709 be used to identify the device for further operations. For example, to
710 attach a PCI network controller on the system listed above to the second
711 PCI bus in the guest, as device 5, function 0, use the following command:
712 <screen>VBoxManage modifyvm "VM name" --pciattach 02:00.0@01:05.0</screen>
713 To detach same device, use <screen>VBoxManage modifyvm "VM name" --pcidetach 02:00.0</screen>
714 Please note that both host and guest could freely assign a different PCI
715 address to the card attached during runtime, so those addresses only apply
716 to the address of the card at the moment of attachment (host), and during
717 BIOS PCI init (guest).</para>
718
719 <para>If the virtual machine has a PCI device attached, certain
720 limitations apply: <orderedlist>
721 <listitem>
722 Only PCI cards with non-shared interrupts (such as using MSI on host) are supported at the moment.
723 </listitem>
724
725 <listitem>
726 No guest state can be reliably saved/restored (as the internal state of the PCI card could not be retrieved).
727 </listitem>
728
729 <listitem>
730 Teleportation (live migration) doesn't work (for the same reason).
731 </listitem>
732
733 <listitem>
734 No lazy physical memory allocation. The host will preallocate the whole RAM required for the VM on startup (as we cannot catch physical hardware accesses to the physical memory).
735 </listitem>
736 </orderedlist></para>
737 </sect1>
738
739 <sect1>
740 <title>Advanced display configuration</title>
741
742 <sect2>
743 <title>Custom VESA resolutions</title>
744
745 <para>Apart from the standard VESA resolutions, the VirtualBox VESA BIOS
746 allows you to add up to 16 custom video modes which will be reported to
747 the guest operating system. When using Windows guests with the
748 VirtualBox Guest Additions, a custom graphics driver will be used
749 instead of the fallback VESA solution so this information does not
750 apply.</para>
751
752 <para>Additional video modes can be configured for each VM using the
753 extra data facility. The extra data key is called
754 <literal>CustomVideoMode&lt;x&gt;</literal> with <literal>x</literal>
755 being a number from 1 to 16. Please note that modes will be read from 1
756 until either the following number is not defined or 16 is reached. The
757 following example adds a video mode that corresponds to the native
758 display resolution of many notebook computers:</para>
759
760 <screen>VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16"</screen>
761
762 <para>The VESA mode IDs for custom video modes start at
763 <literal>0x160</literal>. In order to use the above defined custom video
764 mode, the following command line has be supplied to Linux:</para>
765
766 <screen>vga = 0x200 | 0x160
767vga = 864</screen>
768
769 <para>For guest operating systems with VirtualBox Guest Additions, a
770 custom video mode can be set using the video mode hint feature.</para>
771 </sect2>
772
773 <sect2>
774 <title>Configuring the maximum resolution of guests when using the
775 graphical frontend</title>
776
777 <para>When guest systems with the Guest Additions installed are started
778 using the graphical frontend (the normal VirtualBox application), they
779 will not be allowed to use screen resolutions greater than the host's
780 screen size unless the user manually resizes them by dragging the
781 window, switching to fullscreen or seamless mode or sending a video mode
782 hint using VBoxManage. This behavior is what most users will want, but
783 if you have different needs, it is possible to change it by issuing one
784 of the following commands from the command line:</para>
785
786 <screen>VBoxManage setextradata global GUI/MaxGuestResolution any</screen>
787
788 <para>will remove all limits on guest resolutions.</para>
789
790 <screen>VBoxManage setextradata global GUI/MaxGuestResolution &gt;width,height&lt;</screen>
791
792 <para>manually specifies a maximum resolution.</para>
793
794 <screen>VBoxManage setextradata global GUI/MaxGuestResolution auto</screen>
795
796 <para>restores the default settings. Note that these settings apply
797 globally to all guest systems, not just to a single machine.</para>
798 </sect2>
799 </sect1>
800
801 <sect1>
802 <title>Advanced storage configuration</title>
803
804 <sect2 id="rawdisk">
805 <title>Using a raw host hard disk from a guest</title>
806
807 <para>Starting with version 1.4, as an alternative to using virtual disk
808 images (as described in detail in <xref linkend="storage" />),
809 VirtualBox can also present either entire physical hard disks or
810 selected partitions thereof as virtual disks to virtual machines.</para>
811
812 <para>With VirtualBox, this type of access is called "raw hard disk
813 access"; it allows a guest operating system to access its virtual hard
814 disk without going through the host OS file system. The actual
815 performance difference for image files vs. raw disk varies greatly
816 depending on the overhead of the host file system, whether dynamically
817 growing images are used and on host OS caching strategies. The caching
818 indirectly also affects other aspects such as failure behavior, i.e.
819 whether the virtual disk contains all data written before a host OS
820 crash. Consult your host OS documentation for details on this.</para>
821
822 <para><warning>
823 <para>Raw hard disk access is for expert users only. Incorrect use
824 or use of an outdated configuration can lead to <emphasis
825 role="bold">total loss of data </emphasis>on the physical disk. Most
826 importantly, <emphasis>do not</emphasis> attempt to boot the
827 partition with the currently running host operating system in a
828 guest. This will lead to severe data corruption.</para>
829 </warning></para>
830
831 <para>Raw hard disk access -- both for entire disks and individual
832 partitions -- is implemented as part of the VMDK image format support.
833 As a result, you will need to create a special VMDK image file which
834 defines where the data will be stored. After creating such a special
835 VMDK image, you can use it like a regular virtual disk image. For
836 example, you can use the Virtual Media Manager (<xref linkend="vdis" />)
837 or <computeroutput>VBoxManage</computeroutput> to assign the image to a
838 virtual machine.</para>
839
840 <sect3>
841 <title>Access to entire physical hard disk</title>
842
843 <para>While this variant is the simplest to set up, you must be aware
844 that this will give a guest operating system direct and full access to
845 an <emphasis>entire physical disk</emphasis>. If your
846 <emphasis>host</emphasis> operating system is also booted from this
847 disk, please take special care to not access the partition from the
848 guest at all. On the positive side, the physical disk can be
849 repartitioned in arbitrary ways without having to recreate the image
850 file that gives access to the raw disk.</para>
851
852 <para>To create an image that represents an entire physical hard disk
853 (which will not contain any actual data, as this will all be stored on
854 the physical disk), on a Linux host, use the command<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
855 -rawdisk /dev/sda</screen>This creates the image
856 <code>/path/to/file.vmdk</code> (must be absolute), and all data will
857 be read and written from <code>/dev/sda</code>.</para>
858
859 <para>On a Windows host, instead of the above device specification,
860 use e.g. <code>\\.\PhysicalDrive0</code>. On a Mac OS X host, instead
861 of the above device specification use e.g. <code>/dev/disk1</code>.
862 Note that on OS X you can only get access to an entire disk if no
863 volume is mounted from it.</para>
864
865 <para>Creating the image requires read/write access for the given
866 device. Read/write access is also later needed when using the image
867 from a virtual machine.</para>
868
869 <para>Just like with regular disk images, this does not automatically
870 attach the newly created image to a virtual machine. This can be done
871 with e.g. <screen>VBoxManage storageattach WindowsXP --storagectl "IDE Controller"
872 --port 0 --device 0 --type hdd --medium /path/to/file.vmdk</screen>When
873 this is done the selected virtual machine will boot from the specified
874 physical disk.</para>
875 </sect3>
876
877 <sect3>
878 <title>Access to individual physical hard disk partitions</title>
879
880 <para>This "raw partition support" is quite similar to the "full hard
881 disk" access described above. However, in this case, any partitioning
882 information will be stored inside the VMDK image, so you can e.g.
883 install a different boot loader in the virtual hard disk without
884 affecting the host's partitioning information. While the guest will be
885 able to <emphasis>see</emphasis> all partitions that exist on the
886 physical disk, access will be filtered in that reading from partitions
887 for which no access is allowed the partitions will only yield zeroes,
888 and all writes to them are ignored.</para>
889
890 <para>To create a special image for raw partition support (which will
891 contain a small amount of data, as already mentioned), on a Linux
892 host, use the command<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
893 -rawdisk /dev/sda -partitions 1,5</screen></para>
894
895 <para>As you can see, the command is identical to the one for "full
896 hard disk" access, except for the additional
897 <computeroutput>-partitions</computeroutput> parameter. This example
898 would create the image <code>/path/to/file.vmdk</code> (which, again,
899 must be absolute), and partitions 1 and 5 of <code>/dev/sda</code>
900 would be made accessible to the guest.</para>
901
902 <para>VirtualBox uses the same partition numbering as your Linux host.
903 As a result, the numbers given in the above example would refer to the
904 first primary partition and the first logical drive in the extended
905 partition, respectively.</para>
906
907 <para>On a Windows host, instead of the above device specification,
908 use e.g. <code>\\.\PhysicalDrive0</code>. On a Mac OS X host, instead
909 of the above device specification use e.g. <code>/dev/disk1</code>.
910 Note that on OS X you can only use partitions which are not mounted
911 (eject the respective volume first). Partition numbers are the same on
912 Linux, Windows and Mac OS X hosts.</para>
913
914 <para>The numbers for the list of partitions can be taken from the
915 output of<screen>VBoxManage internalcommands listpartitions -rawdisk /dev/sda</screen>The
916 output lists the partition types and sizes to give the user enough
917 information to identify the partitions necessary for the guest.</para>
918
919 <para>Images which give access to individual partitions are specific
920 to a particular host disk setup. You cannot transfer these images to
921 another host; also, whenever the host partitioning changes, the image
922 <emphasis>must be recreated</emphasis>.</para>
923
924 <para>Creating the image requires read/write access for the given
925 device. Read/write access is also later needed when using the image
926 from a virtual machine. If this is not feasible, there is a special
927 variant for raw partition access (currently only available on Linux
928 hosts) that avoids having to give the current user access to the
929 entire disk. To set up such an image, use<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
930 -rawdisk /dev/sda -partitions 1,5 -relative</screen>When used from a
931 virtual machine, the image will then refer not to the entire disk, but
932 only to the individual partitions (in the example
933 <code>/dev/sda1</code> and <code>/dev/sda5</code>). As a consequence,
934 read/write access is only required for the affected partitions, not
935 for the entire disk. During creation however, read-only access to the
936 entire disk is required to obtain the partitioning information.</para>
937
938 <para>In some configurations it may be necessary to change the MBR
939 code of the created image, e.g. to replace the Linux boot loader that
940 is used on the host by another boot loader. This allows e.g. the guest
941 to boot directly to Windows, while the host boots Linux from the
942 "same" disk. For this purpose the
943 <computeroutput>-mbr</computeroutput> parameter is provided. It
944 specifies a file name from which to take the MBR code. The partition
945 table is not modified at all, so a MBR file from a system with totally
946 different partitioning can be used. An example of this is<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
947 -rawdisk /dev/sda -partitions 1,5 -mbr winxp.mbr</screen>The modified
948 MBR will be stored inside the image, not on the host disk.</para>
949
950 <para>The created image can be attached to a storage controller in a
951 VM configuration as usual.</para>
952 </sect3>
953 </sect2>
954
955 <sect2 id="changevpd">
956 <title>Configuring the hard disk vendor product data (VPD)</title>
957
958 <para>VirtualBox reports vendor product data for its virtual hard disks
959 which consist of hard disk serial number, firmware revision and model
960 number. These can be changed using the following commands:</para>
961
962 <screen>VBoxManage setextradata "VM name"
963 "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "serial"
964VBoxManage setextradata "VM name"
965 "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "firmware"
966VBoxManage setextradata "VM name"
967 "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "model"</screen>
968
969 <para>The serial number is a 20 byte alphanumeric string, the firmware
970 revision an 8 byte alphanumeric string and the model number a 40 byte
971 alphanumeric string. Instead of "Port0" (referring to the first port),
972 specify the desired SATA hard disk port.</para>
973
974 <para>The above commands apply to virtual machines with an AHCI (SATA)
975 controller. The commands for virtual machines with an IDE controller
976 are:</para>
977
978 <screen>VBoxManage setextradata "VM name"
979 "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/SerialNumber" "serial"
980VBoxManage setextradata "VM name"
981 "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/FirmwareRevision" "firmware"
982VBoxManage setextradata "VM name"
983 "VBoxInternal/Devices/piix3ide/0/Config/PrimaryMaster/ModelNumber" "model"</screen>
984
985 <para>For hard disks it's also possible (experimental!) to mark the
986 drive as having a non-rotational medium with:</para>
987
988 <screen>VBoxManage setextradata "VM name"
989 "VBoxInternal/Devices/ahci/0/Config/Port0/NonRotational" "1"</screen>
990
991 <para>Additional three parameters are needed for CD/DVD drives to report
992 the vendor product data:</para>
993
994 <screen>VBoxManage setextradata "VM name"
995 "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIVendorId" "vendor"
996VBoxManage setextradata "VM name"
997 "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIProductId" "product"
998VBoxManage setextradata "VM name"
999 "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIRevision" "revision"</screen>
1000
1001 <para>The vendor id is an 8 byte alphanumeric string, the product id an
1002 16 byte alphanumeric string and the revision a 4 byte alphanumeric
1003 string. Instead of "Port0" (referring to the first port), specify the
1004 desired SATA hard disk port.</para>
1005 </sect2>
1006
1007 <sect2>
1008 <title id="iscsi-intnet">Access iSCSI targets via Internal
1009 Networking</title>
1010
1011 <para>As an experimental feature, VirtualBox allows for accessing an
1012 iSCSI target running in a virtual machine which is configured for using
1013 Internal Networking mode. Please see <xref linkend="storage-iscsi" />;
1014 <xref linkend="network_internal" />; and <xref
1015 linkend="vboxmanage-storageattach" /> for additional information.</para>
1016
1017 <para>The IP stack accessing Internal Networking must be configured in
1018 the virtual machine which accesses the iSCSI target. A free static IP
1019 and a MAC address not used by other virtual machines must be chosen. In
1020 the example below, adapt the name of the virtual machine, the MAC
1021 address, the IP configuration and the Internal Networking name
1022 ("MyIntNet") according to your needs. The following seven commands must
1023 first be issued:<screen>VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Trusted 1
1024VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Config/MAC 08:00:27:01:02:0f
1025VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Config/IP 10.0.9.1
1026VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/Config/Netmask 255.255.255.0
1027VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/LUN#0/Driver IntNet
1028VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/LUN#0/Config/Network MyIntNet
1029VBoxManage setextradata "VM name" VBoxInternal/Devices/IntNetIP/0/LUN#0/Config/IsService 1</screen></para>
1030
1031 <para>Finally the iSCSI disk must be attached with the
1032 <computeroutput>--intnet</computeroutput> option to tell the iSCSI
1033 initiator to use internal networking:<screen>VBoxManage storageattach ... --medium iscsi
1034 --server 10.0.9.30 --target iqn.2008-12.com.sun:sampletarget --intnet</screen></para>
1035
1036 <para>Compared to a "regular" iSCSI setup, IP address of the target
1037 <emphasis>must</emphasis> be specified as a numeric IP address, as there
1038 is no DNS resolver for internal networking.</para>
1039
1040 <para>The virtual machine with the iSCSI target should be started before
1041 the VM using it is powered on. If a virtual machine using an iSCSI disk
1042 is started without having the iSCSI target powered up, it can take up to
1043 200 seconds to detect this situation. The VM will fail to power
1044 up.</para>
1045 </sect2>
1046 </sect1>
1047
1048 <sect1>
1049 <title>Launching more than 120 VMs on Solaris hosts</title>
1050
1051 <para>Solaris hosts have a fixed number of IPC semaphores IDs per process
1052 preventing users from starting more than 120 VMs. While trying to launch
1053 more VMs you would be shown a "Cannot create IPC semaphore" error.</para>
1054
1055 <para>In order to run more VMs, you will need to bump the semaphore ID
1056 limit of the VBoxSVC process. Execute as root the
1057 <computeroutput>prctl</computeroutput> command as shown below. The process
1058 ID of VBoxSVC can be obtained using the
1059 <computeroutput>ps</computeroutput> list command.</para>
1060
1061 <para><screen>prctl -r -n project.max-sem-ids -v 2048 &lt;pid-of-VBoxSVC&gt;</screen></para>
1062 </sect1>
1063
1064 <sect1>
1065 <title>Legacy commands for using serial ports</title>
1066
1067 <para>Starting with version 1.4, VirtualBox provided support for virtual
1068 serial ports, which, at the time, was rather complicated to set up with a
1069 sequence of <computeroutput>VBoxManage setextradata</computeroutput>
1070 statements. Since version 1.5, that way of setting up serial ports is no
1071 longer necessary and <emphasis>deprecated.</emphasis> To set up virtual
1072 serial ports, use the methods now described in <xref
1073 linkend="serialports" />.<note>
1074 <para>For backwards compatibility, the old
1075 <computeroutput>setextradata</computeroutput> statements, whose
1076 description is retained below from the old version of the manual, take
1077 <emphasis>precedence</emphasis> over the new way of configuring serial
1078 ports. As a result, if configuring serial ports the new way doesn't
1079 work, make sure the VM in question does not have old configuration
1080 data such as below still active.</para>
1081 </note></para>
1082
1083 <para>The old sequence of configuring a serial port used the following 6
1084 commands:</para>
1085
1086 <screen>VBoxManage setextradata "VM name"
1087 "VBoxInternal/Devices/serial/0/Config/IRQ" 4
1088VBoxManage setextradata "VM name"
1089 "VBoxInternal/Devices/serial/0/Config/IOBase" 0x3f8
1090VBoxManage setextradata "VM name"
1091 "VBoxInternal/Devices/serial/0/LUN#0/Driver" Char
1092VBoxManage setextradata "VM name"
1093 "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Driver" NamedPipe
1094VBoxManage setextradata "VM name"
1095 "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Config/Location" "\\.\pipe\vboxCOM1"
1096VBoxManage setextradata "VM name"
1097 "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Config/IsServer" 1</screen>
1098
1099 <para>This sets up a serial port in the guest with the default settings
1100 for COM1 (IRQ 4, I/O address 0x3f8) and the
1101 <computeroutput>Location</computeroutput> setting assumes that this
1102 configuration is used on a Windows host, because the Windows named pipe
1103 syntax is used. Keep in mind that on Windows hosts a named pipe must
1104 always start with <computeroutput>\\.\pipe\</computeroutput>. On Linux the
1105 same config settings apply, except that the path name for the
1106 <computeroutput>Location</computeroutput> can be chosen more freely. Local
1107 domain sockets can be placed anywhere, provided the user running
1108 VirtualBox has the permission to create a new file in the directory. The
1109 final command above defines that VirtualBox acts as a server, i.e. it
1110 creates the named pipe itself instead of connecting to an already existing
1111 one.</para>
1112 </sect1>
1113
1114 <sect1 id="changenat">
1115 <title>Fine-tuning the VirtualBox NAT engine</title>
1116
1117 <sect2>
1118 <title>Configuring the address of a NAT network interface</title>
1119
1120 <para>In NAT mode, the guest network interface is assigned to the IPv4
1121 range <computeroutput>10.0.x.0/24</computeroutput> by default where
1122 <computeroutput>x</computeroutput> corresponds to the instance of the
1123 NAT interface +2. So <computeroutput>x</computeroutput> is 2 when there
1124 is only one NAT instance active. In that case the guest is assigned to
1125 the address <computeroutput>10.0.2.15</computeroutput>, the gateway is
1126 set to <computeroutput>10.0.2.2</computeroutput> and the name server can
1127 be found at <computeroutput>10.0.2.3</computeroutput>.</para>
1128
1129 <para>If, for any reason, the NAT network needs to be changed, this can
1130 be achieved with the following command:</para>
1131
1132 <screen>VBoxManage modifyvm "VM name" --natnet1 "192.168/16"</screen>
1133
1134 <para>This command would reserve the network addresses from
1135 <computeroutput>192.168.0.0</computeroutput> to
1136 <computeroutput>192.168.254.254</computeroutput> for the first NAT
1137 network instance of "VM name". The guest IP would be assigned to
1138 <computeroutput>192.168.0.15</computeroutput> and the default gateway
1139 could be found at <computeroutput>192.168.0.2</computeroutput>.</para>
1140 </sect2>
1141
1142 <sect2 id="nat-adv-tftp">
1143 <title>Configuring the boot server (next server) of a NAT network
1144 interface</title>
1145
1146 <para>For network booting in NAT mode, by default VirtualBox uses a
1147 built-in TFTP server at the IP address 10.0.2.3. This default behavior
1148 should work fine for typical remote-booting scenarios. However, it is
1149 possible to change the boot server IP and the location of the boot image
1150 with the following commands: <screen>VBoxManage modifyvm "VM name" --nattftpserver1 10.0.2.2
1151VBoxManage modifyvm "VM name" --nattftpfile1 /srv/tftp/boot/MyPXEBoot.pxe</screen></para>
1152 </sect2>
1153
1154 <sect2 id="nat-adv-settings">
1155 <title>Tuning TCP/IP buffers for NAT</title>
1156
1157 <para>The VirtualBox NAT stack performance is often determined by its
1158 interaction with the host's TCP/IP stack and the size of several buffers
1159 (<computeroutput>SO_RCVBUF</computeroutput> and
1160 <computeroutput>SO_SNDBUF</computeroutput>). For certain setups users
1161 might want to adjust the buffer size for a better performance. This can
1162 by achieved using the following commands (values are in kilobytes and
1163 can range from 8 to 1024): <screen>VBoxManage modifyvm "VM name" --natsettings1 16000,128,128,0,0</screen>
1164 This example illustrates tuning the NAT settings. The first parameter is
1165 the MTU, then the size of the socket's send buffer and the size of the
1166 socket's receive buffer, the initial size of the TCP send window, and
1167 lastly the initial size of the TCP receive window. Note that specifying
1168 zero means fallback to the default value.</para>
1169
1170 <para>Each of these buffers has a default size of 64KB and default MTU
1171 is 1500.</para>
1172 </sect2>
1173
1174 <sect2>
1175 <title>Binding NAT sockets to a specific interface</title>
1176
1177 <para>By default, VirtualBox's NAT engine will route TCP/IP packets
1178 through the default interface assigned by the host's TCP/IP stack. (The
1179 technical reason for this is that the NAT engine uses sockets for
1180 communication.) If, for some reason, you want to change this behavior,
1181 you can tell the NAT engine to bind to a particular IP address instead.
1182 Use the following command: <screen>VBoxManage modifyvm "VM name" --natbindip1 "10.45.0.2"</screen></para>
1183
1184 <para>After this, all outgoing traffic will be sent through the
1185 interface with the IP address 10.45.0.2. Please make sure that this
1186 interface is up and running prior to this assignment.</para>
1187 </sect2>
1188
1189 <sect2 id="nat-adv-dns">
1190 <title>Enabling DNS proxy in NAT mode</title>
1191
1192 <para>The NAT engine by default offers the same DNS servers to the guest
1193 that are configured on the host. In some scenarios, it can be desirable
1194 to hide the DNS server IPs from the guest, for example when this
1195 information can change on the host due to expiring DHCP leases. In this
1196 case, you can tell the NAT engine to act as DNS proxy using the
1197 following command: <screen>VBoxManage modifyvm "VM name" --natdnsproxy1 on</screen></para>
1198 </sect2>
1199
1200 <sect2 id="nat_host_resolver_proxy">
1201 <title>Using the host's resolver as a DNS proxy in NAT mode</title>
1202
1203 <para>For resolving network names, the DHCP server of the NAT engine
1204 offers a list of registered DNS servers of the host. If for some reason
1205 you need to hide this DNS server list and use the host's resolver
1206 settings, thereby forcing the VirtualBox NAT engine to intercept DNS
1207 requests and forward them to host's resolver, use the following command:
1208 <screen>VBoxManage modifyvm "VM name" --natdnshostresolver1 on</screen>
1209 Note that this setting is similar to the DNS proxy mode, however whereas
1210 the proxy mode just forwards DNS requests to the appropriate servers,
1211 the resolver mode will interpret the DNS requests and use the host's DNS
1212 API to query the information and return it to the guest.</para>
1213 </sect2>
1214
1215 <sect2 id="nat-adv-alias">
1216 <title>Configuring aliasing of the NAT engine</title>
1217
1218 <para>By default, the NAT core uses aliasing and uses random ports when
1219 generating an alias for a connection. This works well for the most
1220 protocols like SSH, FTP and so on. Though some protocols might need a
1221 more transparent behavior or may depend on the real port number the
1222 packet was sent from. It is possible to change the NAT mode via the
1223 VBoxManage frontend with the following commands: <screen>VBoxManage modifyvm "VM name" --nataliasmode1 proxyonly</screen>
1224 and <screen>VBoxManage modifyvm "Linux Guest" --nataliasmode1 sameports</screen>
1225 The first example disables aliasing and switches NAT into transparent
1226 mode, the second example enforces preserving of port values. These modes
1227 can be combined if necessary.</para>
1228 </sect2>
1229 </sect1>
1230
1231 <sect1 id="changedmi">
1232 <title>Configuring the BIOS DMI information</title>
1233
1234 <para>The DMI data VirtualBox provides to guests can be changed for a
1235 specific VM. Use the following commands to configure the DMI BIOS
1236 information:</para>
1237
1238 <screen>VBoxManage setextradata "VM name"
1239 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "BIOS Vendor"
1240VBoxManage setextradata "VM name"
1241 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "BIOS Version"
1242VBoxManage setextradata "VM name"
1243 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "BIOS Release Date"
1244VBoxManage setextradata "VM name"
1245 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMajor" 1
1246VBoxManage setextradata "VM name"
1247 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMinor" 2
1248VBoxManage setextradata "VM name"
1249 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMajor" 3
1250VBoxManage setextradata "VM name"
1251 "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMinor" 4
1252VBoxManage setextradata "VM name"
1253 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "System Vendor"
1254VBoxManage setextradata "VM name"
1255 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "System Product"
1256VBoxManage setextradata "VM name"
1257 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "System Version"
1258VBoxManage setextradata "VM name"
1259 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "System Serial"
1260VBoxManage setextradata "VM name"
1261 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSKU" "System SKU"
1262VBoxManage setextradata "VM name"
1263 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily" "System Family"
1264VBoxManage setextradata "VM name"
1265 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid"
1266 "9852bf98-b83c-49db-a8de-182c42c7226b"</screen>
1267
1268 <para>If a DMI string is not set, the default value of VirtualBox is used.
1269 To set an empty string use
1270 <computeroutput>"&lt;EMPTY&gt;"</computeroutput>.</para>
1271
1272 <para>Note that in the above list, all quoted parameters (DmiBIOSVendor,
1273 DmiBIOSVersion but not DmiBIOSReleaseMajor) are expected to be strings. If
1274 such a string is a valid number, the parameter is treated as number and
1275 the VM will most probably refuse to start with an
1276 <computeroutput>VERR_CFGM_NOT_STRING</computeroutput> error. In that case,
1277 use <computeroutput>"string:&lt;value&gt;"</computeroutput>, for instance
1278 <screen>VBoxManage setextradata "VM name"
1279 "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "string:1234"</screen></para>
1280
1281 <para>Changing this information can be necessary to provide the DMI
1282 information of the host to the guest to prevent Windows from asking for a
1283 new product key. On Linux hosts the DMI BIOS information can be obtained
1284 with <screen>dmidecode -t0</screen>and the DMI system information can be
1285 obtained with <screen>dmidecode -t1</screen></para>
1286 </sect1>
1287
1288 <sect1>
1289 <title>Fine-tuning timers and time synchronization</title>
1290
1291 <sect2 id="changetscmode">
1292 <title>Configuring the guest time stamp counter (TSC) to reflect guest
1293 execution</title>
1294
1295 <para>By default, VirtualBox keeps all sources of time visible to the
1296 guest synchronized to a single time source, the monotonic host time.
1297 This reflects the assumptions of many guest operating systems, which
1298 expect all time sources to reflect "wall clock" time. In special
1299 circumstances it may be useful however to make the TSC (time stamp
1300 counter) in the guest reflect the time actually spent executing the
1301 guest.</para>
1302
1303 <para>This special TSC handling mode can be enabled on a per-VM basis,
1304 and for best results must be used only in combination with hardware
1305 virtualization. To enable this mode use the following command:</para>
1306
1307 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/TSCTiedToExecution" 1</screen>
1308
1309 <para>To revert to the default TSC handling mode use:</para>
1310
1311 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/TSCTiedToExecution"</screen>
1312
1313 <para>Note that if you use the special TSC handling mode with a guest
1314 operating system which is very strict about the consistency of time
1315 sources you may get a warning or error message about the timing
1316 inconsistency. It may also cause clocks to become unreliable with some
1317 guest operating systems depending on they use the TSC.</para>
1318 </sect2>
1319
1320 <sect2 id="warpguest">
1321 <title>Accelerate or slow down the guest clock</title>
1322
1323 <para>For certain purposes it can be useful to accelerate or to slow
1324 down the (virtual) guest clock. This can be achieved as follows:</para>
1325
1326 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 200</screen>
1327
1328 <para>The above example will double the speed of the guest clock
1329 while</para>
1330
1331 <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 50</screen>
1332
1333 <para>will halve the speed of the guest clock. Note that changing the
1334 rate of the virtual clock can confuse the guest and can even lead to
1335 abnormal guest behavior. For instance, a higher clock rate means shorter
1336 timeouts for virtual devices with the result that a slightly increased
1337 response time of a virtual device due to an increased host load can
1338 cause guest failures. Note further that any time synchronization
1339 mechanism will frequently try to resynchronize the guest clock with the
1340 reference clock (which is the host clock if the VirtualBox Guest
1341 Additions are active). Therefore any time synchronization should be
1342 disabled if the rate of the guest clock is changed as described above
1343 (see <xref linkend="changetimesync" />).</para>
1344 </sect2>
1345
1346 <sect2 id="changetimesync">
1347 <title>Tuning the Guest Additions time synchronization
1348 parameters</title>
1349
1350 <para>The VirtualBox Guest Additions ensure that the guest's system time
1351 is synchronized with the host time. There are several parameters which
1352 can be tuned. The parameters can be set for a specific VM using the
1353 following command:</para>
1354
1355 <screen>VBoxManage guestproperty set VM_NAME "/VirtualBox/GuestAdd/VBoxService/PARAMETER" VALUE</screen>
1356
1357 <para>where <computeroutput>PARAMETER</computeroutput> is one of the
1358 following:</para>
1359
1360 <para><glosslist>
1361 <glossentry>
1362 <glossterm><computeroutput>--timesync-interval</computeroutput></glossterm>
1363
1364 <glossdef>
1365 <para>Specifies the interval at which to synchronize the time
1366 with the host. The default is 10000 ms (10 seconds).</para>
1367 </glossdef>
1368 </glossentry>
1369
1370 <glossentry>
1371 <glossterm><computeroutput>--timesync-min-adjust</computeroutput></glossterm>
1372
1373 <glossdef>
1374 <para>The minimum absolute drift value measured in milliseconds
1375 to make adjustments for. The default is 1000 ms on OS/2 and 100
1376 ms elsewhere.</para>
1377 </glossdef>
1378 </glossentry>
1379
1380 <glossentry>
1381 <glossterm><computeroutput>--timesync-latency-factor</computeroutput></glossterm>
1382
1383 <glossdef>
1384 <para>The factor to multiply the time query latency with to
1385 calculate the dynamic minimum adjust time. The default is 8
1386 times, that means in detail: Measure the time it takes to
1387 determine the host time (the guest has to contact the VM host
1388 service which may take some time), multiply this value by 8 and
1389 do an adjustment only if the time difference between host and
1390 guest is bigger than this value. Don't do any time adjustment
1391 otherwise.</para>
1392 </glossdef>
1393 </glossentry>
1394
1395 <glossentry>
1396 <glossterm><computeroutput>--timesync-max-latency</computeroutput></glossterm>
1397
1398 <glossdef>
1399 <para>The max host timer query latency to accept. The default is
1400 250 ms.</para>
1401 </glossdef>
1402 </glossentry>
1403
1404 <glossentry>
1405 <glossterm><computeroutput>--timesync-set-threshold</computeroutput></glossterm>
1406
1407 <glossdef>
1408 <para>The absolute drift threshold, given as milliseconds where
1409 to start setting the time instead of trying to smoothly adjust
1410 it. The default is 20 minutes.</para>
1411 </glossdef>
1412 </glossentry>
1413
1414 <glossentry>
1415 <glossterm><computeroutput>--timesync-set-start</computeroutput></glossterm>
1416
1417 <glossdef>
1418 <para>Set the time when starting the time sync service.</para>
1419 </glossdef>
1420 </glossentry>
1421
1422 <glossentry>
1423 <glossterm><computeroutput>--timesync-set-on-restore
1424 0|1</computeroutput></glossterm>
1425
1426 <glossdef>
1427 <para>Set the time after the VM was restored from a saved state
1428 when passing 1 as parameter (default). Disable by passing 0. In
1429 the latter case, the time will be adjusted smoothly which can
1430 take a long time.</para>
1431 </glossdef>
1432 </glossentry>
1433 </glosslist></para>
1434
1435 <para>All these parameters can be specified as command line parameters
1436 to VBoxService as well.</para>
1437 </sect2>
1438 </sect1>
1439
1440 <sect1 id="vboxbowsolaris11">
1441 <title>Installing the alternate bridged networking driver on Solaris 11
1442 hosts</title>
1443
1444 <para>Starting with VirtualBox 4.1, VirtualBox ships a new network filter
1445 driver that utilizes Solaris 11's Crossbow functionality. By default, this
1446 new driver is installed for Solaris 11 hosts (builds 159 and above) that
1447 has support for it.</para>
1448
1449 <para>To force installation of the older STREAMS based network filter
1450 driver, execute as root execute the below command before installing the
1451 VirtualBox package:</para>
1452
1453 <screen>touch /etc/vboxinst_vboxflt</screen>
1454
1455 <para>To force installation of the Crossbow based network filter driver,
1456 execute as root the below command before installing the VirtualBox
1457 package:</para>
1458
1459 <screen>touch /etc/vboxinst_vboxbow</screen>
1460
1461 <para>To check which driver is currently being used by VirtualBox,
1462 execute:</para>
1463
1464 <screen>modinfo | grep vbox</screen>
1465
1466 <para>If the output contains "vboxbow", it indicates VirtualBox is using
1467 the Crossbow network filter driver, while the name "vboxflt" indicates
1468 usage of the older STREAMS network filter.</para>
1469 </sect1>
1470
1471 <sect1 id="vboxbowvnictemplates">
1472 <title>VirtualBox VNIC templates for VLANs on Solaris 11 hosts</title>
1473
1474 <para>VirtualBox supports VNIC (Virtual Network Interface) templates for
1475 configuring VMs over VLANs.<footnote>
1476 <para>Support for Crossbow based bridged networking was introduced
1477 with VirtualBox 4.1 and requires Solaris 11 build 159 or above.</para>
1478 </footnote> A VirtualBox VNIC template is a VNIC whose name starts with
1479 "vboxvnic_template".</para>
1480
1481 <para>Here is an example of how to use a VNIC template to configure a VLAN
1482 for VMs. Create a VirtualBox VNIC template, by executing as root:</para>
1483
1484 <screen>dladm create-vnic -t -l nge0 -v 23 vboxvnic_template0
1485</screen>
1486
1487 <para>This will create a temporary VNIC over interface "nge0" with the
1488 VLAN ID 23. To create VNIC templates that are persistent across host
1489 reboots, skip the <computeroutput>-t</computeroutput> parameter in the
1490 above command. You may check the current state of links using:</para>
1491
1492 <para><screen>$ dladm show-link
1493LINK CLASS MTU STATE BRIDGE OVER
1494nge0 phys 1500 up -- --
1495nge1 phys 1500 down -- --
1496vboxvnic_template0 vnic 1500 up -- nge0
1497
1498$ dladm show-vnic
1499LINK OVER SPEED MACADDRESS MACADDRTYPE VID
1500vboxvnic_template0 nge0 1000 2:8:20:25:12:75 random 23
1501</screen></para>
1502
1503 <para>Once the VNIC template is created, all VMs that need to be part of
1504 VLAN 23 over the physical interface "nge0" can use the same VNIC template.
1505 This makes managing VMs on VLANs simpler and efficient, as the VLAN
1506 details are not stored as part of every VM's configuration but rather
1507 picked from the VNIC template which can be modified anytime using
1508 <computeroutput>dladm</computeroutput>. Apart from the VLAN ID, VNIC
1509 templates can be created with additional properties such as bandwidth
1510 limits, CPU fanout etc. Refer to your Solaris network documentation on how
1511 to accomplish this. These additional properties, if any, are also applied
1512 to VMs which use the VNIC template.</para>
1513 </sect1>
1514
1515 <sect1 id="addhostonlysolaris">
1516 <title>Configuring multiple host-only network interfaces on Solaris
1517 hosts</title>
1518
1519 <para>By default VirtualBox provides you with one host-only network
1520 interface. Adding more host-only network interfaces on Solaris hosts
1521 requires manual configuration. Here's how to add two more host-only
1522 network interfaces.</para>
1523
1524 <para>You first need to stop all running VMs and unplumb all existing
1525 "vboxnet" interfaces. Execute the following commands as root:</para>
1526
1527 <screen>ifconfig vboxnet0 unplumb</screen>
1528
1529 <para>Once you make sure all vboxnet interfaces are unplumbed, remove the
1530 driver using:</para>
1531
1532 <para><screen>rem_drv vboxnet</screen>then edit the file
1533 <computeroutput>/platform/i86pc/kernel/drv/vboxnet.conf</computeroutput>
1534 and add a line for the new interfaces:</para>
1535
1536 <para><screen>name="vboxnet" parent="pseudo" instance=1;
1537name="vboxnet" parent="pseudo" instance=2;</screen>Add as many of these lines
1538 as required and make sure "instance" number is uniquely incremented. Next
1539 reload the vboxnet driver using:</para>
1540
1541 <para><screen>add_drv vboxnet</screen>Now plumb all the interfaces using
1542 <computeroutput>ifconfig vboxnetX plumb</computeroutput> (where X can be
1543 0, 1 or 2 in this case) and once plumbed you can then configure the
1544 interface like any other network interface.</para>
1545
1546 <para>To make your newly added interfaces' settings persistent across
1547 reboots you will need to edit the files
1548 <computeroutput>/etc/netmasks</computeroutput>, and if you are using NWAM
1549 <computeroutput>/etc/nwam/llp</computeroutput> and add the appropriate
1550 entries to set the netmask and static IP for each of those interfaces. The
1551 VirtualBox installer only updates these configuration files for the one
1552 "vboxnet0" interface it creates by default.</para>
1553 </sect1>
1554
1555 <sect1 id="solariscodedumper">
1556 <title>Configuring the VirtualBox CoreDumper on Solaris hosts</title>
1557
1558 <para>VirtualBox is capable of producing its own core files for extensive
1559 debugging when things go wrong. Currently this is only available on
1560 Solaris hosts.</para>
1561
1562 <para>The VirtualBox CoreDumper can be enabled using the following
1563 command:</para>
1564
1565 <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpEnabled 1</screen></para>
1566
1567 <para>You can specify which directory to use for core dumps with this
1568 command:</para>
1569
1570 <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpDir &lt;path-to-directory&gt;</screen>Make
1571 sure the directory you specify is on a volume with sufficient free space
1572 and that the VirtualBox process has sufficient permissions to write files
1573 to this directory. If you skip this command and don't specify any core
1574 dump directory, the current directory of the VirtualBox executable will be
1575 used (which would most likely fail when writing cores as they are
1576 protected with root permissions). It is recommended you explicitly set a
1577 core dump directory.</para>
1578
1579 <para>You must specify when the VirtualBox CoreDumper should be triggered.
1580 This is done using the following commands:</para>
1581
1582 <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpReplaceSystemDump 1
1583VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpLive 1</screen>At
1584 least one of the above two commands will have to be provided if you have
1585 enabled the VirtualBox CoreDumper.</para>
1586
1587 <para>Setting <computeroutput>CoreDumpReplaceSystemDump</computeroutput>
1588 sets up the VM to override the host's core dumping mechanism and in the
1589 event of any crash only the VirtualBox CoreDumper would produce the core
1590 file.</para>
1591
1592 <para>Setting <computeroutput>CoreDumpLive</computeroutput> sets up the VM
1593 to produce cores whenever the VM process receives a
1594 <computeroutput>SIGUSR2</computeroutput> signal. After producing the core
1595 file, the VM will not be terminated and will continue to run. You can thus
1596 take cores of the VM process using:</para>
1597
1598 <para><screen>kill -s SIGUSR2 &lt;VM-process-id&gt;</screen></para>
1599
1600 <para>Core files produced by the VirtualBox CoreDumper are of the form
1601 <computeroutput>core.vb.&lt;ProcessName&gt;.&lt;ProcessID&gt;</computeroutput>,
1602 e.g.<computeroutput>core.vb.VBoxHeadless.11321</computeroutput>.</para>
1603 </sect1>
1604
1605 <sect1 id="guitweaks">
1606 <title>Locking down the VirtualBox manager GUI</title>
1607
1608 <para>There are several advanced customization settings for locking down
1609 the VirtualBox manager, that is, removing some features that the user
1610 should not see.<screen>VBoxManage setextradata global GUI/Customizations OPTION[,OPTION...]</screen></para>
1611
1612 <para>where <computeroutput>OPTION</computeroutput> is one of the
1613 following keywords:<glosslist>
1614 <glossentry>
1615 <glossterm><computeroutput>noSelector</computeroutput></glossterm>
1616
1617 <glossdef>
1618 <para>Don't allow to start the VirtualBox manager. Trying to do so
1619 will show a window containing a proper error message.</para>
1620 </glossdef>
1621 </glossentry>
1622
1623 <glossentry>
1624 <glossterm><computeroutput>noMenuBar</computeroutput></glossterm>
1625
1626 <glossdef>
1627 <para>VM windows will not contain a menu bar.</para>
1628 </glossdef>
1629 </glossentry>
1630
1631 <glossentry>
1632 <glossterm><computeroutput>noStatusBar</computeroutput></glossterm>
1633
1634 <glossdef>
1635 <para>VM windows will not contain a status bar.</para>
1636 </glossdef>
1637 </glossentry>
1638 </glosslist></para>
1639
1640 <para>To disable any GUI customization do <screen>VBoxManage setextradata global GUI/Customizations</screen></para>
1641
1642 <para>To disable all host key combinations, open the preferences and
1643 change the host key to <emphasis>None</emphasis>. This might be useful
1644 when using VirtualBox in a kiosk mode.</para>
1645
1646 <para>Furthermore, you can disallow certain actions when terminating a VM.
1647 To disallow specific actions, type:</para>
1648
1649 <para><screen>VBoxManage setextradata "VM name" GUI/RestrictedCloseActions OPTION[,OPTION...]</screen></para>
1650
1651 <para>where <computeroutput>OPTION</computeroutput> is one of the
1652 following keywords:<glosslist>
1653 <glossentry>
1654 <glossterm><computeroutput>SaveState</computeroutput></glossterm>
1655
1656 <glossdef>
1657 <para>Don't allow the user to save the VM state when terminating
1658 the VM.</para>
1659 </glossdef>
1660 </glossentry>
1661
1662 <glossentry>
1663 <glossterm><computeroutput>Shutdown</computeroutput></glossterm>
1664
1665 <glossdef>
1666 <para>Don't allow the user to shutdown the VM by sending the ACPI
1667 power-off event to the guest.</para>
1668 </glossdef>
1669 </glossentry>
1670
1671 <glossentry>
1672 <glossterm><computeroutput>PowerOff</computeroutput></glossterm>
1673
1674 <glossdef>
1675 <para>Don't allow the user to power off the VM.</para>
1676 </glossdef>
1677 </glossentry>
1678
1679 <glossentry>
1680 <glossterm><computeroutput>Restore</computeroutput></glossterm>
1681
1682 <glossdef>
1683 <para>Don't allow the user to return to the last snapshot when
1684 powering off the VM.</para>
1685 </glossdef>
1686 </glossentry>
1687 </glosslist></para>
1688
1689 <para>Any combination of the above is allowed. If all options are
1690 specified, the VM cannot be shut down at all.</para>
1691 </sect1>
1692
1693 <sect1 id="vboxwebsrv-daemon">
1694 <title>Starting the VirtualBox web service automatically</title>
1695
1696 <para>The VirtualBox web service
1697 (<computeroutput>vboxwebsrv</computeroutput>) is used for controlling
1698 VirtualBox remotely. It is documented in detail in the VirtualBox Software
1699 Development Kit (SDK); please see <xref linkend="VirtualBoxAPI" />. As the
1700 client base using this interface is growing, we added start scripts for
1701 the various operation systems we support. The following describes how to
1702 use them. <itemizedlist>
1703 <listitem>
1704 <para>On Mac OS X, launchd is used. An example configuration file
1705 can be found in
1706 <computeroutput>$HOME/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist</computeroutput>.
1707 It can be enabled by changing the
1708 <computeroutput>Disabled</computeroutput> key from
1709 <computeroutput>true</computeroutput> to
1710 <computeroutput>false</computeroutput>. To manually start the
1711 service use the following command: <screen>launchctl load ~/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist</screen>
1712 For additional information on how launchd services could be
1713 configured see <literal><ulink
1714 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>
1715 </listitem>
1716 </itemizedlist></para>
1717 </sect1>
1718
1719 <sect1 id="vboxballoonctrl">
1720 <title>Memory Ballooning Service</title>
1721
1722 <para>Starting with VirtualBox 4.0.8 a new host executable called
1723 <computeroutput>VBoxBalloonCtrl</computeroutput> is available to
1724 automatically take care of a VM's configured memory balloon (see <xref
1725 linkend="guestadd-balloon" /> for an introduction to memory ballooning).
1726 This is especially useful for server environments where VMs may
1727 dynamically require more or less memory during runtime.</para>
1728
1729 <para>VBoxBalloonCtrl periodically checks a VM's current memory balloon
1730 and its free guest RAM and automatically adjusts the current memory
1731 balloon by inflating or deflating it accordingly. This handling only
1732 applies to running VMs having recent Guest Additions installed.</para>
1733
1734 <para>To set up VBoxBalloonCtrl and adjust the maximum ballooning size a
1735 VM can reach the following parameters will be checked in the following
1736 order: <itemizedlist>
1737 <listitem>
1738 specified via VBoxBalloonCtrl command line parameter
1739
1740 <computeroutput>--balloon-max</computeroutput>
1741 </listitem>
1742
1743 <listitem>
1744 per-VM parameter using
1745
1746 <screen>VBoxManage setextradata "VM-Name" VBoxInternal/Guest/BalloonSizeMax &lt;Size in MB&gt;</screen>
1747 </listitem>
1748
1749 <listitem>
1750 global parameter for all VMs using
1751
1752 <screen>VBoxManage setextradata global VBoxInternal/Guest/BalloonSizeMax &lt;Size in MB&gt;</screen>
1753 </listitem>
1754 </itemizedlist> <note>
1755 <para>If no maximum ballooning size is specified by at least one of
1756 the parameters above, no ballooning will be performed at all.</para>
1757 </note></para>
1758
1759 <para>For more options and parameters check the built-in command line help
1760 accessible with <computeroutput>--help</computeroutput>.</para>
1761 </sect1>
1762</chapter>
Note: See TracBrowser for help on using the repository browser.

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