View | Details | Raw Unified | Return to bug 201578 | Differences between
and this patch

Collapse All | Expand All

(-)en_US.ISO8859-1/books/handbook/virtualization/chapter.xml (-22 / +47 lines)
Lines 1-1606 Link Here
1
<?xml version="1.0" encoding="iso-8859-1"?>
1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<!--
2
<!--
3
     The FreeBSD Documentation Project
3
     The FreeBSD Documentation Project
4
4
5
     $FreeBSD$
5
     $FreeBSD$
6
-->
6
-->
7
<chapter xmlns="http://docbook.org/ns/docbook"
7
<chapter xmlns="http://docbook.org/ns/docbook"
8
  xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
8
  xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
9
  xml:id="virtualization">
9
  xml:id="virtualization">
10
10
11
  <info>
11
  <info>
12
    <title>Virtualization</title>
12
    <title>Virtualization</title>
13
13
14
    <authorgroup>
14
    <authorgroup>
15
      <author>
15
      <author>
16
	<personname>
16
	<personname>
17
	  <firstname>Murray</firstname>
17
	  <firstname>Murray</firstname>
18
	  <surname>Stokely</surname>
18
	  <surname>Stokely</surname>
19
	</personname>
19
	</personname>
20
	<contrib>Contributed by </contrib>
20
	<contrib>Contributed by </contrib>
21
      </author>
21
      </author>
22
    </authorgroup>
22
    </authorgroup>
23
23
24
    <authorgroup>
24
    <authorgroup>
25
      <author>
25
      <author>
26
	<personname>
26
	<personname>
27
	  <firstname>Allan</firstname>
27
	  <firstname>Allan</firstname>
28
	  <surname>Jude</surname>
28
	  <surname>Jude</surname>
29
	</personname>
29
	</personname>
30
	<contrib>bhyve section by </contrib>
30
	<contrib>bhyve section by </contrib>
31
      </author>
31
      </author>
32
    </authorgroup>
32
    </authorgroup>
33
  </info>
33
  </info>
34
34
35
  <sect1 xml:id="virtualization-synopsis">
35
  <sect1 xml:id="virtualization-synopsis">
36
    <title>Synopsis</title>
36
    <title>Synopsis</title>
37
37
38
    <para>Virtualization software allows multiple operating systems to
38
    <para>Virtualization software allows multiple operating systems to
39
      run simultaneously on the same computer.  Such software systems
39
      run simultaneously on the same computer.  Such software systems
40
      for PCs often involve a host operating system which runs the
40
      for PCs often involve a host operating system which runs the
41
      virtualization software and supports any number of guest
41
      virtualization software and supports any number of guest
42
      operating systems.</para>
42
      operating systems.</para>
43
43
44
    <para>After reading this chapter, you will know:</para>
44
    <para>After reading this chapter, you will know:</para>
45
45
46
    <itemizedlist>
46
    <itemizedlist>
47
      <listitem>
47
      <listitem>
48
	<para>The difference between a host operating system and a
48
	<para>The difference between a host operating system and a
49
	  guest operating system.</para>
49
	  guest operating system.</para>
50
      </listitem>
50
      </listitem>
51
51
52
      <listitem>
52
      <listitem>
53
	<para>How to install &os; on an &intel;-based &apple;
53
	<para>How to install &os; on an &intel;-based &apple;
54
	  &mac; computer.</para>
54
	  &mac; computer.</para>
55
      </listitem>
55
      </listitem>
56
56
57
<!--
57
<!--
58
  Note:  There is no working/end-user ready Xen support for FreeBSD as of 07-2010.
58
  Note:  There is no working/end-user ready Xen support for FreeBSD as of 07-2010.
59
         Hide all information regarding Xen under FreeBSD.
59
         Hide all information regarding Xen under FreeBSD.
60
60
61
      <listitem>
61
      <listitem>
62
	<para>How to install &os; on Linux with
62
	<para>How to install &os; on Linux with
63
	  <application>&xen;</application>.</para>
63
	  <application>&xen;</application>.</para>
64
      </listitem>
64
      </listitem>
65
-->
65
-->
66
      <listitem>
66
      <listitem>
67
	<para>How to install &os; on &microsoft.windows; with
67
	<para>How to install &os; on &microsoft.windows; with
68
	  <application>Virtual PC</application>.</para>
68
	  <application>Virtual PC</application>.</para>
69
      </listitem>
69
      </listitem>
70
70
71
      <listitem>
71
      <listitem>
72
	<para>How to install &os; as a guest in
72
	<para>How to install &os; as a guest in
73
	  <application>bhyve</application>.</para>
73
	  <application>bhyve</application>.</para>
74
      </listitem>
74
      </listitem>
75
75
76
      <listitem>
76
      <listitem>
77
	<para>How to tune a &os; system for best performance under
77
	<para>How to tune a &os; system for best performance under
78
	  virtualization.</para>
78
	  virtualization.</para>
79
      </listitem>
79
      </listitem>
80
80
81
    </itemizedlist>
81
    </itemizedlist>
82
82
83
    <para>Before reading this chapter, you should:</para>
83
    <para>Before reading this chapter, you should:</para>
84
84
85
    <itemizedlist>
85
    <itemizedlist>
86
      <listitem>
86
      <listitem>
87
	<para>Understand the <link linkend="basics">basics of &unix;
87
	<para>Understand the <link linkend="basics">basics of &unix;
88
	    and &os;</link>.</para>
88
	    and &os;</link>.</para>
89
      </listitem>
89
      </listitem>
90
90
91
      <listitem>
91
      <listitem>
92
	<para>Know how to <link linkend="install">install
92
	<para>Know how to <link linkend="install">install
93
	    &os;</link>.</para>
93
	    &os;</link>.</para>
94
      </listitem>
94
      </listitem>
95
95
96
      <listitem>
96
      <listitem>
97
	<para>Know how to <link linkend="advanced-networking">set up a
97
	<para>Know how to <link linkend="advanced-networking">set up a
98
	    network connection</link>.</para>
98
	    network connection</link>.</para>
99
      </listitem>
99
      </listitem>
100
100
101
      <listitem>
101
      <listitem>
102
	<para>Know how to <link linkend="ports">install additional
102
	<para>Know how to <link linkend="ports">install additional
103
	    third-party software</link>.</para>
103
	    third-party software</link>.</para>
104
      </listitem>
104
      </listitem>
105
    </itemizedlist>
105
    </itemizedlist>
106
  </sect1>
106
  </sect1>
107
107
108
  <sect1 xml:id="virtualization-guest">
108
  <sect1 xml:id="virtualization-guest">
109
    <title>&os; as a Guest OS</title>
109
    <title>&os; as a Guest OS</title>
110
110
111
    <sect2 xml:id="virtualization-guest-parallels">
111
    <sect2 xml:id="virtualization-guest-parallels">
112
      <title><application>Parallels</application> on &macos; X</title>
112
      <title><application>Parallels</application> on &macos; X</title>
113
113
114
      <para><application>Parallels Desktop</application> for &mac; is
114
      <para><application>Parallels Desktop</application> for &mac; is
115
	a commercial software product available for &intel; based
115
	a commercial software product available for &intel; based
116
	&apple; &mac; computers running &macos; 10.4.6 or higher.
116
	&apple; &mac; computers running &macos; 10.4.6 or higher.
117
	&os; is a fully supported guest operating system.  Once
117
	&os; is a fully supported guest operating system.  Once
118
	<application>Parallels</application> has been installed on
118
	<application>Parallels</application> has been installed on
119
	&macos; X, the user must configure a virtual machine and then
119
	&macos; X, the user must configure a virtual machine and then
120
	install the desired guest operating system.</para>
120
	install the desired guest operating system.</para>
121
121
122
      <sect3 xml:id="virtualization-guest-parallels-install">
122
      <sect3 xml:id="virtualization-guest-parallels-install">
123
	<title>Installing &os; on Parallels/&macos; X</title>
123
	<title>Installing &os; on Parallels/&macos; X</title>
124
124
125
	<para>The first step in installing &os; on
125
	<para>The first step in installing &os; on
126
	  <application>Parallels</application> is to create a new
126
	  <application>Parallels</application> is to create a new
127
	  virtual machine for installing &os;.  Select
127
	  virtual machine for installing &os;.  Select
128
	  <guimenuitem>&os;</guimenuitem> as the <guimenu>Guest OS
128
	  <guimenuitem>&os;</guimenuitem> as the <guimenu>Guest OS
129
	    Type</guimenu> when prompted:</para>
129
	    Type</guimenu> when prompted:</para>
130
130
131
	<mediaobject>
131
	<mediaobject>
132
	  <imageobject>
132
	  <imageobject>
133
	    <imagedata fileref="virtualization/parallels-freebsd1"/>
133
	    <imagedata fileref="virtualization/parallels-freebsd1"/>
134
	  </imageobject>
134
	  </imageobject>
135
	</mediaobject>
135
	</mediaobject>
136
136
137
	<para>Choose a reasonable amount of disk and memory
137
	<para>Choose a reasonable amount of disk and memory
138
	  depending on the plans for this virtual &os; instance.
138
	  depending on the plans for this virtual &os; instance.
139
	  4GB of disk space and 512MB of RAM work well for most uses
139
	  4GB of disk space and 512MB of RAM work well for most uses
140
	  of &os; under <application>Parallels</application>:</para>
140
	  of &os; under <application>Parallels</application>:</para>
141
141
142
	<mediaobject>
142
	<mediaobject>
143
	  <imageobject>
143
	  <imageobject>
144
	    <imagedata fileref="virtualization/parallels-freebsd2"/>
144
	    <imagedata fileref="virtualization/parallels-freebsd2"/>
145
	  </imageobject>
145
	  </imageobject>
146
	</mediaobject>
146
	</mediaobject>
147
147
148
	<mediaobject>
148
	<mediaobject>
149
	  <imageobject>
149
	  <imageobject>
150
	    <imagedata fileref="virtualization/parallels-freebsd3"/>
150
	    <imagedata fileref="virtualization/parallels-freebsd3"/>
151
	  </imageobject>
151
	  </imageobject>
152
	</mediaobject>
152
	</mediaobject>
153
153
154
	<mediaobject>
154
	<mediaobject>
155
	  <imageobject>
155
	  <imageobject>
156
	    <imagedata fileref="virtualization/parallels-freebsd4"/>
156
	    <imagedata fileref="virtualization/parallels-freebsd4"/>
157
	  </imageobject>
157
	  </imageobject>
158
	</mediaobject>
158
	</mediaobject>
159
159
160
	<mediaobject>
160
	<mediaobject>
161
	  <imageobject>
161
	  <imageobject>
162
	    <imagedata fileref="virtualization/parallels-freebsd5"/>
162
	    <imagedata fileref="virtualization/parallels-freebsd5"/>
163
	  </imageobject>
163
	  </imageobject>
164
	</mediaobject>
164
	</mediaobject>
165
165
166
	<para>Select the type of networking and a network
166
	<para>Select the type of networking and a network
167
	  interface:</para>
167
	  interface:</para>
168
168
169
	<mediaobject>
169
	<mediaobject>
170
	  <imageobject>
170
	  <imageobject>
171
	    <imagedata fileref="virtualization/parallels-freebsd6"/>
171
	    <imagedata fileref="virtualization/parallels-freebsd6"/>
172
	  </imageobject>
172
	  </imageobject>
173
	</mediaobject>
173
	</mediaobject>
174
174
175
	<mediaobject>
175
	<mediaobject>
176
	  <imageobject>
176
	  <imageobject>
177
	    <imagedata fileref="virtualization/parallels-freebsd7"/>
177
	    <imagedata fileref="virtualization/parallels-freebsd7"/>
178
	  </imageobject>
178
	  </imageobject>
179
	</mediaobject>
179
	</mediaobject>
180
180
181
	<para>Save and finish the configuration:</para>
181
	<para>Save and finish the configuration:</para>
182
182
183
	<mediaobject>
183
	<mediaobject>
184
	  <imageobject>
184
	  <imageobject>
185
	    <imagedata fileref="virtualization/parallels-freebsd8"/>
185
	    <imagedata fileref="virtualization/parallels-freebsd8"/>
186
	  </imageobject>
186
	  </imageobject>
187
	</mediaobject>
187
	</mediaobject>
188
188
189
	<mediaobject>
189
	<mediaobject>
190
	  <imageobject>
190
	  <imageobject>
191
	    <imagedata fileref="virtualization/parallels-freebsd9"/>
191
	    <imagedata fileref="virtualization/parallels-freebsd9"/>
192
	  </imageobject>
192
	  </imageobject>
193
	</mediaobject>
193
	</mediaobject>
194
194
195
	<para>After the &os; virtual machine has been created, &os;
195
	<para>After the &os; virtual machine has been created, &os;
196
	  can be installed on it.  This is best done with an
196
	  can be installed on it.  This is best done with an
197
	  official &os; CD/DVD or with an ISO image downloaded from an
197
	  official &os; CD/DVD or with an ISO image downloaded from an
198
	  official FTP site.  Copy the appropriate ISO image to the
198
	  official FTP site.  Copy the appropriate ISO image to the
199
	  local &mac; filesystem or insert a CD/DVD in the &mac;'s CD
199
	  local &mac; filesystem or insert a CD/DVD in the &mac;'s CD
200
	  drive.  Click on the disc icon in the bottom right corner of
200
	  drive.  Click on the disc icon in the bottom right corner of
201
	  the &os; <application>Parallels</application> window.  This
201
	  the &os; <application>Parallels</application> window.  This
202
	  will bring up a window that can be used to associate the
202
	  will bring up a window that can be used to associate the
203
	  CDROM drive in the virtual machine with the ISO file on disk
203
	  CDROM drive in the virtual machine with the ISO file on disk
204
	  or with the real CDROM drive.</para>
204
	  or with the real CDROM drive.</para>
205
205
206
	<mediaobject>
206
	<mediaobject>
207
	  <imageobject>
207
	  <imageobject>
208
	    <imagedata fileref="virtualization/parallels-freebsd11"/>
208
	    <imagedata fileref="virtualization/parallels-freebsd11"/>
209
	  </imageobject>
209
	  </imageobject>
210
	</mediaobject>
210
	</mediaobject>
211
211
212
	<para>Once this association with the CDROM source has been
212
	<para>Once this association with the CDROM source has been
213
	  made, reboot the &os; virtual machine by clicking the reboot
213
	  made, reboot the &os; virtual machine by clicking the reboot
214
	  icon.  <application>Parallels</application> will reboot with
214
	  icon.  <application>Parallels</application> will reboot with
215
	  a special BIOS that first checks if there is a CDROM.</para>
215
	  a special BIOS that first checks if there is a CDROM.</para>
216
216
217
	<mediaobject>
217
	<mediaobject>
218
	  <imageobject>
218
	  <imageobject>
219
	    <imagedata fileref="virtualization/parallels-freebsd10"/>
219
	    <imagedata fileref="virtualization/parallels-freebsd10"/>
220
	  </imageobject>
220
	  </imageobject>
221
	</mediaobject>
221
	</mediaobject>
222
222
223
	<para>In this case it will find the &os; installation media
223
	<para>In this case it will find the &os; installation media
224
	  and begin a normal &os; installation.  Perform the
224
	  and begin a normal &os; installation.  Perform the
225
	  installation, but do not attempt to configure
225
	  installation, but do not attempt to configure
226
	  <application>&xorg;</application> at this time.</para>
226
	  <application>&xorg;</application> at this time.</para>
227
227
228
	<mediaobject>
228
	<mediaobject>
229
	  <imageobject>
229
	  <imageobject>
230
	    <imagedata fileref="virtualization/parallels-freebsd12"/>
230
	    <imagedata fileref="virtualization/parallels-freebsd12"/>
231
	  </imageobject>
231
	  </imageobject>
232
	</mediaobject>
232
	</mediaobject>
233
233
234
	<para>When the installation is finished, reboot into the
234
	<para>When the installation is finished, reboot into the
235
	  newly installed &os; virtual machine.</para>
235
	  newly installed &os; virtual machine.</para>
236
236
237
	<mediaobject>
237
	<mediaobject>
238
	  <imageobject>
238
	  <imageobject>
239
	    <imagedata fileref="virtualization/parallels-freebsd13"/>
239
	    <imagedata fileref="virtualization/parallels-freebsd13"/>
240
	  </imageobject>
240
	  </imageobject>
241
	</mediaobject>
241
	</mediaobject>
242
      </sect3>
242
      </sect3>
243
243
244
      <sect3 xml:id="virtualization-guest-parallels-configure">
244
      <sect3 xml:id="virtualization-guest-parallels-configure">
245
	<title>Configuring &os; on
245
	<title>Configuring &os; on
246
	  <application>Parallels</application> </title>
246
	  <application>Parallels</application> </title>
247
247
248
	<para>After &os; has been successfully installed on &macos;
248
	<para>After &os; has been successfully installed on &macos;
249
	  X with <application>Parallels</application>, there are a
249
	  X with <application>Parallels</application>, there are a
250
	  number of configuration steps that can be taken to
250
	  number of configuration steps that can be taken to
251
	  optimize the system for virtualized operation.</para>
251
	  optimize the system for virtualized operation.</para>
252
252
253
	<procedure>
253
	<procedure>
254
	  <step>
254
	  <step>
255
	    <title>Set Boot Loader Variables</title>
255
	    <title>Set Boot Loader Variables</title>
256
256
257
	    <para>The most important step is to reduce the
257
	    <para>The most important step is to reduce the
258
	      <option>kern.hz</option> tunable to reduce the CPU
258
	      <option>kern.hz</option> tunable to reduce the CPU
