VirtualBox

source: vbox/trunk/doc/manual/en_US/user_Frontends.xml@ 34690

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

Manual: fixes

File size: 32.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>
5 <title>Remote virtual machines</title>
6
7 <sect1>
8 <title id="vrdp">Remote display (VRDP support)</title>
9
10 <para>VirtualBox has a built-in server for the VirtualBox Remote Desktop
11 Protocol (VRDP). This allows you to see the output of a virtual machine's
12 window remotely on any other computer and control the virtual machine from
13 there, as if the virtual machine was running locally.</para>
14
15 <para>VRDP is a backwards-compatible extension to Microsoft's Remote
16 Desktop Protocol (RDP). Typically graphics updates and audio are sent from
17 the remote machine to the client, while keyboard and mouse events are sent
18 back. As a result, you can use any standard RDP client to control the
19 remote VM.<note>
20 <para>VRDP support is shipped as as a VirtualBox extension package,
21 the VirtualBox Remote Desktop Extension (VRDE), which must be
22 installed separately. See <xref linkend="intro-installing" /> for more
23 installation.</para>
24 </note></para>
25
26 <para>The VRDP server is disabled by default. If the extension pack is
27 installed, it can easily be enabled on a per-VM basis either in the
28 VirtualBox Manager in the "Display" settings (see <xref
29 linkend="settings-display" />) or with
30 <computeroutput>VBoxManage</computeroutput>:<screen>VBoxManage modifyvm "VM name" --vrde on</screen></para>
31
32 <para>If you use <computeroutput>VBoxHeadless</computeroutput> (described
33 further below), VRDP support will be automatically enabled since
34 VBoxHeadless has no other means of output.</para>
35
36 <sect2 id="rdp-viewers">
37 <title>Common third-party RDP viewers</title>
38
39 <para>Since VRDP is backwards-compatible to RDP, you can use any
40 standard RDP viewer to connect to such a remote virtual machine
41 (examples follow below). For this to work, you must specify the
42 <emphasis role="bold">IP address</emphasis> of your
43 <emphasis>host</emphasis> system (not of the virtual machine!) as the
44 server address to connect to, as well as the <emphasis role="bold">port
45 number</emphasis> that the RDP server is using.</para>
46
47 <para>By default, VRDP uses TCP port
48 <computeroutput>3389</computeroutput>. You will need to change the
49 default port if you run more than one VRDP server, since the port can
50 only be used by one server at a time; you might also need to change it
51 on Windows hosts since the default port might already be used by the RDP
52 server that is built into Windows itself. Ports 5000 through 5050 are
53 typically not used and might be a good choice.</para>
54
55 <para>The port can be changed either in the "Display" settings of the
56 graphical user interface or with
57 <computeroutput>--vrdpport</computeroutput> option of the
58 <computeroutput>VBoxManage modifyvm</computeroutput> command. You can
59 specify a comma-separated list of ports or ranges of ports. Use a dash
60 between two port numbers to specify a range. The VRDP server will bind
61 to <emphasis role="bold">one</emphasis> of available ports from the
62 specified list. For example, <computeroutput>VBoxManage modifyvm "VM
63 name" --vrdeport 5000,5010-5012</computeroutput> will configure the
64 server to bind to one of the ports 5000, 5010, 5011 or 5012. See <xref
65 linkend="vboxmanage-modifyvm" /> for details.</para>
66
67 <para>The actual port used by a running VM can be either queried with
68 <computeroutput>VBoxManage showvminfo</computeroutput> command or seen
69 in the GUI on the "Runtime" tab of the "Session Information Dialog",
70 which is accessible via the "Machine" menu of the VM window.</para>
71
72 <para>Here follow examples for the most common RDP viewers:<itemizedlist>
73 <listitem>
74 <para>On Windows, you can use the Microsoft Terminal Services
75 Connector (<computeroutput>mstsc.exe</computeroutput>) that ships
76 with Windows. You can start it by bringing up the "Run" dialog
77 (press the Windows key and "R") and typing "mstsc". You can also
78 find it under "Start" -&gt; "All Programs" -&gt; "Accessories"
79 -&gt; "Remote Desktop Connection". If you use the "Run" dialog,
80 you can type in options directly:<screen>mstsc 1.2.3.4[:3389]</screen></para>
81
82 <para>Replace "1.2.3.4" with the host IP address, and 3389 with a
83 different port if necessary.</para>
84
85 <note>
86 <para>When connecting to localhost in order to test the
87 connection, the addresses
88 <computeroutput>localhost</computeroutput> and
89 <computeroutput>127.0.0.1</computeroutput> might not work using
90 <computeroutput>mstsc.exe</computeroutput>. Instead, the address
91 <computeroutput>127.0.0.2[:3389]</computeroutput> has to be
92 used.</para>
93 </note>
94 </listitem>
95
96 <listitem>
97 <para>On other systems, you can use the standard open-source
98 <computeroutput>rdesktop</computeroutput> program. This ships with
99 most Linux distributions, but VirtualBox also comes with a
100 modified variant of rdesktop for remote USB support (see <xref
101 linkend="usb-over-rdp" /> below).</para>
102
103 <para>With rdesktop, use a command line such as the
104 following:<screen>rdesktop -a 16 -N 1.2.3.4:3389</screen></para>
105
106 <para>As said for the Microsoft viewer above, replace "1.2.3.4"
107 with the host IP address, and 3389 with a different port if
108 necessary. The <computeroutput>-a 16</computeroutput> option
109 requests a color depth of 16 bits per pixel, which we recommend.
110 (For best performance, after installation of the guest operating
111 system, you should set its display color depth to the same value).
112 The <computeroutput>-N</computeroutput> option enables use of the
113 NumPad keys.</para>
114 </listitem>
115
116 <listitem>
117 <para>If you run the KDE desktop, you might prefer
118 <computeroutput>krdc</computeroutput>, the KDE RDP viewer. The
119 command line would look like this:<screen>krdc --window --high-quality rdp:/1.2.3.4[:3389]</screen></para>
120
121 <para>Again, replace "1.2.3.4" with the host IP address, and 3389
122 with a different port if necessary. The "rdp:/" bit is required
123 with krdc to switch it into RDP mode.</para>
124 </listitem>
125 </itemizedlist></para>
126 </sect2>
127
128 <sect2 id="vboxheadless">
129 <title>VBoxHeadless, the VRDP-only server</title>
130
131 <para>While any VM started from the VirtualBox Manager is capable of
132 running virtual machines remotely, it is not convenient to have to run
133 the full-fledged GUI if you never want to have VMs displayed locally in
134 the first place. In particular, if you are running servers whose only
135 purpose is to host VMs, and all your VMs are supposed to run remotely
136 over VRDP, then it is pointless to have a graphical user interface on
137 the server at all -- especially since, on a Linux or Solaris host, the
138 VirtualBox manager comes with dependencies on the Qt and SDL libraries,
139 which is inconvenient if you would rather not have the X Window system
140 on your server at all.</para>
141
142 <para>VirtualBox therefore comes with yet another front-end called
143 <computeroutput>VBoxHeadless</computeroutput>, which produces no visible
144 output on the host at all, but instead only delivers VRDP data.<footnote>
145 <para>Before VirtualBox 1.6, the headless server was called
146 <computeroutput>VBoxVRDP</computeroutput>. For the sake of backwards
147 compatibility, the VirtualBox installation still installs an
148 executable with that name as well.</para>
149 </footnote></para>
150
151 <para>To start a virtual machine with VBoxHeadless, you have two
152 options:</para>
153
154 <itemizedlist>
155 <listitem>
156 <para>You can use <screen>VBoxManage startvm "VM name" --type headless</screen>
157 The extra <computeroutput>--type</computeroutput> option causes the
158 VirtualBox core to use <computeroutput>VBoxHeadless</computeroutput>
159 as the front-end to the internal virtualization engine.</para>
160 </listitem>
161
162 <listitem>
163 <para>The alternative is to use
164 <computeroutput>VBoxHeadless</computeroutput> directly, as
165 follows:<screen>VBoxHeadless --startvm &lt;uuid|name&gt;</screen></para>
166
167 <para>This way of starting the VM has the advantage that you can see
168 more detailed error messages, especially for early failures before
169 the VM execution is started. If you have trouble with
170 <computeroutput>VBoxManage startvm</computeroutput>, it can help
171 greatly to start <computeroutput>VBoxHeadless</computeroutput>
172 directly to diagnose the problem cause.</para>
173 </listitem>
174 </itemizedlist>
175
176 <para>Note that when you use
177 <computeroutput>VBoxHeadless</computeroutput> to start a VM, since the
178 headless server has no other means of output, the built-in RDP server
179 will <emphasis>always</emphasis> be enabled, regardless of whether you
180 have enabled the VRDP server in the VM's settings. If this is
181 undesirable (for example because you want to access the VM via
182 <computeroutput>ssh</computeroutput> only), start the VM like
183 this:<screen>VBoxHeadless --startvm &lt;uuid|name&gt; --vrdp=off</screen>To
184 have the VRDP server use the setting from the VM configuration, as the
185 other front-ends would, use this:<screen>VBoxHeadless --startvm &lt;uuid|name&gt; --vrdp=config</screen></para>
186 </sect2>
187
188 <sect2>
189 <title>Step by step: creating a virtual machine on a headless
190 server</title>
191
192 <para>The following instructions may give you an idea how to create a
193 virtual machine on a headless server over a network connection. We will
194 create a virtual machine, establish an RDP connection and install a
195 guest operating system -- all without having to touch the headless
196 server. All you need is the following:</para>
197
198 <para><orderedlist>
199 <listitem>
200 <para>VirtualBox on a server machine with a supported host
201 operating system; for the following example, we will assume a
202 Linux server;</para>
203 </listitem>
204
205 <listitem>
206 <para>an ISO file on the server, containing the installation data
207 for the guest operating system to install (we will assume Windows
208 XP in the following example);</para>
209 </listitem>
210
211 <listitem>
212 <para>a terminal connection to that host over which you can access
213 a command line (e.g. via <computeroutput>telnet</computeroutput>
214 or <computeroutput>ssh</computeroutput>);</para>
215 </listitem>
216
217 <listitem>
218 <para>an RDP viewer on the remote client; see <xref
219 linkend="rdp-viewers" /> above for examples.</para>
220 </listitem>
221 </orderedlist>Note again that on the server machine, since we will
222 only use the headless server, neither Qt nor SDL nor the X Window system
223 will be needed.</para>
224
225 <para><orderedlist>
226 <listitem>
227 <para>On the headless server, create a new virtual machine:</para>
228
229 <screen>VBoxManage createvm --name "Windows XP" --ostype WindowsXP --register</screen>
230
231 <para>Note that if you do not specify
232 <computeroutput>--register</computeroutput>, you will have to
233 manually use the registervm command later.</para>
234
235 <para>Note further that you do not need to specify
236 <computeroutput>--ostype</computeroutput> but doing so selects
237 some sane default values for certain VM parameters, for example
238 the RAM size and the type of the virtual network device. To get a
239 complete list of supported operating systems you can use</para>
240
241 <screen>VBoxManage list ostypes</screen>
242 </listitem>
243
244 <listitem>
245 <para>Make sure the settings for this VM are appropriate for the
246 guest operating system that we will install. For example:<screen>VBoxManage modifyvm "Windows XP" --memory 256 --acpi on --boot1 dvd --nic1 nat</screen></para>
247 </listitem>
248
249 <listitem>
250 <para>Create a virtual hard disk for the VM (in this case, 10GB in
251 size) and register it with VirtualBox:<screen>VBoxManage createhd --filename "WinXP.vdi" --size 10000 --remember</screen></para>
252 </listitem>
253
254 <listitem>
255 <para>Add an IDE Controller to the new VM:<screen>VBoxManage storagectl "Windows XP" --name "IDE Controller"
256 --add ide --controller PIIX4</screen></para>
257 </listitem>
258
259 <listitem>
260 <para>Set this newly created VDI file as the first virtual hard
261 disk of the new VM:<screen>VBoxManage storageattach "Windows XP" --storagectl "IDE Controller"
262 --port 0 --device 0 --type hdd --medium "WinXP.vdi"</screen></para>
263 </listitem>
264
265 <listitem>
266 <para>Attach the ISO file that contains the operating system
267 installation that you want to install later to the virtual
268 machine, so the machine can boot from it:<screen>VBoxManage storageattach "Windows XP" --storagectl "IDE Controller"
269 --port 0 --device 1 --type dvddrive --medium /full/path/to/iso.iso</screen></para>
270 </listitem>
271
272 <listitem>
273 <para>Start the virtual machine using VBoxHeadless:<screen>VBoxHeadless --startvm "Windows XP"</screen></para>
274
275 <para>If everything worked, you should see a copyright notice. If,
276 instead, you are returned to the command line, then something went
277 wrong.</para>
278 </listitem>
279
280 <listitem>
281 <para>On the client machine, fire up the RDP viewer and try to
282 connect to the server (see <xref linkend="rdp-viewers" /> above
283 for how to use various common RDP viewers).</para>
284
285 <para>You should now be seeing the installation routine of your
286 guest operating system in the RDP viewer.</para>
287 </listitem>
288 </orderedlist></para>
289 </sect2>
290
291 <sect2 id="usb-over-rdp">
292 <title>Remote USB</title>
293
294 <para>As a special feature on top of the VRDP support, VirtualBox
295 supports remote USB devices over the wire as well. That is, the
296 VirtualBox guest that runs on one computer can access the USB devices of
297 the remote computer on which the VRDP data is being displayed the same
298 way as USB devices that are connected to the actual host. This allows
299 for running virtual machines on a VirtualBox host that acts as a server,
300 where a client can connect from elsewhere that needs only a network
301 adapter and a display capable of running an RDP viewer. When USB devices
302 are plugged into the client, the remote VirtualBox server can access
303 them.</para>
304
305 <para>For these remote USB devices, the same filter rules apply as for
306 other USB devices, as described with <xref linkend="settings-usb" />.
307 All you have to do is specify "Remote" (or "Any") when setting up these
308 rules.</para>
309
310 <para>Accessing remote USB devices is only possible if the RDP client
311 supports this extension. On Linux and Solaris hosts, the VirtualBox
312 installation provides a suitable VRDP client called
313 <computeroutput>rdesktop-vrdp</computeroutput>. RDP clients for other
314 platforms will be provided in future VirtualBox versions.</para>
315
316 <para>To make a remote USB device available to a VM,
317 <computeroutput>rdesktop-vrdp</computeroutput> should be started as
318 follows:<screen>rdesktop-vrdp -r usb -a 16 -N my.host.address</screen>Note
319 that <computeroutput>rdesktop-vrdp</computeroutput> can access USB
320 devices only through <computeroutput>/proc/bus/usb</computeroutput>.
321 Please refer to <xref linkend="usb_linux" /> for further details on how
322 to properly set up the permissions. Furthermore it is advisable to
323 disable automatic loading of any host driver on the remote host which
324 might work on USB devices to ensure that the devices are accessible by
325 the RDP client. If the setup was properly done on the remote host,
326 plug/unplug events are visible on the VBox.log file of the VM.</para>
327 </sect2>
328
329 <sect2 id="vbox-auth">
330 <title>RDP authentication</title>
331
332 <para>For each virtual machine that is remotely accessible via RDP, you
333 can individually determine if and how RDP connections are
334 authenticated.</para>
335
336 <para>For this, use <computeroutput>VBoxManage modifyvm</computeroutput>
337 command with the <computeroutput>--vrdeauthtype</computeroutput> option;
338 see <xref linkend="vboxmanage-modifyvm" /> for a general introduction.
339 Three methods of authentication are available:<itemizedlist>
340 <listitem>
341 <para>The "null" method means that there is no authentication at
342 all; any client can connect to the VRDP server and thus the
343 virtual machine. This is, of course, very insecure and only to be
344 recommended for private networks.</para>
345 </listitem>
346
347 <listitem>
348 <para>The "external" method provides external authentication
349 through a special authentication library.</para>
350
351 <para>VirtualBox comes with three default libraries for external
352 authentication:<itemizedlist>
353 <listitem>
354 <para>On Linux hosts,
355 <computeroutput>VBoxAuth.so</computeroutput> authenticates
356 users against the host's PAM system.</para>
357 </listitem>
358
359 <listitem>
360 <para>On Windows hosts,
361 <computeroutput>VBoxAuth.dll</computeroutput> authenticates
362 users against the host's WinLogon system.</para>
363 </listitem>
364
365 <listitem>
366 <para>On Mac OS X hosts,
367 <computeroutput>VBoxAuth.dylib</computeroutput>
368 authenticates users against the host's directory
369 service.<footnote>
370 <para>Support for Mac OS X was added in version
371 3.2.</para>
372 </footnote></para>
373 </listitem>
374 </itemizedlist></para>
375
376 <para>In other words, the "external" method per default performs
377 authentication with the user accounts that exist on the host
378 system. Any user with valid authentication credentials is
379 accepted, i.e. the username does not have to correspond to the
380 user running the VM.</para>
381 </listitem>
382
383 <listitem>
384 <para>An additional library called
385 <computeroutput>VBoxAuthSimple</computeroutput> performs
386 authentication against credentials configured in the VM's extra
387 data section. This is probably the simplest way to get
388 authentication that does not depend on a running and supported
389 guest (see below). In order to enable VBoxAuthSimple, issue
390 <computeroutput>VBoxManage setproperty vrdeauthlibrary
391 "VBoxAuthSimple"</computeroutput>. To enable the library for a VM,
392 switch authentication to external using <computeroutput>VBoxManage
393 modifyvm "VM name" --vrdeauthtype external</computeroutput>. Last
394 but not least, you have to configure users and passwords. Here is
395 an example for the user "john" with the password "secret":
396 <computeroutput>VBoxManage internalcommands passwordhash
397 "secret"</computeroutput> This will give you the hash value
398 "2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b"
399 which you set using <computeroutput>VBoxManage setextradata "VM
400 name" "VBoxAuthSimple/users/john"
401 "2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b"</computeroutput>.</para>
402 </listitem>
403
404 <listitem>
405 <para>Finally, the "guest" authentication method performs
406 authentication with a special component that comes with the Guest
407 Additions; as a result, authentication is not performed with the
408 host users, but with the guest user accounts. This method is
409 currently still in testing and not yet supported.</para>
410 </listitem>
411 </itemizedlist></para>
412
413 <para>In addition to the methods described above, you can replace the
414 default "external authentication module with any other module. For this,
415 VirtualBox provides a well-defined interface that allows you to write
416 your own authentication module; see <xref
417 linkend="vbox-authenticate-sdk" /> for details.</para>
418 </sect2>
419
420 <sect2 id="vrdp-crypt">
421 <title>RDP encryption</title>
422
423 <para>RDP features data stream encryption, which is based on the RC4
424 symmetric cipher (with keys up to 128bit). The RC4 keys are being
425 replaced in regular intervals (every 4096 packets).</para>
426
427 <para>RDP provides three different authentication methods:<orderedlist>
428 <listitem>
429 <para>Historically, RDP4 authentication was used, with which the
430 RDP client does not perform any checks in order to verify the
431 identity of the server it connects to. Since user credentials can
432 be obtained using a man in the middle (MITM) attack, RDP4
433 authentication is insecure and should generally not be
434 used.</para>
435 </listitem>
436
437 <listitem>
438 <para>RDP5.1 authentication employs a server certificate for which
439 the client possesses the public key. This way it is guaranteed
440 that the server possess the corresponding private key. However, as
441 this hard-coded private key became public some years ago, RDP5.1
442 authentication is also insecure and cannot be recommended.</para>
443 </listitem>
444
445 <listitem>
446 <para>RDP5.2 authentication is based on TLS 1.0 with
447 customer-supplied certificates. The server supplies a certificate
448 to the client which must be signed by a certificate authority (CA)
449 that the client trusts (for the Microsoft RDP Client 5.2, the CA
450 has to be added to the Windows Trusted Root Certificate
451 Authorities database). VirtualBox allows you to supply your own CA
452 and server certificate and uses OpenSSL for encryption.</para>
453 </listitem>
454 </orderedlist></para>
455
456 <para>While VirtualBox supports all of the above, only RDP5.2
457 authentication should be used in environments where security is a
458 concern. As the client that connects to the server determines what type
459 of encryption will be used, with rdesktop, the Linux RDP viewer, use the
460 <computeroutput>-4</computeroutput> or
461 <computeroutput>-5</computeroutput> options.</para>
462 </sect2>
463
464 <sect2 id="vrdp-multiconnection">
465 <title>Multiple VRDP connections</title>
466
467 <para>The built-in RDP server of VirtualBox supports simultaneous
468 connections to the same running VM from different clients. All connected
469 clients see the same screen output and share a mouse pointer and
470 keyboard focus. This is similar to several people using the same
471 computer at the same time, taking turns at the keyboard.</para>
472
473 <para>The following command enables multiple connection mode: <screen>VBoxManage modifyvm "VM name" --vrdemulticon on</screen></para>
474 </sect2>
475
476 <sect2 id="vrdp-multimonitor">
477 <title>Multiple remote monitors</title>
478
479 <para>To access two or more remote VM displays you have to enable the
480 RDP multiconnection mode (see <xref
481 linkend="vrdp-multiconnection" />).</para>
482
483 <para>The RDP client can select the virtual monitor number to connect to
484 using the <computeroutput>domain</computeroutput> logon parameter
485 (<computeroutput>-d</computeroutput>). If the parameter ends with
486 <computeroutput>@</computeroutput> followed by a number, the VirtualBox
487 RDP server interprets this number as the screen index. The primary guest
488 screen is selected with <computeroutput>@1</computeroutput>, the first
489 secondary screen is <computeroutput>@2</computeroutput>, etc.</para>
490
491 <para>The MS RDP6 client does not let you specify a separate domain
492 name. Instead, use <computeroutput>domain\username</computeroutput> in
493 the <computeroutput>Username:</computeroutput> field -- for example,
494 <computeroutput>@2\name</computeroutput>.
495 <computeroutput>name</computeroutput> must be supplied, and must be the
496 name used to log in if the VRDP server is set up to require credentials.
497 If it is not, you may use any text as the username.</para>
498 </sect2>
499
500 <sect2 id="vrdp-videochannel">
501 <title>VRDP video redirection</title>
502
503 <para>Starting with VirtualBox 3.2, the RDP server can redirect video
504 streams from the guest to the RDP client. Video frames are compressed
505 using the JPEG algorithm allowing a higher compression ratio than
506 standard RDP bitmap compression methods. It is possible to increase the
507 compression ratio by lowering the video quality.</para>
508
509 <para>Video streams in a guest are detected by the RDP server
510 automatically as frequently updated rectangular areas. Therefore, this
511 method works with any guest operating system without having to install
512 additional software in the guest.</para>
513
514 <para>On the client side, however, currently only the Windows 7 Remote
515 Desktop Connection client supports this feature. If a client does not
516 support video redirection, the VRDP server uses regular bitmap
517 updates.</para>
518
519 <para>The following command enables video redirection: <screen>VBoxManage modifyvm "VM name" --vrdevideochannel on</screen></para>
520
521 <para>The quality of the video is defined as a value from 10 to 100
522 percent, as is common with JPEG compression. The quality can be changed
523 using the following command: <screen>VBoxManage modifyvm "VM name" --vrdpvideochannelquality 75</screen></para>
524 </sect2>
525
526 <sect2 id="vrdp-customization">
527 <title>VRDP customization</title>
528
529 <para>Starting with VirtualBox 3.2.10, it is possible to disable display
530 output, mouse and keyboard input, audio, remote USB or clipboard in the
531 VRDP server.</para>
532
533 <para>The following commands change corresponding server
534 settings:</para>
535
536 <screen>VBoxManage setextradata "VM name" "VRDP/Feature/Client/DisableDisplay" 1
537VBoxManage setextradata "VM name" "VRDP/Feature/Client/DisableInput" 1
538VBoxManage setextradata "VM name" "VRDP/Feature/Client/DisableUSB" 1
539VBoxManage setextradata "VM name" "VRDP/Feature/Client/DisableAudio" 1
540VBoxManage setextradata "VM name" "VRDP/Feature/Client/DisableClipboard" 1</screen>
541
542 <para>To reenable a feature use a similar command without the trailing
543 1. For example: <screen>VBoxManage setextradata "VM name" "VRDP/Feature/Client/DisableDisplay"</screen></para>
544 </sect2>
545 </sect1>
546
547 <sect1 id="teleporting">
548 <title>Teleporting</title>
549
550 <para>Starting with version 3.1, VirtualBox supports "teleporting" -- that
551 is, moving a virtual machine over a network from one VirtualBox host to
552 another, while the virtual machine is running. This works regardless of
553 the host operating system that is running on the hosts: you can teleport
554 virtual machines between Solaris and Mac hosts, for example.</para>
555
556 <para>Teleporting requires that a machine be currently running on one
557 host, which is then called the <emphasis role="bold">"source"</emphasis>.
558 The host to which the virtual machine will be teleported will then be
559 called the <emphasis role="bold">"target"</emphasis>; the machine on the
560 target is then configured to wait for the source to contact the target.
561 The machine's running state will then be transferred from the source to
562 the target with minimal downtime.</para>
563
564 <para>Teleporting happens over any TCP/IP network; the source and the
565 target only need to agree on a TCP/IP port which is specified in the
566 teleporting settings.</para>
567
568 <para>At this time, there are a few prerequisites for this to work,
569 however:<orderedlist>
570 <listitem>
571 <para>On the target host, you must configure a virtual machine in
572 VirtualBox with exactly the same hardware settings as the machine on
573 the source that you want to teleport. This does not apply to
574 settings which are merely descriptive, such as the VM name, but
575 obviously for teleporting to work, the target machine must have the
576 same amount of memory and other hardware settings. Otherwise
577 teleporting will fail with an error message.</para>
578 </listitem>
579
580 <listitem>
581 <para>The two virtual machines on the source and the target must
582 share the same storage (hard disks as well as floppy and CD/DVD
583 images). This means that they either use the same iSCSI targets or
584 that the storage resides somewhere on the network and both hosts
585 have access to it via NFS or SMB/CIFS.</para>
586
587 <para>This also means that neither the source nor the target machine
588 can have any snapshots.</para>
589 </listitem>
590 </orderedlist></para>
591
592 <para>Then perform the following steps:<orderedlist>
593 <listitem>
594 <para>On the <emphasis>target</emphasis> host, configure the virtual
595 machine to wait for a teleport request to arrive when it is started,
596 instead of actually attempting to start the machine. This is done
597 with the following VBoxManage command:<screen>VBoxManage modifyvm &lt;targetvmname&gt; --teleporter on --teleporterport &lt;port&gt;</screen></para>
598
599 <para>where <computeroutput>&lt;targetvmname&gt;</computeroutput> is
600 the name of the virtual machine on the target host and
601 <computeroutput>&lt;port&gt;</computeroutput> is a TCP/IP port
602 number to be used on both the source and the target hosts. For
603 example, use 6000. For details, see <xref
604 linkend="vboxmanage-modifyvm-teleport" />.</para>
605 </listitem>
606
607 <listitem>
608 <para>Start the VM on the target host. You will see that instead of
609 actually running, it will show a progress dialog. indicating that it
610 is waiting for a teleport request to arrive.</para>
611 </listitem>
612
613 <listitem>
614 <para>Start the machine on the <emphasis>source</emphasis> host as
615 usual. When it is running and you want it to be teleported, issue
616 the following command on the source host:<screen>VBoxManage controlvm &lt;sourcevmname&gt; teleport --host &lt;targethost&gt; --port &lt;port&gt;</screen></para>
617
618 <para>where <computeroutput>&lt;sourcevmname&gt;</computeroutput> is
619 the name of the virtual machine on the source host (the machine that
620 is currently running),
621 <computeroutput>&lt;targethost&gt;</computeroutput> is the host or
622 IP name of the target host on which the machine is waiting for the
623 teleport request, and <computeroutput>&lt;port&gt;</computeroutput>
624 must be the same number as specified in the command on the target
625 host. For details, see <xref
626 linkend="vboxmanage-controlvm" />.</para>
627 </listitem>
628 </orderedlist></para>
629
630 <para>For testing, you can also teleport machines on the same host; in
631 that case, use "localhost" as the hostname on both the source and the
632 target host.<note>
633 <para>In rare cases, if the CPUs of the source and the target are very
634 different, teleporting can fail with an error message, or the target
635 may hang. This may happen especially if the VM is running application
636 software that is highly optimized to run on a particular CPU without
637 correctly checking that certain CPU features are actually present.
638 VirtualBox filters what CPU capabilities are presented to the guest
639 operating system. Advanced users can attempt to restrict these virtual
640 CPU capabilities with the <computeroutput>VBoxManage --modifyvm
641 --cpuid</computeroutput> command; see <xref
642 linkend="vboxmanage-modifyvm-teleport" />.</para>
643 </note></para>
644 </sect1>
645</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