259
	      utilization of &os; under the <application>Parallels
259
	      utilization of &os; under the <application>Parallels
260
	      </application> environment.  This is accomplished by
260
	      </application> environment.  This is accomplished by
261
	      adding the following line to <filename>
261
	      adding the following line to <filename>
262
	      /boot/loader.conf</filename>:</para>
262
	      /boot/loader.conf</filename>:</para>
263
263
264
	    <programlisting>kern.hz=100</programlisting>
264
	    <programlisting>kern.hz=100</programlisting>
265
265
266
	    <para>Without this setting, an idle &os;
266
	    <para>Without this setting, an idle &os;
267
	      <application>Parallels</application> guest will use
267
	      <application>Parallels</application> guest will use
268
	      roughly 15% of the CPU of a single processor &imac;.
268
	      roughly 15% of the CPU of a single processor &imac;.
269
	      After this change the usage will be closer to 5%.</para>
269
	      After this change the usage will be closer to 5%.</para>
270
	  </step>
270
	  </step>
271
271
272
	  <step>
272
	  <step>
273
	    <title>Create a New Kernel Configuration File</title>
273
	    <title>Create a New Kernel Configuration File</title>
274
274
275
	    <para>All of the SCSI, FireWire, and USB device drivers
275
	    <para>All of the SCSI, FireWire, and USB device drivers
276
	      can be removed from a custom kernel configuration file.
276
	      can be removed from a custom kernel configuration file.
277
	      <application>Parallels</application> provides a virtual
277
	      <application>Parallels</application> provides a virtual
278
	      network adapter used by the &man.ed.4; driver, so all
278
	      network adapter used by the &man.ed.4; driver, so all
279
	      network devices except for &man.ed.4; and &man.miibus.4;
279
	      network devices except for &man.ed.4; and &man.miibus.4;
280
	      can be removed from the kernel.</para>
280
	      can be removed from the kernel.</para>
281
	  </step>
281
	  </step>
282
282
283
	  <step>
283
	  <step>
284
	    <title>Configure Networking</title>
284
	    <title>Configure Networking</title>
285
285
286
	    <para>The most basic networking setup uses DHCP to connect
286
	    <para>The most basic networking setup uses DHCP to connect
287
	      the virtual machine to the same local area network as
287
	      the virtual machine to the same local area network as
288
	      the host &mac;.  This can be accomplished by adding
288
	      the host &mac;.  This can be accomplished by adding
289
	      <literal>ifconfig_ed0="DHCP"</literal> to
289
	      <literal>ifconfig_ed0="DHCP"</literal> to
290
	      <filename>/etc/rc.conf</filename>.  More advanced
290
	      <filename>/etc/rc.conf</filename>.  More advanced
291
	      networking setups are described in
291
	      networking setups are described in
292
	      <xref linkend="advanced-networking"/>.</para>
292
	      <xref linkend="advanced-networking"/>.</para>
293
	  </step>
293
	  </step>
294
	</procedure>
294
	</procedure>
295
      </sect3>
295
      </sect3>
296
    </sect2>
296
    </sect2>
297
297
298
<!--
298
<!--
299
Deactivate/hide this section as the instructions in there do NOT work any more:
299
Deactivate/hide this section as the instructions in there do NOT work any more:
300
- FreeBSD 7.0 has reached its EOL a long time ago.
300
- FreeBSD 7.0 has reached its EOL a long time ago.
301
- The needed files from www.fsmware.com are not available any more, as the
301
- The needed files from www.fsmware.com are not available any more, as the
302
  server is dead.  So it is impossible to follow the instructions in here.
302
  server is dead.  So it is impossible to follow the instructions in here.
303
303
304
jkois@FreeBSD.org, 2010-06-18
304
jkois@FreeBSD.org, 2010-06-18
305
305
306
    <sect2 id="virtualization-guest-xen">
306
    <sect2 id="virtualization-guest-xen">
307
      <sect2info>
307
      <sect2info>
308
	<authorgroup>
308
	<authorgroup>
309
	  <author>
309
	  <author>
310
	    <firstname>Fukang</firstname>
310
	    <firstname>Fukang</firstname>
311
	    <surname>Chen (Loader)</surname>
311
	    <surname>Chen (Loader)</surname>
312
	    <contrib>Contributed by </contrib>
312
	    <contrib>Contributed by </contrib>
313
	  </author>
313
	  </author>
314
	</authorgroup>
314
	</authorgroup>
315
      </sect2info>
315
      </sect2info>
316
316
317
      <title>&os; with &xen; on Linux</title>
317
      <title>&os; with &xen; on Linux</title>
318
318
319
	<para>The <application>&xen;</application> hypervisor is an
319
	<para>The <application>&xen;</application> hypervisor is an
320
	  open source paravirtualization product which is now
320
	  open source paravirtualization product which is now
321
	  supported by the commercial XenSource company.  Guest
321
	  supported by the commercial XenSource company.  Guest
322
	  operating systems are known as domU domains, and the host
322
	  operating systems are known as domU domains, and the host
323
	  operating system is known as dom0.  The first step in
323
	  operating system is known as dom0.  The first step in
324
	  running a virtual &os; instance under Linux is to install
324
	  running a virtual &os; instance under Linux is to install
325
	  <application>&xen;</application> for Linux dom0.  The host
325
	  <application>&xen;</application> for Linux dom0.  The host
326
	  operating system will be a Slackware Linux
326
	  operating system will be a Slackware Linux
327
	  distribution.</para>
327
	  distribution.</para>
328
328
329
	<sect3 id="xen-slackware-dom0">
329
	<sect3 id="xen-slackware-dom0">
330
	  <title>Setup &xen; 3 on Linux dom0</title>
330
	  <title>Setup &xen; 3 on Linux dom0</title>
331
331
332
	  <procedure>
332
	  <procedure>
333
	    <step>
333
	    <step>
334
	      <title>Download &xen; 3.0 from XenSource</title>
334
	      <title>Download &xen; 3.0 from XenSource</title>
335
335
336
	      <para>Download <ulink
336
	      <para>Download <ulink
337
		  url="http://bits.xensource.com/oss-xen/release/3.0.4-1/src.tgz/xen-3.0.4_1-src.tgz">xen-3.0.4_1-src.tgz</ulink>
337
		  url="http://bits.xensource.com/oss-xen/release/3.0.4-1/src.tgz/xen-3.0.4_1-src.tgz">xen-3.0.4_1-src.tgz</ulink>
338
		from <ulink
338
		from <ulink
339
		url="http://www.xensource.com/"></ulink>.</para>
339
		url="http://www.xensource.com/"></ulink>.</para>
340
	    </step>
340
	    </step>
341
341
342
	    <step>
342
	    <step>
343
	      <title>Unpack the tarball</title>
343
	      <title>Unpack the tarball</title>
344
344
345
              <screen>&prompt.root; <userinput>cd xen-3.0.4_1-src</userinput>
345
              <screen>&prompt.root; <userinput>cd xen-3.0.4_1-src</userinput>
346
&prompt.root; <userinput>KERNELS="linux-2.6-xen0 linux-2.6-xenU" make world</userinput>
346
&prompt.root; <userinput>KERNELS="linux-2.6-xen0 linux-2.6-xenU" make world</userinput>
347
&prompt.root; <userinput>make install</userinput></screen>
347
&prompt.root; <userinput>make install</userinput></screen>
348
348
349
	      <note>
349
	      <note>
350
		<para>To re-compile the kernel for dom0:</para>
350
		<para>To re-compile the kernel for dom0:</para>
351
351
352
		<screen>&prompt.root; <userinput>cd xen-3.0.4_1-src/linux-2.6.16.33-xen0</userinput>
352
		<screen>&prompt.root; <userinput>cd xen-3.0.4_1-src/linux-2.6.16.33-xen0</userinput>
353
&prompt.root; <userinput>make menuconfig</userinput>
353
&prompt.root; <userinput>make menuconfig</userinput>
354
&prompt.root; <userinput>make</userinput>
354
&prompt.root; <userinput>make</userinput>
355
&prompt.root; <userinput>make install</userinput></screen>
355
&prompt.root; <userinput>make install</userinput></screen>
356
356
357
		<para>Older version of
357
		<para>Older version of
358
		  <application>&xen;</application> may need to specify
358
		  <application>&xen;</application> may need to specify
359
		  <command>make ARCH=xen menuconfig</command></para>
359
		  <command>make ARCH=xen menuconfig</command></para>
360
	      </note>
360
	      </note>
361
	    </step>
361
	    </step>
362
362
363
	    <step>
363
	    <step>
364
	      <title>Add a Menu Entry into Grub
364
	      <title>Add a Menu Entry into Grub
365
		<filename>menu.lst</filename></title>
365
		<filename>menu.lst</filename></title>
366
366
367
	      <para>Edit <filename>/boot/grub/menu.lst</filename> and
367
	      <para>Edit <filename>/boot/grub/menu.lst</filename> and
368
		add the following lines:</para>
368
		add the following lines:</para>
369
369
370
	      <programlisting>title Xen-3.0.4
370
	      <programlisting>title Xen-3.0.4
371
root (hd0,0)
371
root (hd0,0)
372
kernel /boot/xen-3.0.4-1.gz dom0_mem=262144
372
kernel /boot/xen-3.0.4-1.gz dom0_mem=262144
373
module /boot/vmlinuz-2.6.16.33-xen0 root=/dev/hda1 ro</programlisting>
373
module /boot/vmlinuz-2.6.16.33-xen0 root=/dev/hda1 ro</programlisting>
374
	    </step>
374
	    </step>
375
375
376
	    <step>
376
	    <step>
377
	      <title>Reboot Your Computer into &xen;</title>
377
	      <title>Reboot Your Computer into &xen;</title>
378
378
379
	      <para>First, edit
379
	      <para>First, edit
380
		<filename>/etc/xen/xend-config.sxp</filename>, and add
380
		<filename>/etc/xen/xend-config.sxp</filename>, and add
381
		the following line:</para>
381
		the following line:</para>
382
382
383
	      <programlisting>(network-script 'network-bridge netdev=eth0')</programlisting>
383
	      <programlisting>(network-script 'network-bridge netdev=eth0')</programlisting>
384
384
385
	      <para>Then, we can launch
385
	      <para>Then, we can launch
386
		<application>&xen;</application>:</para>
386
		<application>&xen;</application>:</para>
387
387
388
	      <screen>&prompt.root; <userinput>/etc/init.d/xend start</userinput>
388
	      <screen>&prompt.root; <userinput>/etc/init.d/xend start</userinput>
389
&prompt.root; <userinput>/etc/init.d/xendomains start</userinput></screen>
389
&prompt.root; <userinput>/etc/init.d/xendomains start</userinput></screen>
390
390
391
	      <para>Our dom0 is running:</para>
391
	      <para>Our dom0 is running:</para>
392
392
393
	      <screen>&prompt.root; <userinput>xm list</userinput>
393
	      <screen>&prompt.root; <userinput>xm list</userinput>
394
Name                                      ID   Mem VCPUs      State   Time(s)
394
Name                                      ID   Mem VCPUs      State   Time(s)
395
Domain-0                                   0   256     1     r&ndash;&ndash;&ndash;&ndash;&ndash;  54452.9</screen>
395
Domain-0                                   0   256     1     r&ndash;&ndash;&ndash;&ndash;&ndash;  54452.9</screen>
396
	    </step>
396
	    </step>
397
	  </procedure>
397
	  </procedure>
398
	</sect3>
398
	</sect3>
399
399
400
	<sect3>
400
	<sect3>
401
	  <title>&os; 7-CURRENT <emphasis>domU</emphasis></title>
401
	  <title>&os; 7-CURRENT <emphasis>domU</emphasis></title>
402
402
403
	  <para>Download the &os; domU kernel for
403
	  <para>Download the &os; domU kernel for
404
	    <application>&xen; 3.0</application> and disk image from
404
	    <application>&xen; 3.0</application> and disk image from
405
	    <ulink
405
	    <ulink
406
	      url="http://www.fsmware.com/">http://www.fsmware.com/</ulink></para>
406
	      url="http://www.fsmware.com/">http://www.fsmware.com/</ulink></para>
407
407
408
	  <itemizedlist>
408
	  <itemizedlist>
409
	    <listitem>
409
	    <listitem>
410
	      <para><ulink
410
	      <para><ulink
411
		  url="http://www.fsmware.com/xenofreebsd/7.0/download/kernel-current">kernel-current</ulink></para>
411
		  url="http://www.fsmware.com/xenofreebsd/7.0/download/kernel-current">kernel-current</ulink></para>
412
	    </listitem>
412
	    </listitem>
413
413
414
	    <listitem>
414
	    <listitem>
415
	      <para><ulink
415
	      <para><ulink
416
		  url="http://www.fsmware.com/xenofreebsd/7.0/download/mdroot-7.0.bz2">mdroot-7.0.bz2</ulink></para>
416
		  url="http://www.fsmware.com/xenofreebsd/7.0/download/mdroot-7.0.bz2">mdroot-7.0.bz2</ulink></para>
417
	    </listitem>
417
	    </listitem>
418
418
419
	    <listitem>
419
	    <listitem>
420
	      <para><ulink
420
	      <para><ulink
421
		  url="http://www.fsmware.com/xenofreebsd/7.0/download/config/xmexample1.bsd">xmexample1.bsd</ulink></para>
421
		  url="http://www.fsmware.com/xenofreebsd/7.0/download/config/xmexample1.bsd">xmexample1.bsd</ulink></para>
422
	    </listitem>
422
	    </listitem>
423
	  </itemizedlist>
423
	  </itemizedlist>
424
424
425
	  <para>Put the configuration file
425
	  <para>Put the configuration file
426
	    <filename>xmexample1.bsd</filename> into
426
	    <filename>xmexample1.bsd</filename> into
427
	    <filename>/etc/xen/</filename> and modify the related
427
	    <filename>/etc/xen/</filename> and modify the related
428
	    entries about where the kernel and the disk image are
428
	    entries about where the kernel and the disk image are
429
	    stored.  It should look like the following:</para>
429
	    stored.  It should look like the following:</para>
430
430
431
	  <programlisting>kernel = "/opt/kernel-current"
431
	  <programlisting>kernel = "/opt/kernel-current"
432
memory = 256
432
memory = 256
433
name = "freebsd"
433
name = "freebsd"
434
vif = [ '' ]
434
vif = [ '' ]
435
disk = [ 'file:/opt/mdroot-7.0,hda1,w' ]
435
disk = [ 'file:/opt/mdroot-7.0,hda1,w' ]
436
#on_crash    = 'preserve'
436
#on_crash    = 'preserve'
437
extra = "boot_verbose"
437
extra = "boot_verbose"
438
extra += ",boot_single"
438
extra += ",boot_single"
439
extra += ",kern.hz=100"
439
extra += ",kern.hz=100"
440
extra += ",vfs.root.mountfrom=ufs:/dev/xbd769a"</programlisting>
440
extra += ",vfs.root.mountfrom=ufs:/dev/xbd769a"</programlisting>
441
441
442
	  <para>Uncompress <filename>mdroot-7.0.bz2</filename>.</para>
442
	  <para>Uncompress <filename>mdroot-7.0.bz2</filename>.</para>
443
443
444
	  <para>Next, the __xen_guest section in
444
	  <para>Next, the __xen_guest section in
445
	    <filename>kernel-current</filename> needs to be altered to
445
	    <filename>kernel-current</filename> needs to be altered to
446
	    add the VIRT_BASE that
446
	    add the VIRT_BASE that
447
	    <application>&xen; 3.0.3</application> requires:</para>
447
	    <application>&xen; 3.0.3</application> requires:</para>
448
448
449
	  <screen>&prompt.root; <userinput>objcopy kernel-current -R __xen_guest</userinput>
449
	  <screen>&prompt.root; <userinput>objcopy kernel-current -R __xen_guest</userinput>
450
&prompt.root; <userinput>perl -e 'print "LOADER=generic,GUEST_OS=freebsd,GUEST_VER=7.0,XEN_VER=xen-3.0,BSD_SYMTAB,VIRT_BASE=0xC0000000\x00"' &gt; tmp</userinput>
450
&prompt.root; <userinput>perl -e 'print "LOADER=generic,GUEST_OS=freebsd,GUEST_VER=7.0,XEN_VER=xen-3.0,BSD_SYMTAB,VIRT_BASE=0xC0000000\x00"' &gt; tmp</userinput>
451
&prompt.root; <userinput>objcopy kernel-current &ndash;&ndash;add-section __xen_guest=tmp</userinput></screen>
451
&prompt.root; <userinput>objcopy kernel-current &ndash;&ndash;add-section __xen_guest=tmp</userinput></screen>
452
452
453
	  <screen>&prompt.root; <userinput>objdump -j __xen_guest -s kernel-current</userinput>
453
	  <screen>&prompt.root; <userinput>objdump -j __xen_guest -s kernel-current</userinput>
454
454
455
kernel-current:     file format elf32-i386
455
kernel-current:     file format elf32-i386
456
456
457
Contents of section __xen_guest:
457
Contents of section __xen_guest:
458
 0000 4c4f4144 45523d67 656e6572 69632c47  LOADER=generic,G
458
 0000 4c4f4144 45523d67 656e6572 69632c47  LOADER=generic,G
459
 0010 55455354 5f4f533d 66726565 6273642c  UEST_OS=freebsd,
459
 0010 55455354 5f4f533d 66726565 6273642c  UEST_OS=freebsd,
460
 0020 47554553 545f5645 523d372e 302c5845  GUEST_VER=7.0,XE
460
 0020 47554553 545f5645 523d372e 302c5845  GUEST_VER=7.0,XE
461
 0030 4e5f5645 523d7865 6e2d332e 302c4253  N_VER=xen-3.0,BS
461
 0030 4e5f5645 523d7865 6e2d332e 302c4253  N_VER=xen-3.0,BS
462
 0040 445f5359 4d544142 2c564952 545f4241  D_SYMTAB,VIRT_BA
462
 0040 445f5359 4d544142 2c564952 545f4241  D_SYMTAB,VIRT_BA
463
 0050 53453d30 78433030 30303030 3000      SE=0xC0000000. </screen>
463
 0050 53453d30 78433030 30303030 3000      SE=0xC0000000. </screen>
464
464
465
	  <para>We are, now, ready to create and launch our
465
	  <para>We are, now, ready to create and launch our
466
	    domU:</para>
466
	    domU:</para>
467
467
468
	  <screen>&prompt.root; <userinput>xm create /etc/xen/xmexample1.bsd -c</userinput>
468
	  <screen>&prompt.root; <userinput>xm create /etc/xen/xmexample1.bsd -c</userinput>
469
Using config file "/etc/xen/xmexample1.bsd".
469
Using config file "/etc/xen/xmexample1.bsd".
470
Started domain freebsd
470
Started domain freebsd
471
WARNING: loader(8) metadata is missing!
471
WARNING: loader(8) metadata is missing!
472
Copyright (c) 1992-2006 The FreeBSD Project.
472
Copyright (c) 1992-2006 The FreeBSD Project.
473
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
473
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
474
The Regents of the University of California. All rights reserved.
474
The Regents of the University of California. All rights reserved.
475
FreeBSD 7.0-CURRENT #113: Wed Jan  4 06:25:43 UTC 2006
475
FreeBSD 7.0-CURRENT #113: Wed Jan  4 06:25:43 UTC 2006
476
    kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF
476
    kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF
477
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
477
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
478
Xen reported: 1796.927 MHz processor.
478
Xen reported: 1796.927 MHz processor.
479
Timecounter "ixen" frequency 1796927000 Hz quality 0
479
Timecounter "ixen" frequency 1796927000 Hz quality 0
480
CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz (1796.93-MHz 686-class CPU)
480
CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz (1796.93-MHz 686-class CPU)
481
  Origin = "GenuineIntel"  Id = 0xf29  Stepping = 9
481
  Origin = "GenuineIntel"  Id = 0xf29  Stepping = 9
482
  Features=0xbfebfbff&lt;FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,
482
  Features=0xbfebfbff&lt;FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,
483
  DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE&gt;
483
  DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE&gt;
484
  Features2=0x4400&lt;CNTX-ID,&lt;b14&gt;&gt;
484
  Features2=0x4400&lt;CNTX-ID,&lt;b14&gt;&gt;
485
real memory  = 265244672 (252 MB)
485
real memory  = 265244672 (252 MB)
486
avail memory = 255963136 (244 MB)
486
avail memory = 255963136 (244 MB)
487
xc0: &lt;Xen Console&gt; on motherboard
487
xc0: &lt;Xen Console&gt; on motherboard
488
cpu0 on motherboard
488
cpu0 on motherboard
489
Timecounters tick every 10.000 msec
489
Timecounters tick every 10.000 msec
490
[XEN] Initialising virtual ethernet driver.
490
[XEN] Initialising virtual ethernet driver.
491
xn0: Ethernet address: 00:16:3e:6b:de:3a
491
xn0: Ethernet address: 00:16:3e:6b:de:3a
492
[XEN]
492
[XEN]
493
Trying to mount root from ufs:/dev/xbd769a
493
Trying to mount root from ufs:/dev/xbd769a
494
WARNING: / was not properly dismounted
494
WARNING: / was not properly dismounted
495
Loading configuration files.
495
Loading configuration files.
496
No suitable dump device was found.
496
No suitable dump device was found.
497
Entropy harvesting: interrupts ethernet point_to_point kickstart.
497
Entropy harvesting: interrupts ethernet point_to_point kickstart.
498
Starting file system checks:
498
Starting file system checks:
499
/dev/xbd769a: 18859 files, 140370 used, 113473 free (10769 frags, 12838 blocks, 4.2% fragmentation)
499
/dev/xbd769a: 18859 files, 140370 used, 113473 free (10769 frags, 12838 blocks, 4.2% fragmentation)
500
Setting hostname: demo.freebsd.org.
500
Setting hostname: demo.freebsd.org.
501
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
501
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
502
	  inet6 ::1 prefixlen 128
502
	  inet6 ::1 prefixlen 128
503
	  inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
503
	  inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
504
	  inet 127.0.0.1 netmask 0xff000000
504
	  inet 127.0.0.1 netmask 0xff000000
505
Additional routing options:.
505
Additional routing options:.
506
Mounting NFS file systems:.
506
Mounting NFS file systems:.
507
Starting syslogd.
507
Starting syslogd.
508
/etc/rc: WARNING: Dump device does not exist.  Savecore not run.
508
/etc/rc: WARNING: Dump device does not exist.  Savecore not run.
509
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib
509
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib
510
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout
510
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout
511
Starting usbd.
511
Starting usbd.
512
usb: Kernel module not available: No such file or directory
512
usb: Kernel module not available: No such file or directory
513
Starting local daemons:.
513
Starting local daemons:.
514
Updating motd.
514
Updating motd.
515
Starting sshd.
515
Starting sshd.
516
Initial i386 initialization:.
516
Initial i386 initialization:.
517
Additional ABI support: linux.
517
Additional ABI support: linux.
518
Starting cron.
518
Starting cron.
519
Local package initialization:.
519
Local package initialization:.
520
Additional TCP options:.
520
Additional TCP options:.
521
Starting background file system checks in 60 seconds.
521
Starting background file system checks in 60 seconds.
522
522
523
Sun Apr  1 02:11:43 UTC 2007
523
Sun Apr  1 02:11:43 UTC 2007
524
524
525
FreeBSD/i386 (demo.freebsd.org) (xc0)
525
FreeBSD/i386 (demo.freebsd.org) (xc0)
526
526
527
login: </screen>
527
login: </screen>
528
528
529
	  <para>The domU should run the &os;&nbsp;7.0-CURRENT
529
	  <para>The domU should run the &os;&nbsp;7.0-CURRENT
530
	    kernel:</para>
530
	    kernel:</para>
531
531
532
	  <screen>&prompt.root; <userinput>uname -a</userinput>
532
	  <screen>&prompt.root; <userinput>uname -a</userinput>
533
FreeBSD demo.freebsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #113: Wed Jan  4 06:25:43 UTC 2006
533
FreeBSD demo.freebsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #113: Wed Jan  4 06:25:43 UTC 2006
534
kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF  i386</screen>
534
kmacy@freebsd7.gateway.2wire.net:/usr/home/kmacy/p4/freebsd7_xen3/src/sys/i386-xen/compile/XENCONF  i386</screen>
535
535
536
	  <para>The network can now be configured on the domU.  The
536
	  <para>The network can now be configured on the domU.  The
537
	    &os; domU will use a specific interface called
537
	    &os; domU will use a specific interface called
538
	    <devicename>xn0</devicename>:</para>
538
	    <devicename>xn0</devicename>:</para>
539
539
540
	  <screen>&prompt.root; <userinput>ifconfig xn0 10.10.10.200 netmask 255.0.0.0</userinput>
540
	  <screen>&prompt.root; <userinput>ifconfig xn0 10.10.10.200 netmask 255.0.0.0</userinput>
541
&prompt.root; <userinput>ifconfig</userinput>
541
&prompt.root; <userinput>ifconfig</userinput>
542
xn0: flags=843&lt;UP,BROADCAST,RUNNING,SIMPLEX&gt; mtu 1500
542
xn0: flags=843&lt;UP,BROADCAST,RUNNING,SIMPLEX&gt; mtu 1500
543
    inet 10.10.10.200 netmask 0xff000000 broadcast 10.255.255.255
543
    inet 10.10.10.200 netmask 0xff000000 broadcast 10.255.255.255
544
    ether 00:16:3e:6b:de:3a
544
    ether 00:16:3e:6b:de:3a
545
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
545
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
546
      inet6 ::1 prefixlen 128
546
      inet6 ::1 prefixlen 128
547
      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
547
      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
548
      inet 127.0.0.1 netmask 0xff000000 </screen>
548
      inet 127.0.0.1 netmask 0xff000000 </screen>
549
549
550
	  <para>On dom0 Slackware, some
550
	  <para>On dom0 Slackware, some
551
	    <application>&xen;</application> dependent network
551
	    <application>&xen;</application> dependent network
552
	    interfaces should show up:</para>
552
	    interfaces should show up:</para>
553
553
554
	  <screen>&prompt.root; <userinput>ifconfig</userinput>
554
	  <screen>&prompt.root; <userinput>ifconfig</userinput>
555
eth0      Link encap:Ethernet  HWaddr 00:07:E9:A0:02:C2
555
eth0      Link encap:Ethernet  HWaddr 00:07:E9:A0:02:C2
556
	  inet addr:10.10.10.130  Bcast:0.0.0.0  Mask:255.0.0.0
556
	  inet addr:10.10.10.130  Bcast:0.0.0.0  Mask:255.0.0.0
557
	  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
557
	  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
558
	  RX packets:815 errors:0 dropped:0 overruns:0 frame:0
558
	  RX packets:815 errors:0 dropped:0 overruns:0 frame:0
559
	  TX packets:1400 errors:0 dropped:0 overruns:0 carrier:0
559
	  TX packets:1400 errors:0 dropped:0 overruns:0 carrier:0
560
	  collisions:0 txqueuelen:0
560
	  collisions:0 txqueuelen:0
561
	  RX bytes:204857 (200.0 KiB)  TX bytes:129915 (126.8 KiB)
561
	  RX bytes:204857 (200.0 KiB)  TX bytes:129915 (126.8 KiB)
562
562
563
lo        Link encap:Local Loopback
563
lo        Link encap:Local Loopback
564
	  inet addr:127.0.0.1  Mask:255.0.0.0
564
	  inet addr:127.0.0.1  Mask:255.0.0.0
565
	  UP LOOPBACK RUNNING  MTU:16436  Metric:1
565
	  UP LOOPBACK RUNNING  MTU:16436  Metric:1
566
	  RX packets:99 errors:0 dropped:0 overruns:0 frame:0
566
	  RX packets:99 errors:0 dropped:0 overruns:0 frame:0
567
	  TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
567
	  TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
568
	  collisions:0 txqueuelen:0
568
	  collisions:0 txqueuelen:0
569
	  RX bytes:9744 (9.5 KiB)  TX bytes:9744 (9.5 KiB)
569
	  RX bytes:9744 (9.5 KiB)  TX bytes:9744 (9.5 KiB)
570
570
571
peth0     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
571
peth0     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
572
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
572
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
573
	  RX packets:1853349 errors:0 dropped:0 overruns:0 frame:0
573
	  RX packets:1853349 errors:0 dropped:0 overruns:0 frame:0
574
	  TX packets:952923 errors:0 dropped:0 overruns:0 carrier:0
574
	  TX packets:952923 errors:0 dropped:0 overruns:0 carrier:0
575
	  collisions:0 txqueuelen:1000
575
	  collisions:0 txqueuelen:1000
576
	  RX bytes:2432115831 (2.2 GiB)  TX bytes:86528526 (82.5 MiB)
576
	  RX bytes:2432115831 (2.2 GiB)  TX bytes:86528526 (82.5 MiB)
577
	  Base address:0xc000 Memory:ef020000-ef040000
577
	  Base address:0xc000 Memory:ef020000-ef040000
578
578
579
vif0.1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
579
vif0.1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
580
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
580
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
581
	  RX packets:1400 errors:0 dropped:0 overruns:0 frame:0
581
	  RX packets:1400 errors:0 dropped:0 overruns:0 frame:0
582
	  TX packets:815 errors:0 dropped:0 overruns:0 carrier:0
582
	  TX packets:815 errors:0 dropped:0 overruns:0 carrier:0
583
	  collisions:0 txqueuelen:0
583
	  collisions:0 txqueuelen:0
584
	  RX bytes:129915 (126.8 KiB)  TX bytes:204857 (200.0 KiB)
584
	  RX bytes:129915 (126.8 KiB)  TX bytes:204857 (200.0 KiB)
585
585
586
vif1.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
586
vif1.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
587
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
587
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
588
	  RX packets:3 errors:0 dropped:0 overruns:0 frame:0
588
	  RX packets:3 errors:0 dropped:0 overruns:0 frame:0
589
	  TX packets:2 errors:0 dropped:157 overruns:0 carrier:0
589
	  TX packets:2 errors:0 dropped:157 overruns:0 carrier:0
590
	  collisions:0 txqueuelen:1
590
	  collisions:0 txqueuelen:1
591
	  RX bytes:140 (140.0 b)  TX bytes:158 (158.0 b)
591
	  RX bytes:140 (140.0 b)  TX bytes:158 (158.0 b)
592
592
593
xenbr1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
593
xenbr1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
594
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
594
	  UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
595
	  RX packets:4 errors:0 dropped:0 overruns:0 frame:0
595
	  RX packets:4 errors:0 dropped:0 overruns:0 frame:0
596
	  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
596
	  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
597
	  collisions:0 txqueuelen:0
597
	  collisions:0 txqueuelen:0
598
	  RX bytes:112 (112.0 b)  TX bytes:0 (0.0 b)</screen>
598
	  RX bytes:112 (112.0 b)  TX bytes:0 (0.0 b)</screen>
599
599
600
      <screen>&prompt.root; <userinput>brctl show</userinput>
600
      <screen>&prompt.root; <userinput>brctl show</userinput>
601
bridge name     bridge id           STP enabled         interfaces
601
bridge name     bridge id           STP enabled         interfaces
602
xenbr1          8000.feffffffffff   no                  vif0.1
602
xenbr1          8000.feffffffffff   no                  vif0.1
603
                                                        peth0
603
                                                        peth0
604
                                                        vif1.0</screen>
604
                                                        vif1.0</screen>
605
	</sect3>
605
	</sect3>
606
      </sect2>
606
      </sect2>
607
-->
607
-->
608
    <sect2 xml:id="virtualization-guest-virtualpc">
608
    <sect2 xml:id="virtualization-guest-virtualpc">
609
      <title><application>Virtual PC</application> on
609
      <title><application>Virtual PC</application> on
610
	&windows;</title>
610
	&windows;</title>
611
611
612
      <para><application>Virtual PC</application> for &windows; is a
612
      <para><application>Virtual PC</application> for &windows; is a
613
	&microsoft; software product available for free download.  See
613
	&microsoft; software product available for free download.  See
614
	this website for the <link
614
	this website for the <link
615
	  xlink:href="http://www.microsoft.com/windows/downloads/virtualpc/sysreq.mspx">system
615
	  xlink:href="http://www.microsoft.com/windows/downloads/virtualpc/sysreq.mspx">system
616
	  requirements</link>.  Once <application>Virtual
616
	  requirements</link>.  Once <application>Virtual
617
	  PC</application> has been installed on &microsoft.windows;,
617
	  PC</application> has been installed on &microsoft.windows;,
618
	the user can configure a virtual machine and then install the
618
	the user can configure a virtual machine and then install the
619
	desired guest operating system.</para>
619
	desired guest operating system.</para>
620
620
621
      <sect3 xml:id="virtualization-guest-virtualpc-install">
621
      <sect3 xml:id="virtualization-guest-virtualpc-install">
622
	<title>Installing &os; on <application>Virtual
622
	<title>Installing &os; on <application>Virtual
623
	    PC</application></title>
623
	    PC</application></title>
624
624
625
	<para>The first step in installing &os; on
625
	<para>The first step in installing &os; on
626
	  <application>Virtual PC </application> is to create a new
626
	  <application>Virtual PC </application> is to create a new
627
	  virtual machine for installing &os;.  Select
627
	  virtual machine for installing &os;.  Select
628
	  <guimenuitem>Create a virtual machine</guimenuitem> when
628
	  <guimenuitem>Create a virtual machine</guimenuitem> when
629
	  prompted:</para>
629
	  prompted:</para>
630
630
631
	<mediaobject>
631
	<mediaobject>
632
	  <imageobject>
632
	  <imageobject>
633
	    <imagedata fileref="virtualization/virtualpc-freebsd1"/>
633
	    <imagedata fileref="virtualization/virtualpc-freebsd1"/>
634
	  </imageobject>
634
	  </imageobject>
635
	</mediaobject>
635
	</mediaobject>
636
636
637
	<mediaobject>
637
	<mediaobject>
638
	  <imageobject>
638
	  <imageobject>
639
	    <imagedata fileref="virtualization/virtualpc-freebsd2"/>
639
	    <imagedata fileref="virtualization/virtualpc-freebsd2"/>
640
	  </imageobject>
640
	  </imageobject>
641
	</mediaobject>
641
	</mediaobject>
642
642
643
	<para>Select <guimenuitem>Other</guimenuitem> as the
643
	<para>Select <guimenuitem>Other</guimenuitem> as the
644
	  <guimenuitem>Operating system</guimenuitem> when
644
	  <guimenuitem>Operating system</guimenuitem> when
645
	  prompted:</para>
645
	  prompted:</para>
646
646
647
	<mediaobject>
647
	<mediaobject>
648
	  <imageobject>
648
	  <imageobject>
649
	    <imagedata fileref="virtualization/virtualpc-freebsd3"/>
649
	    <imagedata fileref="virtualization/virtualpc-freebsd3"/>
650
	  </imageobject>
650
	  </imageobject>
651
	</mediaobject>
651
	</mediaobject>
652
652
653
	<para>Then, choose a reasonable amount of disk and memory
653
	<para>Then, choose a reasonable amount of disk and memory
654
	  depending on the plans for this virtual &os; instance.
654
	  depending on the plans for this virtual &os; instance.
655
	  4GB of disk space and 512MB of RAM work well for most uses
655
	  4GB of disk space and 512MB of RAM work well for most uses
656
	  of &os; under <application>Virtual PC</application>:</para>
656
	  of &os; under <application>Virtual PC</application>:</para>
657
657
658
	<mediaobject>
658
	<mediaobject>
659
	  <imageobject>
659
	  <imageobject>
660
	    <imagedata fileref="virtualization/virtualpc-freebsd4"/>
660
	    <imagedata fileref="virtualization/virtualpc-freebsd4"/>
661
	  </imageobject>
661
	  </imageobject>
662
	</mediaobject>
662
	</mediaobject>
663
663
664
	<mediaobject>
664
	<mediaobject>
665
	  <imageobject>
665
	  <imageobject>
666
	    <imagedata fileref="virtualization/virtualpc-freebsd5"/>
666
	    <imagedata fileref="virtualization/virtualpc-freebsd5"/>
667
	  </imageobject>
667
	  </imageobject>
668
	</mediaobject>
668
	</mediaobject>
669
669
670
	<para>Save and finish the configuration:</para>
670
	<para>Save and finish the configuration:</para>
671
671
672
	<mediaobject>
672
	<mediaobject>
673
	  <imageobject>
673
	  <imageobject>
674
	    <imagedata fileref="virtualization/virtualpc-freebsd6"/>
674
	    <imagedata fileref="virtualization/virtualpc-freebsd6"/>
675
	  </imageobject>
675
	  </imageobject>
676
	</mediaobject>
676
	</mediaobject>
677
677
678
	<para>Select the &os; virtual machine and click
678
	<para>Select the &os; virtual machine and click
679
	  <guimenu>Settings</guimenu>, then set the type of networking
679
	  <guimenu>Settings</guimenu>, then set the type of networking
680
	  and a network interface:</para>
680
	  and a network interface:</para>
681
681
682
	<mediaobject>
682
	<mediaobject>
683
	  <imageobject>
683
	  <imageobject>
684
	    <imagedata fileref="virtualization/virtualpc-freebsd7"/>
684
	    <imagedata fileref="virtualization/virtualpc-freebsd7"/>
685
	  </imageobject>
685
	  </imageobject>
686
	</mediaobject>
686
	</mediaobject>
687
687
688
	<mediaobject>
688
	<mediaobject>
689
	  <imageobject>
689
	  <imageobject>
690
	    <imagedata fileref="virtualization/virtualpc-freebsd8"/>
690
	    <imagedata fileref="virtualization/virtualpc-freebsd8"/>
691
	  </imageobject>
691
	  </imageobject>
692
	</mediaobject>
692
	</mediaobject>
693
693
694
	<para>After the &os; virtual machine has been created, &os;
694
	<para>After the &os; virtual machine has been created, &os;
695
	  can be installed on it.  This is best done with an
695
	  can be installed on it.  This is best done with an
696
	  official &os; CD/DVD or with an ISO image downloaded from an
696
	  official &os; CD/DVD or with an ISO image downloaded from an
697
	  official FTP site.  Copy the appropriate ISO image to the
697
	  official FTP site.  Copy the appropriate ISO image to the
698
	  local &windows; filesystem or insert a CD/DVD in the CD
698
	  local &windows; filesystem or insert a CD/DVD in the CD
699
	  drive, then double click on the &os; virtual machine to
699
	  drive, then double click on the &os; virtual machine to
700
	  boot.  Then, click <guimenu>CD</guimenu> and choose
700
	  boot.  Then, click <guimenu>CD</guimenu> and choose
701
	  <guimenu>Capture ISO Image...</guimenu> on the
701
	  <guimenu>Capture ISO Image...</guimenu> on the
702
	  <application>Virtual PC</application> window.  This will
702
	  <application>Virtual PC</application> window.  This will
703
	  bring up a window where the CDROM drive in the virtual
703
	  bring up a window where the CDROM drive in the virtual
704
	  machine can be associated with an ISO file on disk or
704
	  machine can be associated with an ISO file on disk or
705
	  with the real CDROM drive.</para>
705
	  with the real CDROM drive.</para>
706
706
707
	<mediaobject>
707
	<mediaobject>
708
	  <imageobject>
708
	  <imageobject>
709
	    <imagedata fileref="virtualization/virtualpc-freebsd9"/>
709
	    <imagedata fileref="virtualization/virtualpc-freebsd9"/>
710
	  </imageobject>
710
	  </imageobject>
711
	</mediaobject>
711
	</mediaobject>
712
712
713
	<mediaobject>
713
	<mediaobject>
714
	  <imageobject>
714
	  <imageobject>
715
	    <imagedata fileref="virtualization/virtualpc-freebsd10"/>
715
	    <imagedata fileref="virtualization/virtualpc-freebsd10"/>
716
	  </imageobject>
716
	  </imageobject>
717
	</mediaobject>
717
	</mediaobject>
718
718
719
	<para>Once this association with the CDROM source has been
719
	<para>Once this association with the CDROM source has been
720
	  made, reboot the &os; virtual machine by clicking
720
	  made, reboot the &os; virtual machine by clicking
721
	  <guimenu>Action</guimenu> and <guimenu>Reset</guimenu>.
721
	  <guimenu>Action</guimenu> and <guimenu>Reset</guimenu>.
722
	  <application>Virtual PC</application> will reboot with a
722
	  <application>Virtual PC</application> will reboot with a
723
	  special BIOS that first checks for a CDROM.</para>
723
	  special BIOS that first checks for a CDROM.</para>
724
724
725
	<mediaobject>
725
	<mediaobject>
726
	  <imageobject>
726
	  <imageobject>
727
	    <imagedata fileref="virtualization/virtualpc-freebsd11"/>
727
	    <imagedata fileref="virtualization/virtualpc-freebsd11"/>
728
	  </imageobject>
728
	  </imageobject>
729
	</mediaobject>
729
	</mediaobject>
730
730
731
	<para>In this case it will find the &os; installation media
731
	<para>In this case it will find the &os; installation media
732
	  and begin a normal &os; installation.  Continue with the
732
	  and begin a normal &os; installation.  Continue with the
733
	  installation, but do not attempt to configure
733
	  installation, but do not attempt to configure
734
	  <application>&xorg;</application> at this time.</para>
734
	  <application>&xorg;</application> at this time.</para>
735
735
736
	<mediaobject>
736
	<mediaobject>
737
	  <imageobject>
737
	  <imageobject>
738
	    <imagedata fileref="virtualization/virtualpc-freebsd12"/>
738
	    <imagedata fileref="virtualization/virtualpc-freebsd12"/>
739
	  </imageobject>
739
	  </imageobject>
740
	</mediaobject>
740
	</mediaobject>
741
741
742
	<para>When the installation is finished, remember to eject
742
	<para>When the installation is finished, remember to eject
743
	  the CD/DVD or release the ISO image.  Finally, reboot into
743
	  the CD/DVD or release the ISO image.  Finally, reboot into
744
	  the newly installed &os; virtual machine.</para>
744
	  the newly installed &os; virtual machine.</para>
745
745
746
	<mediaobject>
746
	<mediaobject>
747
	  <imageobject>
747
	  <imageobject>
748
	    <imagedata fileref="virtualization/virtualpc-freebsd13"/>
748
	    <imagedata fileref="virtualization/virtualpc-freebsd13"/>
749
	  </imageobject>
749
	  </imageobject>
750
	</mediaobject>
750
	</mediaobject>
751
      </sect3>
751
      </sect3>
752
752
753
      <sect3 xml:id="virtualization-guest-virtualpc-configure">
753
      <sect3 xml:id="virtualization-guest-virtualpc-configure">
754
	<title>Configuring &os; on <application>Virtual
754
	<title>Configuring &os; on <application>Virtual
755
	    PC</application></title>
755
	    PC</application></title>
756
756
757
	<para>After &os; has been successfully installed on
757
	<para>After &os; has been successfully installed on
758
	  &microsoft.windows; with <application>Virtual PC
758
	  &microsoft.windows; with <application>Virtual PC
759
	  </application>, there are a number of configuration
759
	  </application>, there are a number of configuration
760
	  steps that can be taken to optimize the system for
760
	  steps that can be taken to optimize the system for
761
	  virtualized operation.</para>
761
	  virtualized operation.</para>
762
762
763
	<procedure>
763
	<procedure>
764
	  <step>
764
	  <step>
765
	    <title>Set Boot Loader Variables</title>
765
	    <title>Set Boot Loader Variables</title>
766
766
767
	    <para>The most important step is to reduce the
767
	    <para>The most important step is to reduce the
768
	      <option>kern.hz</option> tunable to reduce the CPU
768
	      <option>kern.hz</option> tunable to reduce the CPU
769
	      utilization of &os; under the <application>Virtual
769
	      utilization of &os; under the <application>Virtual
770
		PC</application> environment.  This is accomplished
770
		PC</application> environment.  This is accomplished
771
	      by adding the following line to
771
	      by adding the following line to
772
	      <filename> /boot/loader.conf</filename>:</para>
772
	      <filename> /boot/loader.conf</filename>:</para>
773
773
774
	      <programlisting>kern.hz=100</programlisting>
774
	      <programlisting>kern.hz=100</programlisting>
775
775
776
	    <para>Without this setting, an idle &os;
776
	    <para>Without this setting, an idle &os;
777
	      <application>Virtual PC</application> guest OS will
777
	      <application>Virtual PC</application> guest OS will
778
	      use roughly 40% of the CPU of a single processor
778
	      use roughly 40% of the CPU of a single processor
779
	      computer.  After this change, the usage will be
779
	      computer.  After this change, the usage will be
780
	      closer to 3%.</para>
780
	      closer to 3%.</para>
781
	  </step>
781
	  </step>
782
782
783
	  <step>
783
	  <step>
784
	    <title>Create a New Kernel Configuration File</title>
784
	    <title>Create a New Kernel Configuration File</title>
785
785
786
	    <para>All of the SCSI, FireWire, and USB device drivers
786
	    <para>All of the SCSI, FireWire, and USB device drivers
787
	      can be removed from a custom kernel configuration file.
787
	      can be removed from a custom kernel configuration file.
788
	      <application>Virtual PC</application> provides a virtual
788
	      <application>Virtual PC</application> provides a virtual
789
	      network adapter used by the &man.de.4; driver, so all
789
	      network adapter used by the &man.de.4; driver, so all
790
	      network devices except for &man.de.4; and &man.miibus.4;
790
	      network devices except for &man.de.4; and &man.miibus.4;
791
	      can be removed from the kernel.</para>
791
	      can be removed from the kernel.</para>
792
	  </step>
792
	  </step>
793
793
794
	  <step>
794
	  <step>
795
	    <title>Configure Networking</title>
795
	    <title>Configure Networking</title>
796
796
797
	    <para>The most basic networking setup uses DHCP to connect
797
	    <para>The most basic networking setup uses DHCP to connect
798
	      the virtual machine to the same local area network as
798
	      the virtual machine to the same local area network as
799
	      the &microsoft.windows; host.  This can be accomplished
799
	      the &microsoft.windows; host.  This can be accomplished
800
	      by adding <literal>ifconfig_de0="DHCP"</literal> to
800
	      by adding <literal>ifconfig_de0="DHCP"</literal> to
801
	      <filename>/etc/rc.conf</filename>.  More advanced
801
	      <filename>/etc/rc.conf</filename>.  More advanced
802
	      networking setups are described in
802
	      networking setups are described in
803
	      <xref linkend="advanced-networking"/>.</para>
803
	      <xref linkend="advanced-networking"/>.</para>
804
	  </step>
804
	  </step>
805
	</procedure>
805
	</procedure>
806
      </sect3>
806
      </sect3>
807
    </sect2>
807
    </sect2>
808
808
809
    <sect2 xml:id="virtualization-guest-vmware">
809
    <sect2 xml:id="virtualization-guest-vmware">
810
      <title><application>VMware Fusion</application> on
810
      <title><application>VMware Fusion</application> on
811
	&macos;</title>
811
	&macos;</title>
812
812
813
      <para><application>VMware Fusion</application> for &mac; is a
813
      <para><application>VMware Fusion</application> for &mac; is a
814
	commercial software product available for &intel; based
814
	commercial software product available for &intel; based
815
	&apple; &mac; computers running &macos; 10.4.9 or higher.
815
	&apple; &mac; computers running &macos; 10.4.9 or higher.
816
	&os; is a fully supported guest operating system.  Once
816
	&os; is a fully supported guest operating system.  Once
817
	<application>VMware Fusion</application> has been
817
	<application>VMware Fusion</application> has been
818
	installed on &macos; X, the user can configure a virtual
818
	installed on &macos; X, the user can configure a virtual
819
	machine and then install the desired guest operating
819
	machine and then install the desired guest operating
820
	system.</para>
820
	system.</para>
821
821
822
      <sect3 xml:id="virtualization-guest-vmware-install">
822
      <sect3 xml:id="virtualization-guest-vmware-install">
823
	<title>Installing &os; on <application>VMware
823
	<title>Installing &os; on <application>VMware
824
	    Fusion</application></title>
824
	    Fusion</application></title>
825
825
826
	<para>The first step is to start <application>VMware
826
	<para>The first step is to start <application>VMware
827
	    Fusion</application> which will load the Virtual
827
	    Fusion</application> which will load the Virtual
828
	  Machine Library.  Click <guimenuitem>New</guimenuitem> to
828
	  Machine Library.  Click <guimenuitem>New</guimenuitem> to
829
	  create the virtual machine:</para>
829
	  create the virtual machine:</para>
830
830
831
	<mediaobject>
831
	<mediaobject>
832
	  <imageobject>
832
	  <imageobject>
833
	    <imagedata fileref="virtualization/vmware-freebsd01"/>
833
	    <imagedata fileref="virtualization/vmware-freebsd01"/>
834
	  </imageobject>
834
	  </imageobject>
835
	</mediaobject>
835
	</mediaobject>
836
836
837
	<para>This will load the New Virtual Machine Assistant.  Click
837
	<para>This will load the New Virtual Machine Assistant.  Click
838
	  <guimenuitem>Continue</guimenuitem> to proceed:</para>
838
	  <guimenuitem>Continue</guimenuitem> to proceed:</para>
839
839
840
	<mediaobject>
840
	<mediaobject>
841
	  <imageobject>
841
	  <imageobject>
842
	    <imagedata fileref="virtualization/vmware-freebsd02"/>
842
	    <imagedata fileref="virtualization/vmware-freebsd02"/>
843
	  </imageobject>
843
	  </imageobject>
844
	</mediaobject>
844
	</mediaobject>
845
845
846
	<para>Select <guimenuitem>Other</guimenuitem> as the
846
	<para>Select <guimenuitem>Other</guimenuitem> as the
847
	  <guimenuitem>Operating System</guimenuitem> and either
847
	  <guimenuitem>Operating System</guimenuitem> and either
848
	  <guimenuitem>&os;</guimenuitem> or
848
	  <guimenuitem>&os;</guimenuitem> or
849
	  <guimenuitem>&os; 64-bit</guimenuitem>, as the
849
	  <guimenuitem>&os; 64-bit</guimenuitem>, as the
850
	  <guimenu>Version</guimenu> when prompted:</para>
850
	  <guimenu>Version</guimenu> when prompted:</para>
851
851
852
	<mediaobject>
852
	<mediaobject>
853
	  <imageobject>
853
	  <imageobject>
854
	    <imagedata fileref="virtualization/vmware-freebsd03"/>
854
	    <imagedata fileref="virtualization/vmware-freebsd03"/>
855
	  </imageobject>
855
	  </imageobject>
856
	</mediaobject>
856
	</mediaobject>
857
857
858
	<para>Choose the name of the virtual machine and the directory
858
	<para>Choose the name of the virtual machine and the directory
859
	  where it should be saved:</para>
859
	  where it should be saved:</para>
860
860
861
	<mediaobject>
861
	<mediaobject>
862
	  <imageobject>
862
	  <imageobject>
863
	    <imagedata fileref="virtualization/vmware-freebsd04"/>
863
	    <imagedata fileref="virtualization/vmware-freebsd04"/>
864
	  </imageobject>
864
	  </imageobject>
865
	</mediaobject>
865
	</mediaobject>
866
866
867
	<para>Choose the size of the Virtual Hard Disk for the virtual
867
	<para>Choose the size of the Virtual Hard Disk for the virtual
868
	  machine:</para>
868
	  machine:</para>
869
869
870
	<mediaobject>
870
	<mediaobject>
871
	  <imageobject>
871
	  <imageobject>
872
	    <imagedata fileref="virtualization/vmware-freebsd05"/>
872
	    <imagedata fileref="virtualization/vmware-freebsd05"/>
873
	  </imageobject>
873
	  </imageobject>
874
	</mediaobject>
874
	</mediaobject>
875
875
876
	<para>Choose the method to install the virtual machine,
876
	<para>Choose the method to install the virtual machine,
877
	  either from an ISO image or from a CD/DVD:</para>
877
	  either from an ISO image or from a CD/DVD:</para>
878
878
879
	<mediaobject>
879
	<mediaobject>
880
	  <imageobject>
880
	  <imageobject>
881
	    <imagedata fileref="virtualization/vmware-freebsd06"/>
881
	    <imagedata fileref="virtualization/vmware-freebsd06"/>
882
	  </imageobject>
882
	  </imageobject>
883
	</mediaobject>
883
	</mediaobject>
884
884
885
	<para>Click <guimenuitem>Finish</guimenuitem> and the virtual
885
	<para>Click <guimenuitem>Finish</guimenuitem> and the virtual
886
	  machine will boot:</para>
886
	  machine will boot:</para>
887
887
888
	<mediaobject>
888
	<mediaobject>
889
	  <imageobject>
889
	  <imageobject>
890
	    <imagedata fileref="virtualization/vmware-freebsd07"/>
890
	    <imagedata fileref="virtualization/vmware-freebsd07"/>
891
	  </imageobject>
891
	  </imageobject>
892
	</mediaobject>
892
	</mediaobject>
893
893
894
	<para>Install &os; as usual:</para>
894
	<para>Install &os; as usual:</para>
895
895
896
	<mediaobject>
896
	<mediaobject>
897
	  <imageobject>
897
	  <imageobject>
898
	    <imagedata fileref="virtualization/vmware-freebsd08"/>
898
	    <imagedata fileref="virtualization/vmware-freebsd08"/>
899
	  </imageobject>
899
	  </imageobject>
900
	</mediaobject>
900
	</mediaobject>
901
901
902
	<para>Once the install is complete, the settings
902
	<para>Once the install is complete, the settings
903
	  of the virtual machine can be modified, such as memory
903
	  of the virtual machine can be modified, such as memory
904
	  usage:</para>
904
	  usage:</para>
905
905
906
	<note>
906
	<note>
907
	  <para>The System Hardware settings of the virtual machine
907
	  <para>The System Hardware settings of the virtual machine
908
	    cannot be modified while the virtual machine is
908
	    cannot be modified while the virtual machine is
909
	    running.</para>
909
	    running.</para>
910
	</note>
910
	</note>
911
911
912
	<mediaobject>
912
	<mediaobject>
913
	  <imageobject>
913
	  <imageobject>
914
	    <imagedata fileref="virtualization/vmware-freebsd09"/>
914
	    <imagedata fileref="virtualization/vmware-freebsd09"/>
915
	  </imageobject>
915
	  </imageobject>
916
	</mediaobject>
916
	</mediaobject>
917
917
918
	<para>The number of CPUs the virtual machine will have access
918
	<para>The number of CPUs the virtual machine will have access
919
	  to:</para>
919
	  to:</para>
920
920
921
	<mediaobject>
921
	<mediaobject>
922
	  <imageobject>
922
	  <imageobject>
923
	    <imagedata fileref="virtualization/vmware-freebsd10"/>
923
	    <imagedata fileref="virtualization/vmware-freebsd10"/>
924
	  </imageobject>
924
	  </imageobject>
925
	</mediaobject>
925
	</mediaobject>
926
926
927
	<para>The status of the CDROM device.  Normally the
927
	<para>The status of the CDROM device.  Normally the
928
	  CD/DVD/ISO is disconnected from the virtual machine when it
928
	  CD/DVD/ISO is disconnected from the virtual machine when it
929
	  is no longer needed.</para>
929
	  is no longer needed.</para>
930
930
931
	<mediaobject>
931
	<mediaobject>
932
	  <imageobject>
932
	  <imageobject>
933
	    <imagedata fileref="virtualization/vmware-freebsd11"/>
933
	    <imagedata fileref="virtualization/vmware-freebsd11"/>
934
	  </imageobject>
934
	  </imageobject>
935
	</mediaobject>
935
	</mediaobject>
936
936
937
	<para>The last thing to change is how the virtual machine will
937
	<para>The last thing to change is how the virtual machine will
938
	  connect to the network.  To allow connections to the virtual
938
	  connect to the network.  To allow connections to the virtual
939
	  machine from other machines besides the host, choose
939
	  machine from other machines besides the host, choose
940
	  <guimenuitem>Connect directly to the physical network
940
	  <guimenuitem>Connect directly to the physical network
941
	  (Bridged)</guimenuitem>.  Otherwise, <guimenuitem>Share the
941
	  (Bridged)</guimenuitem>.  Otherwise, <guimenuitem>Share the
942
	    host's internet connection (NAT)</guimenuitem> is
942
	    host's internet connection (NAT)</guimenuitem> is
943
	  preferred so that the virtual machine can have access to the
943
	  preferred so that the virtual machine can have access to the
944
	  Internet, but the network cannot access the virtual
944
	  Internet, but the network cannot access the virtual
945
	  machine.</para>
945
	  machine.</para>
946
946
947
	<mediaobject>
947
	<mediaobject>
948
	  <imageobject>
948
	  <imageobject>
949
	    <imagedata fileref="virtualization/vmware-freebsd12"/>
949
	    <imagedata fileref="virtualization/vmware-freebsd12"/>
950
	  </imageobject>
950
	  </imageobject>
951
	</mediaobject>
951
	</mediaobject>
952
952
953
	<para>After modifying the settings, boot the newly installed
953
	<para>After modifying the settings, boot the newly installed
954
	  &os; virtual machine.</para>
954
	  &os; virtual machine.</para>
955
      </sect3>
955
      </sect3>
956
956
957
      <sect3 xml:id="virtualization-guest-vmware-configure">
957
      <sect3 xml:id="virtualization-guest-vmware-configure">
958
	<title>Configuring &os; on <application>VMware
958
	<title>Configuring &os; on <application>VMware
959
	    Fusion</application></title>
959
	    Fusion</application></title>
960
960
961
	<para>After &os; has been successfully installed on &macos; X
961
	<para>After &os; has been successfully installed on &macos; X
962
	  with <application>VMware Fusion</application>, there are a
962
	  with <application>VMware Fusion</application>, there are a
963
	  number of configuration steps that can be taken to optimize
963
	  number of configuration steps that can be taken to optimize
964
	  the system for virtualized operation.</para>
964
	  the system for virtualized operation.</para>
965
965
966
	<procedure>
966
	<procedure>
967
	  <step>
967
	  <step>
968
	    <title>Set Boot Loader Variables</title>
968
	    <title>Set Boot Loader Variables</title>
969
969
970
	    <para>The most important step is to reduce the
970
	    <para>The most important step is to reduce the
971
	      <option>kern.hz</option> tunable to reduce the CPU
971
	      <option>kern.hz</option> tunable to reduce the CPU
972
	      utilization of &os; under the
972
	      utilization of &os; under the
973
	      <application>VMware Fusion</application> environment.
973
	      <application>VMware Fusion</application> environment.
974
	      This is accomplished by adding the following line to
974
	      This is accomplished by adding the following line to
975
	      <filename>/boot/loader.conf</filename>:</para>
975
	      <filename>/boot/loader.conf</filename>:</para>
976
976
977
	    <programlisting>kern.hz=100</programlisting>
977
	    <programlisting>kern.hz=100</programlisting>
978
978
979
	    <para>Without this setting, an idle &os;
979
	    <para>Without this setting, an idle &os;
980
	      <application>VMware Fusion</application> guest will use
980
	      <application>VMware Fusion</application> guest will use
981
	      roughly 15% of the CPU of a single processor &imac;.
981
	      roughly 15% of the CPU of a single processor &imac;.
982
	      After this change, the usage will be closer to
982
	      After this change, the usage will be closer to
983
	      5%.</para>
983
	      5%.</para>
984
	  </step>
984
	  </step>
985
985
986
	  <step>
986
	  <step>
987
	    <title>Create a New Kernel Configuration File</title>
987
	    <title>Create a New Kernel Configuration File</title>
988
988
989
	    <para>All of the FireWire, and USB device drivers can be
989
	    <para>All of the FireWire, and USB device drivers can be
990
	      removed from a custom kernel configuration file.
990
	      removed from a custom kernel configuration file.
991
	      <application>VMware Fusion</application> provides a
991
	      <application>VMware Fusion</application> provides a
992
	      virtual network adapter used by the &man.em.4; driver,
992
	      virtual network adapter used by the &man.em.4; driver,
993
	      so all  network devices except for &man.em.4; can be
993
	      so all  network devices except for &man.em.4; can be
994
	      removed from the kernel.</para>
994
	      removed from the kernel.</para>
995
	  </step>
995
	  </step>
996
996
997
	  <step>
997
	  <step>
998
	    <title>Configure Networking</title>
998
	    <title>Configure Networking</title>
999
999
1000
	    <para>The most basic networking setup uses DHCP to connect
1000
	    <para>The most basic networking setup uses DHCP to connect
1001
	      the virtual machine to the same local area network as
1001
	      the virtual machine to the same local area network as
1002
	      the host &mac;.  This can be accomplished by adding
1002
	      the host &mac;.  This can be accomplished by adding
1003
	      <literal>ifconfig_em0="DHCP"</literal> to
1003
	      <literal>ifconfig_em0="DHCP"</literal> to
1004
	      <filename>/etc/rc.conf</filename>.  More advanced
1004
	      <filename>/etc/rc.conf</filename>.  More advanced
1005
	      networking setups are described in
1005
	      networking setups are described in
1006
	      <xref linkend="advanced-networking"/>.</para>
1006
	      <xref linkend="advanced-networking"/>.</para>
1007
	  </step>
1007
	  </step>
1008
	</procedure>
1008
	</procedure>
1009
      </sect3>
1009
      </sect3>
1010
    </sect2>
1010
    </sect2>
1011
1011
1012
    <sect2 xml:id="virtualization-guest-virtualbox-guest-additions">
1012
    <sect2 xml:id="virtualization-guest-virtualbox-guest-additions">
1013
      <title>&virtualbox; Guest Additions on a &os; Guest</title>
1013
      <title>&virtualbox; Guest Additions on a &os; Guest</title>
1014
1014
1015
      <para>The <application>&virtualbox;</application> guest
1015
      <para>The <application>&virtualbox;</application> guest
1016
	additions provide support for:</para>
1016
	additions provide support for:</para>
1017
1017
1018
      <itemizedlist>
1018
      <itemizedlist>
1019
	<listitem>
1019
	<listitem>
1020
	  <para>Clipboard sharing.</para>
1020
	  <para>Clipboard sharing.</para>
1021
	</listitem>
1021
	</listitem>
1022
1022
1023
	<listitem>
1023
	<listitem>
1024
	  <para>Mouse pointer integration.</para>
1024
	  <para>Mouse pointer integration.</para>
1025
	</listitem>
1025
	</listitem>
1026
1026
1027
	<listitem>
1027
	<listitem>
1028
	  <para>Host time synchronization.</para>
1028
	  <para>Host time synchronization.</para>
1029
	</listitem>
1029
	</listitem>
1030
1030
1031
	<listitem>
1031
	<listitem>
1032
	  <para>Window scaling.</para>
1032
	  <para>Window scaling.</para>
1033
	</listitem>
1033
	</listitem>
1034
1034
1035
	<listitem>
1035
	<listitem>
1036
	  <para>Seamless mode.</para>
1036
	  <para>Seamless mode.</para>
1037
	</listitem>
1037
	</listitem>
1038
      </itemizedlist>
1038
      </itemizedlist>
1039
1039
1040
      <note>
1040
      <note>
1041
	<para>The following commands are run in the &os; guest.</para>
1041
	<para>The following commands are run in the &os; guest.</para>
1042
      </note>
1042
      </note>
1043
1043
1044
      <para>First, install the
1044
      <para>First, install the
1045
	<package>emulators/virtualbox-ose-additions</package> package
1045
	<package>emulators/virtualbox-ose-additions</package> package
1046
	or port in the &os; guest.  This will install the port:</para>
1046
	or port in the &os; guest.  This will install the port:</para>
1047
1047
1048
      <screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose-additions &amp;&amp; make install clean</userinput></screen>
1048
      <screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose-additions &amp;&amp; make install clean</userinput></screen>
1049
1049
1050
      <para>Add these lines to
1050
      <para>Add these lines to
1051
	<filename>/etc/rc.conf</filename>:</para>
1051
	<filename>/etc/rc.conf</filename>:</para>
1052
1052
1053
      <programlisting>vboxguest_enable="YES"
1053
      <programlisting>vboxguest_enable="YES"
1054
vboxservice_enable="YES"</programlisting>
1054
vboxservice_enable="YES"</programlisting>
1055
1055
1056
      <para>When <application>Xorg</application> will be used in the
1056
      <para>When <application>Xorg</application> will be used in the
1057
	guest, any required supporting services must also be enabled
1057
	guest, any required supporting services must also be enabled
1058
	just as if the guest was a physical machine.  Typically, these
1058
	just as if the guest was a physical machine.  Typically, these
1059
	lines would also be added to
1059
	lines would also be added to
1060
	<filename>/etc/rc.conf</filename>:</para>
1060
	<filename>/etc/rc.conf</filename>:</para>
1061
1061
1062
<programlisting>hald_enable="YES"
1062
<programlisting>hald_enable="YES"
1063
dbus_enable="YES"</programlisting>
1063
dbus_enable="YES"</programlisting>
1064
1064
1065
      <para>See <xref linkend="x-config"/> for details.</para>
1065
      <para>See <xref linkend="x-config"/> for details.</para>
1066
1066
1067
      <para>If &man.ntpd.8; or &man.ntpdate.8; is used, disable host
1067
      <para>If &man.ntpd.8; or &man.ntpdate.8; is used, disable host
1068
	time synchronization:</para>
1068
	time synchronization:</para>
1069
1069
1070
      <programlisting>vboxservice_flags="--disable-timesync"</programlisting>
1070
      <programlisting>vboxservice_flags="--disable-timesync"</programlisting>
1071
1071
1072
      <para><application>Xorg</application> will automatically
1072
      <para><application>Xorg</application> will automatically
1073
	recognize the <literal>vboxvideo</literal> driver.
1073
	recognize the <literal>vboxvideo</literal> driver.
1074
	It can also be manually entered in
1074
	It can also be manually entered in
1075
	<filename>/etc/X11/xorg.conf</filename>:</para>
1075
	<filename>/etc/X11/xorg.conf</filename>:</para>
1076
1076
1077
      <programlisting>Section "Device"
1077
      <programlisting>Section "Device"
1078
	### Available Driver options are:-
1078
	### Available Driver options are:-
1079
	### Values: &lt;i&gt;: integer, &lt;f&gt;: float, &lt;bool&gt;: "True"/"False",
1079
	### Values: &lt;i&gt;: integer, &lt;f&gt;: float, &lt;bool&gt;: "True"/"False",
1080
	### &lt;string&gt;: "String", &lt;freq&gt;: "&lt;f&gt; Hz/kHz/MHz"
1080
	### &lt;string&gt;: "String", &lt;freq&gt;: "&lt;f&gt; Hz/kHz/MHz"
1081
	### [arg]: arg optional
1081
	### [arg]: arg optional
1082
	Identifier "Card0"
1082
	Identifier "Card0"
1083
	Driver "vboxvideo"
1083
	Driver "vboxvideo"
1084
	VendorName "InnoTek Systemberatung GmbH"
1084
	VendorName "InnoTek Systemberatung GmbH"
1085
	BoardName "VirtualBox Graphics Adapter"
1085
	BoardName "VirtualBox Graphics Adapter"
1086
	BusID "PCI:0:2:0"
1086
	BusID "PCI:0:2:0"
1087
EndSection</programlisting>
1087
EndSection</programlisting>
1088
1088
1089
      <para>To use the <literal>vboxmouse</literal> driver, adjust the
1089
      <para>To use the <literal>vboxmouse</literal> driver, adjust the
1090
	mouse section in
1090
	mouse section in
1091
	<filename>/etc/X11/xorg.conf</filename>:</para>
1091
	<filename>/etc/X11/xorg.conf</filename>:</para>
1092
1092
1093
      <programlisting>Section "InputDevice"
1093
      <programlisting>Section "InputDevice"
1094
	Identifier "Mouse0"
1094
	Identifier "Mouse0"
1095
	Driver "vboxmouse"
1095
	Driver "vboxmouse"
1096
EndSection</programlisting>
1096
EndSection</programlisting>
1097
1097
1098
      <para><acronym>HAL</acronym> users should create the following
1098
      <para><acronym>HAL</acronym> users should create the following
1099
	<filename>/usr/local/etc/hal/fdi/policy/90-vboxguest.fdi</filename>
1099
	<filename>/usr/local/etc/hal/fdi/policy/90-vboxguest.fdi</filename>
1100
	or copy it from
1100
	or copy it from
1101
	<filename>/usr/local/share/hal/fdi/policy/10osvendor/90-vboxguest.fdi</filename>:</para>
1101
	<filename>/usr/local/share/hal/fdi/policy/10osvendor/90-vboxguest.fdi</filename>:</para>
1102
1102
1103
      <programlisting>&lt;?xml version="1.0" encoding="utf-8"?&gt;
1103
      <programlisting>&lt;?xml version="1.0" encoding="utf-8"?&gt;
1104
&lt;!--
1104
&lt;!--
1105
# Sun VirtualBox
1105
# Sun VirtualBox
1106
# Hal driver description for the vboxmouse driver
1106
# Hal driver description for the vboxmouse driver
1107
# $Id: chapter.xml,v 1.33 2012-03-17 04:53:52 eadler Exp $
1107
# $Id: chapter.xml,v 1.33 2012-03-17 04:53:52 eadler Exp $
1108
1108
1109
	Copyright (C) 2008-2009 Sun Microsystems, Inc.
1109
	Copyright (C) 2008-2009 Sun Microsystems, Inc.
1110
1110
1111
	This file is part of VirtualBox Open Source Edition (OSE, as
1111
	This file is part of VirtualBox Open Source Edition (OSE, as
1112
	available from http://www.virtualbox.org. This file is free software;
1112
	available from http://www.virtualbox.org. This file is free software;
1113
	you can redistribute it and/or modify it under the terms of the GNU
1113
	you can redistribute it and/or modify it under the terms of the GNU
1114
	General Public License (GPL) as published by the Free Software
1114
	General Public License (GPL) as published by the Free Software
1115
	Foundation, in version 2 as it comes in the "COPYING" file of the
1115
	Foundation, in version 2 as it comes in the "COPYING" file of the
1116
	VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1116
	VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1117
	hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1117
	hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1118
1118
1119
	Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1119
	Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1120
	Clara, CA 95054 USA or visit http://www.sun.com if you need
1120
	Clara, CA 95054 USA or visit http://www.sun.com if you need
1121
	additional information or have any questions.
1121
	additional information or have any questions.
1122
--&gt;
1122
--&gt;
1123
&lt;deviceinfo version="0.2"&gt;
1123
&lt;deviceinfo version="0.2"&gt;
1124
  &lt;device&gt;
1124
  &lt;device&gt;
1125
    &lt;match key="info.subsystem" string="pci"&gt;
1125
    &lt;match key="info.subsystem" string="pci"&gt;
1126
      &lt;match key="info.product" string="VirtualBox guest Service"&gt;
1126
      &lt;match key="info.product" string="VirtualBox guest Service"&gt;
1127
        &lt;append key="info.capabilities" type="strlist"&gt;input&lt;/append&gt;
1127
        &lt;append key="info.capabilities" type="strlist"&gt;input&lt;/append&gt;
1128
	&lt;append key="info.capabilities" type="strlist"&gt;input.mouse&lt;/append&gt;
1128
	&lt;append key="info.capabilities" type="strlist"&gt;input.mouse&lt;/append&gt;
1129
        &lt;merge key="input.x11_driver" type="string"&gt;vboxmouse&lt;/merge&gt;
1129
        &lt;merge key="input.x11_driver" type="string"&gt;vboxmouse&lt;/merge&gt;
1130
	&lt;merge key="input.device" type="string"&gt;/dev/vboxguest&lt;/merge&gt;
1130
	&lt;merge key="input.device" type="string"&gt;/dev/vboxguest&lt;/merge&gt;
1131
      &lt;/match&gt;
1131
      &lt;/match&gt;
1132
    &lt;/match&gt;
1132
    &lt;/match&gt;
1133
  &lt;/device&gt;
1133
  &lt;/device&gt;
1134
&lt;/deviceinfo&gt;</programlisting>
1134
&lt;/deviceinfo&gt;</programlisting>
1135
    </sect2>
1135
    </sect2>
1136
  </sect1>
1136
  </sect1>
1137
1137
1138
  <sect1 xml:id="virtualization-host-virtualbox">
1138
  <sect1 xml:id="virtualization-host-virtualbox">
1139
    <title>&os; as a Host with
1139
    <title>&os; as a Host with
1140
      <application>VirtualBox</application></title>
1140
      <application>VirtualBox</application></title>
1141
1141
1142
    <para><application>&virtualbox;</application> is an actively
1142
    <para><application>&virtualbox;</application> is an actively
1143
      developed, complete virtualization package, that is available
1143
      developed, complete virtualization package, that is available
1144
      for most operating systems including &windows;, &macos;, &linux;
1144
      for most operating systems including &windows;, &macos;, &linux;
1145
      and &os;.  It is equally capable of running &windows; or
1145
      and &os;.  It is equally capable of running &windows; or
1146
      &unix;-like guests.  It is released as open source software, but
1146
      &unix;-like guests.  It is released as open source software, but
1147
      with closed-source components available in a separate extension
1147
      with closed-source components available in a separate extension
1148
      pack.  These components include support for USB 2.0 devices.
1148
      pack.  These components include support for USB 2.0 devices.
1149
      More information may be found on the <link
1149
      More information may be found on the <link
1150
	xlink:href="http://www.virtualbox.org/wiki/Downloads"><quote>Downloads</quote>
1150
	xlink:href="http://www.virtualbox.org/wiki/Downloads"><quote>Downloads</quote>
1151
	page of the <application>&virtualbox;</application>
1151
	page of the <application>&virtualbox;</application>
1152
	wiki</link>.  Currently, these extensions are not available
1152
	wiki</link>.  Currently, these extensions are not available
1153
      for &os;.</para>
1153
      for &os;.</para>
1154
1154
1155
    <sect2 xml:id="virtualization-virtualbox-install">
1155
    <sect2 xml:id="virtualization-virtualbox-install">
1156
      <title>Installing &virtualbox;</title>
1156
      <title>Installing &virtualbox;</title>
1157
1157
1158
      <para><application>&virtualbox;</application> is available as a
1158
      <para><application>&virtualbox;</application> is available as a
1159
	&os; package or port in
1159
	&os; package or port in
1160
	<package>emulators/virtualbox-ose</package>.  The port can be
1160
	<package>emulators/virtualbox-ose</package>.  The port can be
1161
	installed using these commands:</para>
1161
	installed using these commands:</para>
1162
1162
1163
      <screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose</userinput>
1163
      <screen>&prompt.root; <userinput>cd /usr/ports/emulators/virtualbox-ose</userinput>
1164
&prompt.root; <userinput>make install clean</userinput></screen>
1164
&prompt.root; <userinput>make install clean</userinput></screen>
1165
1165
1166
      <para>One useful option in the port's configuration menu is the
1166
      <para>One useful option in the port's configuration menu is the
1167
	<literal>GuestAdditions</literal> suite of programs.  These
1167
	<literal>GuestAdditions</literal> suite of programs.  These
1168
	provide a number of useful features in guest operating
1168
	provide a number of useful features in guest operating
1169
	systems, like mouse pointer integration (allowing the mouse to
1169
	systems, like mouse pointer integration (allowing the mouse to
1170
	be shared between host and guest without the need to press a
1170
	be shared between host and guest without the need to press a
1171
	special keyboard shortcut to switch) and faster video
1171
	special keyboard shortcut to switch) and faster video
1172
	rendering, especially in &windows; guests.  The guest
1172
	rendering, especially in &windows; guests.  The guest
1173
	additions are available in the <guimenu>Devices</guimenu>
1173
	additions are available in the <guimenu>Devices</guimenu>
1174
	menu, after the installation of the guest is finished.</para>
1174
	menu, after the installation of the guest is finished.</para>
1175
1175
1176
      <para>A few configuration changes are needed before
1176
      <para>A few configuration changes are needed before
1177
	<application>&virtualbox;</application> is started for the
1177
	<application>&virtualbox;</application> is started for the
1178
	first time.  The port installs a kernel module in
1178
	first time.  The port installs a kernel module in
1179
	<filename>/boot/modules</filename> which
1179
	<filename>/boot/modules</filename> which
1180
	must be loaded into the running kernel:</para>
1180
	must be loaded into the running kernel:</para>
1181
1181
1182
      <screen>&prompt.root; <userinput>kldload vboxdrv</userinput></screen>
1182
      <screen>&prompt.root; <userinput>kldload vboxdrv</userinput></screen>
1183
1183
1184
      <para>To ensure the module always gets loaded after a reboot,
1184
      <para>To ensure the module always gets loaded after a reboot,
1185
	add the following line to
1185
	add the following line to
1186
	<filename>/boot/loader.conf</filename>:</para>
1186
	<filename>/boot/loader.conf</filename>:</para>
1187
1187
1188
      <programlisting>vboxdrv_load="YES"</programlisting>
1188
      <programlisting>vboxdrv_load="YES"</programlisting>
1189
1189
1190
      <para>To use the kernel modules that allow bridged or host-only
1190
      <para>To use the kernel modules that allow bridged or host-only
1191
	networking, add the following to
1191
	networking, add the following to
1192
	<filename>/etc/rc.conf</filename> and reboot the
1192
	<filename>/etc/rc.conf</filename> and reboot the
1193
	computer:</para>
1193
	computer:</para>
1194
1194
1195
      <programlisting>vboxnet_enable="YES"</programlisting>
1195
      <programlisting>vboxnet_enable="YES"</programlisting>
1196
1196
1197
      <para>The <systemitem class="groupname">vboxusers</systemitem>
1197
      <para>The <systemitem class="groupname">vboxusers</systemitem>
1198
	group is created during installation of
1198
	group is created during installation of
1199
	<application>&virtualbox;</application>.  All users that need
1199
	<application>&virtualbox;</application>.  All users that need
1200
	access to <application>&virtualbox;</application> will have to
1200
	access to <application>&virtualbox;</application> will have to
1201
	be added as members of this group.  <command>pw</command> can
1201
	be added as members of this group.  <command>pw</command> can
1202
	be used to add new members:</para>
1202
	be used to add new members:</para>
1203
1203
1204
      <screen>&prompt.root; <userinput>pw groupmod vboxusers -m <replaceable>yourusername</replaceable></userinput></screen>
1204
      <screen>&prompt.root; <userinput>pw groupmod vboxusers -m <replaceable>yourusername</replaceable></userinput></screen>
1205
1205
1206
      <para>The default permissions for
1206
      <para>The default permissions for
1207
	<filename>/dev/vboxnetctl</filename> are restrictive and need
1207
	<filename>/dev/vboxnetctl</filename> are restrictive and need
1208
	to be changed for bridged networking:</para>
1208
	to be changed for bridged networking:</para>
1209
1209
1210
      <screen>&prompt.root; <userinput>chown root:vboxusers /dev/vboxnetctl</userinput>
1210
      <screen>&prompt.root; <userinput>chown root:vboxusers /dev/vboxnetctl</userinput>
1211
&prompt.root; <userinput>chmod 0660 /dev/vboxnetctl</userinput></screen>
1211
&prompt.root; <userinput>chmod 0660 /dev/vboxnetctl</userinput></screen>
1212
1212
1213
      <para>To make this permissions change permanent, add these
1213
      <para>To make this permissions change permanent, add these
1214
	lines to <filename>/etc/devfs.conf</filename>:</para>
1214
	lines to <filename>/etc/devfs.conf</filename>:</para>
1215
1215
1216
      <programlisting>own     vboxnetctl root:vboxusers
1216
      <programlisting>own     vboxnetctl root:vboxusers
1217
perm    vboxnetctl 0660</programlisting>
1217
perm    vboxnetctl 0660</programlisting>
1218
1218
1219
      <para>To launch <application>&virtualbox;</application>,
1219
      <para>To launch <application>&virtualbox;</application>,
1220
	type from a <application>&xorg;</application> session:</para>
1220
	type from a <application>&xorg;</application> session:</para>
1221
1221
1222
      <screen>&prompt.user; <userinput>VirtualBox</userinput></screen>
1222
      <screen>&prompt.user; <userinput>VirtualBox</userinput></screen>
1223
1223
1224
      <para>For more information on configuring and using
1224
      <para>For more information on configuring and using
1225
	<application>&virtualbox;</application>, refer to the
1225
	<application>&virtualbox;</application>, refer to the
1226
	<link xlink:href="http://www.virtualbox.org">official
1226
	<link xlink:href="http://www.virtualbox.org">official
1227
	  website</link>.  For &os;-specific information and
1227
	  website</link>.  For &os;-specific information and
1228
	troubleshooting instructions, refer to the <link
1228
	troubleshooting instructions, refer to the <link
1229
	  xlink:href="http://wiki.FreeBSD.org/VirtualBox">relevant
1229
	  xlink:href="http://wiki.FreeBSD.org/VirtualBox">relevant
1230
	  page in the &os; wiki</link>.</para>
1230
	  page in the &os; wiki</link>.</para>
1231
    </sect2>
1231
    </sect2>
1232
1232
1233
    <sect2 xml:id="virtualization-virtualbox-usb-support">
1233
    <sect2 xml:id="virtualization-virtualbox-usb-support">
1234
      <title>&virtualbox; USB Support</title>
1234
      <title>&virtualbox; USB Support</title>
1235
1235
1236
      <para>In order to be able to read and write to USB devices,
1236
      <para>In order to be able to read and write to USB devices,
1237
	users need to be members of
1237
	users need to be members of
1238
	<systemitem class="groupname">operator</systemitem>:</para>
1238
	<systemitem class="groupname">operator</systemitem>:</para>
1239
1239
1240
      <screen>&prompt.root; <userinput>pw groupmod operator -m <replaceable>jerry</replaceable></userinput></screen>
1240
      <screen>&prompt.root; <userinput>pw groupmod operator -m <replaceable>jerry</replaceable></userinput></screen>
1241
1241
1242
      <para>Then, add the following to
1242
      <para>Then, add the following to
1243
	<filename>/etc/devfs.rules</filename>, or create this file if
1243
	<filename>/etc/devfs.rules</filename>, or create this file if
1244
	it does not exist yet:</para>
1244
	it does not exist yet:</para>
1245
1245
1246
      <programlisting>[system=10]
1246
      <programlisting>[system=10]
1247
add path 'usb/*' mode 0660 group operator</programlisting>
1247
add path 'usb/*' mode 0660 group operator</programlisting>
1248
1248
1249
      <para>To load these new rules, add the following to
1249
      <para>To load these new rules, add the following to
1250
	<filename>/etc/rc.conf</filename>:</para>
1250
	<filename>/etc/rc.conf</filename>:</para>
1251
1251
1252
      <programlisting>devfs_system_ruleset="system"</programlisting>
1252
      <programlisting>devfs_system_ruleset="system"</programlisting>
1253
1253
1254
      <para>Then, restart devfs:</para>
1254
      <para>Then, restart devfs:</para>
1255
1255
1256
      <screen>&prompt.root; <userinput>service devfs restart</userinput></screen>
1256
      <screen>&prompt.root; <userinput>service devfs restart</userinput></screen>
1257
1257
1258
      <para>USB can now be enabled in the guest operating system.  USB
1258
      <para>USB can now be enabled in the guest operating system.  USB
1259
	devices should be visible in the &virtualbox;
1259
	devices should be visible in the &virtualbox;
1260
	preferences.</para>
1260
	preferences.</para>
1261
    </sect2>
1261
    </sect2>
1262
1262
1263
    <sect2 xml:id="virtualization-virtualbox-host-dvd-cd-access">
1263
    <sect2 xml:id="virtualization-virtualbox-host-dvd-cd-access">
1264
      <title>&virtualbox; Host DVD/CD Access</title>
1264
      <title>&virtualbox; Host DVD/CD Access</title>
1265
1265
1266
      <para>Access to the host DVD/CD drives from guests is achieved
1266
      <para>Access to the host DVD/CD drives from guests is achieved
1267
	through the sharing of the physical drives.  Within
1267
	through the sharing of the physical drives.  Within
1268
	&virtualbox;, this is set up from the Storage window in the
1268
	&virtualbox;, this is set up from the Storage window in the
1269
	Settings of the virtual machine.  If needed, create an empty
1269
	Settings of the virtual machine.  If needed, create an empty
1270
	IDE CD/DVD device first.  Then choose the Host Drive from the
1270
	IDE CD/DVD device first.  Then choose the Host Drive from the
1271
	popup menu for the virtual CD/DVD drive selection.  A checkbox
1271
	popup menu for the virtual CD/DVD drive selection.  A checkbox
1272
	labeled <literal>Passthrough</literal> will appear.  This
1272
	labeled <literal>Passthrough</literal> will appear.  This
1273
	allows the virtual machine to use the hardware directly.  For
1273
	allows the virtual machine to use the hardware directly.  For
1274
	example, audio CDs or the burner will only function if this
1274
	example, audio CDs or the burner will only function if this
1275
	option is selected.</para>
1275
	option is selected.</para>
1276
1276
1277
      <para><acronym>HAL</acronym> needs to run for
1277
      <para><acronym>HAL</acronym> needs to run for
1278
	<application>&virtualbox;</application> DVD/CD functions to
1278
	<application>&virtualbox;</application> DVD/CD functions to
1279
	work, so enable it in <filename>/etc/rc.conf</filename> and
1279
	work, so enable it in <filename>/etc/rc.conf</filename> and
1280
	start it if it is not already running:</para>
1280
	start it if it is not already running:</para>
1281
1281
1282
      <programlisting>hald_enable="YES"</programlisting>
1282
      <programlisting>hald_enable="YES"</programlisting>
1283
1283
1284
      <screen>&prompt.root; <userinput>service hald start</userinput></screen>
1284
      <screen>&prompt.root; <userinput>service hald start</userinput></screen>
1285
1285
1286
      <para>In order for users to be able to use
1286
      <para>In order for users to be able to use
1287
	<application>&virtualbox;</application> DVD/CD functions, they
1287
	<application>&virtualbox;</application> DVD/CD functions, they
1288
	need access to <filename>/dev/xpt0</filename>,
1288
	need access to <filename>/dev/xpt0</filename>,
1289
	<filename>/dev/cd<replaceable>N</replaceable></filename>, and
1289
	<filename>/dev/cd<replaceable>N</replaceable></filename>, and
1290
	<filename>/dev/pass<replaceable>N</replaceable></filename>.
1290
	<filename>/dev/pass<replaceable>N</replaceable></filename>.
1291
	This is usually achieved by making the user a member of
1291
	This is usually achieved by making the user a member of
1292
	<systemitem class="groupname">operator</systemitem>.
1292
	<systemitem class="groupname">operator</systemitem>.
1293
	Permissions to these devices have to be corrected by adding
1293
	Permissions to these devices have to be corrected by adding
1294
	these lines to <filename>/etc/devfs.conf</filename>:</para>
1294
	these lines to <filename>/etc/devfs.conf</filename>:</para>
1295
1295
1296
      <programlisting>perm cd* 0660
1296
      <programlisting>perm cd* 0660
1297
perm xpt0 0660
1297
perm xpt0 0660
1298
perm pass* 0660</programlisting>
1298
perm pass* 0660</programlisting>
1299
1299
1300
      <screen>&prompt.root; <userinput>service devfs restart</userinput></screen>
1300
      <screen>&prompt.root; <userinput>service devfs restart</userinput></screen>
1301
    </sect2>
1301
    </sect2>
1302
  </sect1>
1302
  </sect1>
1303
1303
1304
  <sect1 xml:id="virtualization-host-bhyve">
1304
  <sect1 xml:id="virtualization-host-bhyve">
1305
    <title>&os; as a Host with
1305
    <title>&os; as a Host with
1306
      <application>bhyve</application></title>
1306
      <application>bhyve</application></title>
1307
1307
1308
    <para>Starting with &os; 10.0-RELEASE, the
1308
    <para>Starting with &os; 10.0-RELEASE, the
1309
      <application>bhyve</application> <acronym>BSD</acronym>-licensed
1309
      <application>bhyve</application> <acronym>BSD</acronym>-licensed
1310
      hypervisor is part of the base system.  This hypervisor supports
1310
      hypervisor is part of the base system.  This hypervisor supports
1311
      a number of guests, including &os;, OpenBSD, and many &linux;
1311
      a number of guests, including &os;, OpenBSD, and many &linux;
1312
      distributions.  Currently, <application>bhyve</application> only
1312
      distributions.  Currently, <application>bhyve</application> only
1313
      supports a serial console and does not emulate a graphical
1313
      supports a serial console and does not emulate a graphical
1314
      console.  As a legacy-free hypervisor, it relies on the
1314
      console.  As a legacy-free hypervisor, it relies on the
1315
      virtualization offload features of newer
1315
      virtualization offload features of newer
1316
      <acronym>CPU</acronym>s, instead of translating instructions and
1316
      <acronym>CPU</acronym>s, instead of translating instructions and
1317
      manually managing memory mappings.</para>
1317
      manually managing memory mappings.</para>
1318
1318
1319
    <para>Due to the design of <application>bhyve</application>, it
1319
    <para>Due to the design of <application>bhyve</application>, it
1320
      requires a computer with a newer processor that supports &intel;
1320
      requires a computer with a newer processor that supports &intel;
1321
      Extended Page Tables (<acronym>EPT</acronym>) or &amd; Rapid
1321
      Extended Page Tables (<acronym>EPT</acronym>) or &amd; Rapid
1322
      Virtualization Indexing (<acronym>RVI</acronym>), also known as
1322
      Virtualization Indexing (<acronym>RVI</acronym>), also known as
1323
      Nested Page Tables (<acronym>NPT</acronym>).  Most newer
1323
      Nested Page Tables (<acronym>NPT</acronym>).  In addition, to
1324
      processors, specifically the &intel;&nbsp;&core; i3/i5/i7 and
1324
      host &linux; guests, or &os; guests with more than one
1325
      &intel;&nbsp;&xeon; E3/E5/E7, support this feature.  For a
1325
      <acronym>vCPU</acronym>, <acronym>VMX</acronym> unrestricted
1326
      complete list of &intel; processors that support
1326
      mode support (<acronym>UG</acronym>) is also required.  Most
1327
      <acronym>EPT</acronym>, refer to <link
1327
      newer processors, specifically the &intel;&nbsp; &core;
1328
      xlink:href="http://ark.intel.com/search/advanced?s=t&amp;ExtendedPageTables=true">http://ark.intel.com/search/advanced?s=t&amp;ExtendedPageTables=true</link>.
1328
      i3/i5/i7 and &intel;&nbsp; &xeon; E3/E5/E7, support these
1329
      <acronym>RVI</acronym> is found on the 3rd  generation and later
1329
      features.  <acronym>UG</acronym> support was introduced with
1330
      of the &amd.opteron; (Barcelona) processors.  The easiest way to
1330
      Intel's Westmere micro-architecture.  For a complete list of
1331
      check for support of <acronym>EPT</acronym> or
1331
      &intel; processors that support <acronym>EPT</acronym>, refer
1332
      <acronym>RVI</acronym> is to look for the
1332
      to <link xlink:href="http://ark.intel.com/search/advanced?s=t&amp;ExtendedPageTables=true"/>.
1333
      <literal>POPCNT</literal> processor feature flag on the
1333
      <acronym>RVI</acronym> is found on the third generation and
1334
      <literal>Features2</literal> line in <command>dmesg</command> or
1334
      later of the &amd.opteron; (Barcelona) processors.  The easiest
1335
      <filename>/var/run/dmesg.boot</filename>.</para>
1335
      way to tell if a processor will support
1336
      <application>bhyve</application> is to run
1337
      <command>dmesg</command> or look in
1338
      <filename>/var/run/dmesg.boot</filename> for
1339
      the <literal>POPCNT</literal> processor feature flag on the
1340
      <literal>Features2</literal> line and <literal>EPT</literal> and
1341
      <literal>UG</literal> on the <literal>VT-x</literal> line.</para>
1336
1342
1337
    <sect2 xml:id="virtualization-bhyve-prep">
1343
    <sect2 xml:id="virtualization-bhyve-prep">
1338
      <title>Preparing the Host</title>
1344
      <title>Preparing the Host</title>
1339
1345
1340
      <para>The first step to creating a virtual machine in
1346
      <para>The first step to creating a virtual machine in
1341
	<application>bhyve</application> is configuring the host
1347
	<application>bhyve</application> is configuring the host
1342
	system.  First, load the <application>bhyve</application>
1348
	system.  First, load the <application>bhyve</application>
1343
	kernel module:</para>
1349
	kernel module:</para>
1344
1350
1345
      <screen>&prompt.root; <userinput>kldload vmm</userinput></screen>
1351
      <screen>&prompt.root; <userinput>kldload vmm</userinput></screen>
1346
1352
1347
      <para>Then, create a <filename>tap</filename> interface for the
1353
      <para>Then, create a <filename>tap</filename> interface for the
1348
	network device in the virtual machine to attach to.  In order
1354
	network device in the virtual machine to attach to.  In order
1349
	for the network device to participate in the network, also
1355
	for the network device to participate in the network, also
1350
	create a bridge interface containing the
1356
	create a bridge interface containing the
1351
	<filename>tap</filename> interface and the physical interface
1357
	<filename>tap</filename> interface and the physical interface
1352
	as members.  In this example, the physical interface is
1358
	as members.  In this example, the physical interface is
1353
	<replaceable>igb0</replaceable>:</para>
1359
	<replaceable>igb0</replaceable>:</para>
1354
1360
1355
      <screen>&prompt.root; <userinput>ifconfig <replaceable>tap0</replaceable> create</userinput>
1361
      <screen>&prompt.root; <userinput>ifconfig <replaceable>tap0</replaceable> create</userinput>
1356
&prompt.root; <userinput>sysctl net.link.tap.up_on_open=1</userinput>
1362
&prompt.root; <userinput>sysctl net.link.tap.up_on_open=1</userinput>
1357
net.link.tap.up_on_open: 0 -> 1
1363
net.link.tap.up_on_open: 0 -> 1
1358
&prompt.root; <userinput>ifconfig <replaceable>bridge0</replaceable> create</userinput>
1364
&prompt.root; <userinput>ifconfig <replaceable>bridge0</replaceable> create</userinput>
1359
&prompt.root; <userinput>ifconfig <replaceable>bridge0</replaceable> addm <replaceable>igb0</replaceable> addm <replaceable>tap0</replaceable></userinput>
1365
&prompt.root; <userinput>ifconfig <replaceable>bridge0</replaceable> addm <replaceable>igb0</replaceable> addm <replaceable>tap0</replaceable></userinput>
1360
&prompt.root; <userinput>ifconfig <replaceable>bridge0</replaceable> up</userinput></screen>
1366
&prompt.root; <userinput>ifconfig <replaceable>bridge0</replaceable> up</userinput></screen>
1361
    </sect2>
1367
    </sect2>
1362
1368
1363
    <sect2 xml:id="virtualization-bhyve-freebsd">
1369
    <sect2 xml:id="virtualization-bhyve-freebsd">
1364
      <title>Creating a FreeBSD Guest</title>
1370
      <title>Creating a FreeBSD Guest</title>
1365
1371
1366
      <para>Create a file to use as the virtual disk for the guest
1372
      <para>Create a file to use as the virtual disk for the guest
1367
	machine.  Specify the size and name of the virtual
1373
	machine.  Specify the size and name of the virtual
1368
	disk:</para>
1374
	disk:</para>
1369
1375
1370
      <screen>&prompt.root; <userinput>truncate -s <replaceable>16G</replaceable> <replaceable>guest.img</replaceable></userinput></screen>
1376
      <screen>&prompt.root; <userinput>truncate -s <replaceable>16G</replaceable> <replaceable>guest.img</replaceable></userinput></screen>
1371
1377
1372
      <para>Download an installation image of &os; to install:</para>
1378
      <para>Download an installation image of &os; to install:</para>
1373
1379
1374
      <screen>&prompt.root; <userinput>fetch <replaceable>ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/10.0/FreeBSD-10.0-RELEASE-amd64-bootonly.iso</replaceable></userinput>
1380
      <screen>&prompt.root; <userinput>fetch <replaceable>ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/10.0/FreeBSD-10.0-RELEASE-amd64-bootonly.iso</replaceable></userinput>
1375
FreeBSD-10.0-RELEASE-amd64-bootonly.iso       100% of  209 MB  570 kBps 06m17s</screen>
1381
FreeBSD-10.0-RELEASE-amd64-bootonly.iso       100% of  209 MB  570 kBps 06m17s</screen>
1376
1382
1377
      <para>&os; comes with an example script for running a virtual
1383
      <para>&os; comes with an example script for running a virtual
1378
	machine in <application>bhyve</application>.  The script will
1384
	machine in <application>bhyve</application>.  The script will
1379
	start the virtual machine and run it in a loop, so it will
1385
	start the virtual machine and run it in a loop, so it will
1380
	automatically restart if it crashes.  The script takes a
1386
	automatically restart if it crashes.  The script takes a
1381
	number of options to control the configuration of the machine:
1387
	number of options to control the configuration of the machine:
1382
	<option>-c</option> controls the number of virtual CPUs,
1388
	<option>-c</option> controls the number of virtual CPUs,
1383
	<option>-m</option> limits the amount of memory available to
1389
	<option>-m</option> limits the amount of memory available to
1384
	the guest, <option>-t</option> defines which
1390
	the guest, <option>-t</option> defines which
1385
	<filename>tap</filename> device to use, <option>-d</option>
1391
	<filename>tap</filename> device to use, <option>-d</option>
1386
	indicates which disk image to use, <option>-i</option> tells
1392
	indicates which disk image to use, <option>-i</option> tells
1387
	<application>bhyve</application> to boot from the
1393
	<application>bhyve</application> to boot from the
1388
	<acronym>CD</acronym> image instead of the disk, and
1394
	<acronym>CD</acronym> image instead of the disk, and
1389
	<option>-I</option> defines which <acronym>CD</acronym> image
1395
	<option>-I</option> defines which <acronym>CD</acronym> image
1390
	to use.  The last parameter is the name of the virtual
1396
	to use.  The last parameter is the name of the virtual
1391
	machine, used to track the running machines.  This example
1397
	machine, used to track the running machines.  This example
1392
	starts the virtual machine in installation mode:</para>
1398
	starts the virtual machine in installation mode:</para>
1393
1399
1394
      <screen>&prompt.root; <userinput>sh /usr/share/examples/bhyve/vmrun.sh -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> -t tap0 -d <replaceable>guest.img</replaceable> -i -I <replaceable>FreeBSD-10.0-RELEASE-amd64-bootonly.iso</replaceable> <replaceable>guestname</replaceable></userinput></screen>
1400
      <screen>&prompt.root; <userinput>sh /usr/share/examples/bhyve/vmrun.sh -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> -t <replaceable>tap0</replaceable> -d <replaceable>guest.img</replaceable> -i -I <replaceable>FreeBSD-10.0-RELEASE-amd64-bootonly.iso</replaceable> <replaceable>guestname</replaceable></userinput></screen>
1395
1401
1396
      <para>The virtual machine will boot and start the installer.
1402
      <para>The virtual machine will boot and start the installer.
1397
	After installing a system in the virtual machine, when the
1403
	After installing a system in the virtual machine, when the
1398
	system asks about dropping in to a shell at the end of the
1404
	system asks about dropping in to a shell at the end of the
1399
	installation, choose <guibutton>Yes</guibutton>.  A small
1405
	installation, choose <guibutton>Yes</guibutton>.  A small
1400
	change needs to be made to make the system start with a serial
1406
	change needs to be made to make the system start with a serial
1401
	console.  Edit <filename>/etc/ttys</filename> and replace the
1407
	console.  Edit <filename>/etc/ttys</filename> and replace the
1402
	existing <literal>ttyu0</literal> line with:</para>
1408
	existing <literal>ttyu0</literal> line with:</para>
1403
1409
1404
      <programlisting>ttyu0   "/usr/libexec/getty 3wire"   xterm  on secure</programlisting>
1410
      <programlisting>ttyu0   "/usr/libexec/getty 3wire"   xterm  on secure</programlisting>
1405
1411
1406
      <note><para>Beginning with &os;&nbsp;9.3-RELEASE and
1412
      <note><para>Beginning with &os;&nbsp;9.3-RELEASE and
1407
	10.1-RELEASE the console is configured
1413
	10.1-RELEASE the console is configured
1408
	automatically.</para></note>
1414
	automatically.</para></note>
1409
1415
1410
      <para>Reboot the virtual machine.  While rebooting the virtual
1416
      <para>Reboot the virtual machine.  While rebooting the virtual
1411
	machine causes <application>bhyve</application> to exit, the
1417
	machine causes <application>bhyve</application> to exit, the
1412
	<filename>vmrun.sh</filename> script runs
1418
	<filename>vmrun.sh</filename> script runs
1413
	<command>bhyve</command> in a loop and will automatically
1419
	<command>bhyve</command> in a loop and will automatically
1414
	restart it.  When this happens, choose the reboot option from
1420
	restart it.  When this happens, choose the reboot option from
1415
	the boot loader menu in order to escape the loop.  Now the
1421
	the boot loader menu in order to escape the loop.  Now the
1416
	guest can be started from the virtual disk:</para>
1422
	guest can be started from the virtual disk:</para>
1417
1423
1418
      <screen>&prompt.root; <userinput>sh /usr/share/examples/bhyve/vmrun.sh -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> -t tap0 -d <replaceable>guest.img</replaceable> <replaceable>guestname</replaceable></userinput></screen>
1424
      <screen>&prompt.root; <userinput>sh /usr/share/examples/bhyve/vmrun.sh -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> -t <replaceable>tap0</replaceable> -d <replaceable>guest.img</replaceable> <replaceable>guestname</replaceable></userinput></screen>
1419
    </sect2>
1425
    </sect2>
1420
1426
1421
    <sect2 xml:id="virtualization-bhyve-linux">
1427
    <sect2 xml:id="virtualization-bhyve-linux">
1422
      <title>Creating a &linux; Guest</title>
1428
      <title>Creating a &linux; Guest</title>
1423
1429
1424
      <para>In order to boot operating systems other than &os;, the
1430
      <para>In order to boot operating systems other than &os;, the
1425
	<package>sysutils/grub2-bhyve</package> port must be first
1431
	<package>sysutils/grub2-bhyve</package> port must be first
1426
	installed.</para>
1432
	installed.</para>
1427
1433
1428
      <para>Next, create a file to use as the virtual disk for the
1434
      <para>Next, create a file to use as the virtual disk for the
1429
	guest machine:</para>
1435
	guest machine:</para>
1430
1436
1431
      <screen>&prompt.root; <userinput>truncate -s <replaceable>16G</replaceable> <replaceable>linux.img</replaceable></userinput></screen>
1437
      <screen>&prompt.root; <userinput>truncate -s <replaceable>16G</replaceable> <replaceable>linux.img</replaceable></userinput></screen>
1432
1438
1433
      <para>Starting a virtual machine with
1439
      <para>Starting a virtual machine with
1434
	<application>bhyve</application> is a two step process.  First
1440
	<application>bhyve</application> is a two step process.  First
1435
	a kernel must be loaded, then the guest can be started.  The
1441
	a kernel must be loaded, then the guest can be started.  The
1436
	&linux; kernel is loaded with
1442
	&linux; kernel is loaded with
1437
	<package>sysutils/grub2-bhyve</package>.  Create a
1443
	<package>sysutils/grub2-bhyve</package>.  Create a
1438
	<filename>device.map</filename> that
1444
	<filename>device.map</filename> that
1439
	<application>grub</application> will use to map the virtual
1445
	<application>grub</application> will use to map the virtual
1440
	devices to the files on the host system:</para>
1446
	devices to the files on the host system:</para>
1441
1447
1442
      <programlisting>(hd0) ./linux.img
1448
      <programlisting>(hd0) ./linux.img
1443
(cd0) ./somelinux.iso</programlisting>
1449
(cd0) ./somelinux.iso</programlisting>
1444
1450
1445
      <para>Use <package>sysutils/grub2-bhyve</package> to load the
1451
      <para>Use <package>sysutils/grub2-bhyve</package> to load the
1446
	&linux; kernel from the <acronym>ISO</acronym> image:</para>
1452
	&linux; kernel from the <acronym>ISO</acronym> image:</para>
1447
1453
1448
      <screen>&prompt.root; <userinput>grub-bhyve -m device.map -r cd0 -M <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1454
      <screen>&prompt.root; <userinput>grub-bhyve -m device.map -r cd0 -M <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1449
1455
1450
      <para>This will start grub.  If the installation
1456
      <para>This will start grub.  If the installation
1451
	<acronym>CD</acronym> contains a
1457
	<acronym>CD</acronym> contains a
1452
	<filename>grub.cfg</filename>, a menu will be displayed.
1458
	<filename>grub.cfg</filename>, a menu will be displayed.
1453
	If not, the <literal>vmlinuz</literal> and
1459
	If not, the <literal>vmlinuz</literal> and
1454
	<literal>initrd</literal> files must be located and loaded
1460
	<literal>initrd</literal> files must be located and loaded
1455
	manually:</para>
1461
	manually:</para>
1456
1462
1457
      <screen>grub> <userinput>ls</userinput>
1463
      <screen>grub> <userinput>ls</userinput>
1458
(hd0) (cd0) (cd0,msdos1) (host)
1464
(hd0) (cd0) (cd0,msdos1) (host)
1459
grub> <userinput>ls (cd0)/isolinux</userinput>
1465
grub> <userinput>ls (cd0)/isolinux</userinput>
1460
boot.cat boot.msg grub.conf initrd.img isolinux.bin isolinux.cfg memtest
1466
boot.cat boot.msg grub.conf initrd.img isolinux.bin isolinux.cfg memtest
1461
splash.jpg TRANS.TBL vesamenu.c32 vmlinuz
1467
splash.jpg TRANS.TBL vesamenu.c32 vmlinuz
1462
grub> <userinput>linux (cd0)/isolinux/vmlinuz</userinput>
1468
grub> <userinput>linux (cd0)/isolinux/vmlinuz</userinput>
1463
grub> <userinput>initrd (cd0)/isolinux/initrd.img</userinput>
1469
grub> <userinput>initrd (cd0)/isolinux/initrd.img</userinput>
1464
grub> <userinput>boot</userinput></screen>
1470
grub> <userinput>boot</userinput></screen>
1465
1471
1466
      <para>Now that the &linux; kernel is loaded, the guest can be
1472
      <para>Now that the &linux; kernel is loaded, the guest can be
1467
	started:</para>
1473
	started:</para>
1468
1474
1469
      <screen>&prompt.root; <userinput>bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./linux.img \
1475
      <screen>&prompt.root; <userinput>bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,<replaceable>tap1</replaceable> -s 3:0,virtio-blk,<replaceable>./linux.img</replaceable> \
1470
-s 4:0,ahci-cd,./somelinux.iso -l com1,stdio -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1476
    -s 4:0,ahci-cd,<replaceable>./somelinux.iso</replaceable> -l com1,stdio -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1471
1477
1472
      <para>The system will boot and start the installer.  After
1478
      <para>The system will boot and start the installer.  After
1473
	installing a system in the virtual machine, reboot the virtual
1479
	installing a system in the virtual machine, reboot the virtual
1474
	machine.  This will cause <application>bhyve</application> to
1480
	machine.  This will cause <application>bhyve</application> to
1475
	exit.  The instance of the virtual machine needs to be
1481
	exit.  The instance of the virtual machine needs to be
1476
	destroyed before it can be started again:</para>
1482
	destroyed before it can be started again:</para>
1477
1483
1478
      <screen>&prompt.root; <userinput>bhyvectl --destroy --vm=<replaceable>linuxguest</replaceable></userinput></screen>
1484
      <screen>&prompt.root; <userinput>bhyvectl --destroy --vm=<replaceable>linuxguest</replaceable></userinput></screen>
1479
1485
1480
      <para>Now the guest can be started directly from the virtual
1486
      <para>Now the guest can be started directly from the virtual
1481
	disk.  Load the kernel:</para>
1487
	disk.  Load the kernel:</para>
1482
1488
1483
      <screen>&prompt.root; <userinput>grub-bhyve -m device.map -r hd0,msdos1 -M <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput>
1489
      <screen>&prompt.root; <userinput>grub-bhyve -m device.map -r hd0,msdos1 -M <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput>
1484
grub> <userinput>ls</userinput>
1490
grub> <userinput>ls</userinput>
1485
(hd0) (hd0,msdos2) (hd0,msdos1) (cd0) (cd0,msdos1) (host)
1491
(hd0) (hd0,msdos2) (hd0,msdos1) (cd0) (cd0,msdos1) (host)
1486
(lvm/VolGroup-lv_swap) (lvm/VolGroup-lv_root)
1492
(lvm/VolGroup-lv_swap) (lvm/VolGroup-lv_root)
1487
grub> <userinput>ls (hd0,msdos1)/</userinput>
1493
grub> <userinput>ls (hd0,msdos1)/</userinput>
1488
lost+found/ grub/ efi/ System.map-2.6.32-431.el6.x86_64 config-2.6.32-431.el6.x
1494
lost+found/ grub/ efi/ System.map-2.6.32-431.el6.x86_64 config-2.6.32-431.el6.x
1489
86_64 symvers-2.6.32-431.el6.x86_64.gz vmlinuz-2.6.32-431.el6.x86_64
1495
86_64 symvers-2.6.32-431.el6.x86_64.gz vmlinuz-2.6.32-431.el6.x86_64
1490
initramfs-2.6.32-431.el6.x86_64.img
1496
initramfs-2.6.32-431.el6.x86_64.img
1491
grub> <userinput>linux (hd0,msdos1)/vmlinuz-2.6.32-431.el6.x86_64 root=/dev/mapper/VolGroup-lv_root</userinput>
1497
grub> <userinput>linux (hd0,msdos1)/vmlinuz-2.6.32-431.el6.x86_64 root=/dev/mapper/VolGroup-lv_root</userinput>
1492
grub> <userinput>initrd (hd0,msdos1)/initramfs-2.6.32-431.el6.x86_64.img</userinput>
1498
grub> <userinput>initrd (hd0,msdos1)/initramfs-2.6.32-431.el6.x86_64.img</userinput>
1493
grub> <userinput>boot</userinput></screen>
1499
grub> <userinput>boot</userinput></screen>
1494
1500
1495
      <para>Boot the virtual machine:</para>
1501
      <para>Boot the virtual machine:</para>
1496
1502
1497
      <screen>&prompt.root; <userinput>bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 \
1503
      <screen>&prompt.root; <userinput>bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,<replaceable>tap1</replaceable> \
1498
-s 3:0,virtio-blk,./linux.img -l com1,stdio -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1504
    -s 3:0,virtio-blk,<replaceable>./linux.img</replaceable> -l com1,stdio -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1499
1505
1500
      <para>&linux; will now boot in the virtual machine and
1506
      <para>&linux; will now boot in the virtual machine and
1501
	eventually present you with the login prompt.  Login and use
1507
	eventually present you with the login prompt.  Login and use
1502
	the virtual machine.  When you are finished, reboot the
1508
	the virtual machine.  When you are finished, reboot the
1503
	virtual machine to exit <application>bhyve</application>.
1509
	virtual machine to exit <application>bhyve</application>.
1504
	Destroy the virtual machine instance:</para>
1510
	Destroy the virtual machine instance:</para>
1505
1511
1506
      <screen>&prompt.root; <userinput>bhyvectl --destroy --vm=<replaceable>linuxguest</replaceable></userinput></screen>
1512
      <screen>&prompt.root; <userinput>bhyvectl --destroy --vm=<replaceable>linuxguest</replaceable></userinput></screen>
1507
    </sect2>
1513
    </sect2>
1508
1514
1515
    <sect2 xml:id="virtualization-bhyve-zfs">
1516
      <title>Using <acronym>ZFS</acronym> with
1517
        <application>bhyve</application> Guests</title>
1518
1519
      <para>If <acronym>ZFS</acronym> is available on the host
1520
        machine, using <acronym>ZFS</acronym> volumes
1521
	instead of disk image files can provide significant
1522
	performance benefits for the guest <acronym>VMs</acronym>.  A
1523
	<acronym>ZFS</acronym> volume can be created by:</para>
1524
1525
      <screen>&prompt.root; <userinput>zfs create -V<replaceable>16G</replaceable> -o volmode=dev <replaceable>zroot/linuxdisk0</replaceable></userinput></screen>
1526
1527
      <para>When starting the <acronym>VM</acronym>, specify the
1528
        <acronym>ZFS</acronym> volume as the disk drive:</para>
1529
1530
      <screen>&prompt.root; <userinput>bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,<replaceable>tap1</replaceable> -s3:0,virtio-blk,<replaceable>/dev/zvol/zroot/linuxdisk0</replaceable> \
1531
    -l com1,<replaceable>stdio</replaceable> -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput></screen>
1532
    </sect2>
1533
1509
    <sect2 xml:id="virtualization-bhyve-nmdm">
1534
    <sect2 xml:id="virtualization-bhyve-nmdm">
1510
      <title>Virtual Machine Consoles</title>
1535
      <title>Virtual Machine Consoles</title>
1511
1536
1512
      <para>It is advantageous to wrap the
1537
      <para>It is advantageous to wrap the
1513
	<application>bhyve</application> console in a session
1538
	<application>bhyve</application> console in a session
1514
	management tool such as <package>sysutils/tmux</package> or
1539
	management tool such as <package>sysutils/tmux</package> or
1515
	<package>sysutils/screen</package> in order to detach and
1540
	<package>sysutils/screen</package> in order to detach and
1516
	reattach to the console.  It is also possible to have the
1541
	reattach to the console.  It is also possible to have the
1517
	console of <application>bhyve</application> be a null modem
1542
	console of <application>bhyve</application> be a null modem
1518
	device that can be accessed with <command>cu</command>.  To do
1543
	device that can be accessed with <command>cu</command>.  To do
1519
	this, load the <filename>nmdm</filename> kernel module and
1544
	this, load the <filename>nmdm</filename> kernel module and
1520
	replace <option>-l com1,stdio</option> with
1545
	replace <option>-l com1,stdio</option> with
1521
	<option>-l com1,/dev/nmdm0A</option>.  The
1546
	<option>-l com1,/dev/nmdm0A</option>.  The
1522
	<filename>/dev/nmdm</filename> devices are created
1547
	<filename>/dev/nmdm</filename> devices are created
1523
	automatically as needed, where each is a pair, corresponding
1548
	automatically as needed, where each is a pair, corresponding
1524
	to the two ends of the null modem cable
1549
	to the two ends of the null modem cable
1525
	(<filename>/dev/nmdm1A</filename> and
1550
	(<filename>/dev/nmdm1A</filename> and
1526
	<filename>/dev/nmdm1B</filename>).  See &man.nmdm.4; for more
1551
	<filename>/dev/nmdm1B</filename>).  See &man.nmdm.4; for more
1527
	information.</para>
1552
	information.</para>
1528
1553
1529
      <screen>&prompt.root; <userinput>kldload nmdm</userinput>
1554
      <screen>&prompt.root; <userinput>kldload nmdm</userinput>
1530
&prompt.root; <userinput>bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./linux.img \
1555
&prompt.root; <userinput>bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,<replaceable>tap1</replaceable> -s 3:0,virtio-blk,<replaceable>./linux.img</replaceable> \
1531
-l com1,<replaceable>/dev/nmdm0A</replaceable> -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput>
1556
    -l com1,<replaceable>/dev/nmdm0A</replaceable> -c <replaceable>4</replaceable> -m <replaceable>1024M</replaceable> <replaceable>linuxguest</replaceable></userinput>
1532
&prompt.root; <userinput>cu -l /dev/nmdm0B -s 9600</userinput>
1557
&prompt.root; <userinput>cu -l <replaceable>/dev/nmdm0B</replaceable> -s 9600</userinput>
1533
Connected
1558
Connected
1534
1559
1535
Ubuntu 13.10 handbook ttyS0
1560
Ubuntu 13.10 handbook ttyS0
1536
1561
1537
handbook login:</screen>
1562
handbook login:</screen>
1538
    </sect2>
1563
    </sect2>
1539
1564
1540
    <sect2 xml:id="virtualization-bhyve-managing">
1565
    <sect2 xml:id="virtualization-bhyve-managing">
1541
      <title>Managing Virtual Machines</title>
1566
      <title>Managing Virtual Machines</title>
1542
1567
1543
      <para>A device node is created in <filename
1568
      <para>A device node is created in <filename
1544
	  role="directory">/dev/vmm</filename> for each virtual
1569
	  role="directory">/dev/vmm</filename> for each virtual
1545
	machine.  This allows the administrator to easily see a list
1570
	machine.  This allows the administrator to easily see a list
1546
	of the running virtual machines:</para>
1571
	of the running virtual machines:</para>
1547
1572
1548
      <screen>&prompt.root; <userinput>ls -al /dev/vmm</userinput>
1573
      <screen>&prompt.root; <userinput>ls -al /dev/vmm</userinput>
1549
total 1
1574
total 1
1550
dr-xr-xr-x   2 root  wheel    512 Mar 17 12:19 ./
1575
dr-xr-xr-x   2 root  wheel    512 Mar 17 12:19 ./
1551
dr-xr-xr-x  14 root  wheel    512 Mar 17 06:38 ../
1576
dr-xr-xr-x  14 root  wheel    512 Mar 17 06:38 ../
1552
crw-------   1 root  wheel  0x1a2 Mar 17 12:20 guestname
1577
crw-------   1 root  wheel  0x1a2 Mar 17 12:20 guestname
1553
crw-------   1 root  wheel  0x19f Mar 17 12:19 linuxguest
1578
crw-------   1 root  wheel  0x19f Mar 17 12:19 linuxguest
1554
crw-------   1 root  wheel  0x1a1 Mar 17 12:19 otherguest</screen>
1579
crw-------   1 root  wheel  0x1a1 Mar 17 12:19 otherguest</screen>
1555
1580
1556
      <para>A specified virtual machine can be destroyed using
1581
      <para>A specified virtual machine can be destroyed using
1557
	<command>bhyvectl</command>:</para>
1582
	<command>bhyvectl</command>:</para>
1558
1583
1559
      <screen>&prompt.root; bhyvectl --destroy --vm=<replaceable>guestname</replaceable></screen>
1584
      <screen>&prompt.root; bhyvectl --destroy --vm=<replaceable>guestname</replaceable></screen>
1560
    </sect2>
1585
    </sect2>
1561
1586
1562
    <sect2 xml:id="virtualization-bhyve-onboot">
1587
    <sect2 xml:id="virtualization-bhyve-onboot">
1563
      <title>Persistent Configuration</title>
1588
      <title>Persistent Configuration</title>
1564
1589
1565
      <para>In order to configure the system to start
1590
      <para>In order to configure the system to start
1566
	<application>bhyve</application> guests at boot time, add
1591
	<application>bhyve</application> guests at boot time, add
1567
	the following entries to in the following files:</para>
1592
	the following entries to in the following files:</para>
1568
1593
1569
      <procedure>
1594
      <procedure>
1570
	<step>
1595
	<step>
1571
	  <title><filename>/etc/sysctl.conf</filename></title>
1596
	  <title><filename>/etc/sysctl.conf</filename></title>
1572
1597
1573
	  <programlisting>net.link.tap.up_on_open=1</programlisting>
1598
	  <programlisting>net.link.tap.up_on_open=1</programlisting>
1574
	</step>
1599
	</step>
1575
1600
1576
	<step>
1601
	<step>
1577
	  <title><filename>/boot/loader.conf</filename></title>
1602
	  <title><filename>/boot/loader.conf</filename></title>
1578
1603
1579
	  <programlisting>vmm_load="YES"
1604
	  <programlisting>vmm_load="YES"
1580
nmdm_load="YES"
1605
nmdm_load="YES"
1581
if_bridge_load="YES"
1606
if_bridge_load="YES"
1582
if_tap_load="YES"</programlisting>
1607
if_tap_load="YES"</programlisting>
1583
	</step>
1608
	</step>
1584
1609
1585
	<step>
1610
	<step>
1586
	  <title><filename>/etc/rc.conf</filename></title>
1611
	  <title><filename>/etc/rc.conf</filename></title>
1587
1612
1588
	  <programlisting>cloned_interfaces="<replaceable>bridge0</replaceable> <replaceable>tap0</replaceable>"
1613
	  <programlisting>cloned_interfaces="<replaceable>bridge0</replaceable> <replaceable>tap0</replaceable>"
1589
ifconfig_bridge0="addm <replaceable>igb0</replaceable> addm <replaceable>tap0</replaceable>"</programlisting>
1614
ifconfig_bridge0="addm <replaceable>igb0</replaceable> addm <replaceable>tap0</replaceable>"</programlisting>
1590
	</step>
1615
	</step>
1591
      </procedure>
1616
      </procedure>
1592
    </sect2>
1617
    </sect2>
1593
<!--
1618
<!--
1594
  Note:  There is no working/end-user ready Xen support for FreeBSD as of 07-2010.
1619
  Note:  There is no working/end-user ready Xen support for FreeBSD as of 07-2010.
1595
         Hide all information regarding Xen under FreeBSD.
1620
         Hide all information regarding Xen under FreeBSD.
1596
1621
1597
    <sect2 id="virtualization-other">
1622
    <sect2 id="virtualization-other">
1598
      <title>Other Virtualization Options</title>
1623
      <title>Other Virtualization Options</title>
1599
1624
1600
      <para>There is ongoing work in getting
1625
      <para>There is ongoing work in getting
1601
	<application>&xen;</application>
1626
	<application>&xen;</application>
1602
	to work as a host environment on &os;.</para>
1627
	to work as a host environment on &os;.</para>
1603
    </sect2>
1628
    </sect2>
1604
-->
1629
-->
1605
  </sect1>
1630
  </sect1>
1606
</chapter>
1631
</chapter>

Return to bug 201578