Update the Xen chapter to support newer versions of Xen.

This patch clarifies which versions of FreeBSD support Xen 4.7 (PVHv1)
and Xen 4.11 or greater (PVHv2). Additionally, improve a few of the
instructions. Use onifconsole for Xen, add a line to loader.conf to
load the tap device. Remove restrictions to use MMCFG PCI accesses for
Xen >= 4.11. Make /var/log/xen stand out a bit more by making it a tip.
Finally, the example guest was creating a 10.3 version of FreeBSD,
which is no longer supported. Update that to 12.0 and wrap it in
replaceable tags so that people know they can put something else there.

Big thanks to royger@ for the updates and doing the documentation work
before I had a chance to do it.

Submitted by:		royger@
Reported by:		freebsd-xen mailinglist
Approved by:		bcr@
Differential Revision:	https://reviews.freebsd.org/D19106
This commit is contained in:
Benedict Reuschling 2019-02-11 18:15:48 +00:00
parent 8d46adf8f1
commit cd9905f6bf
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=52813

View file

@ -1452,9 +1452,9 @@ kld_list="nmdm vmm"</programlisting>
<para>Users of &os;&nbsp;11 should install the
<package>emulators/xen-kernel47</package> and
<package>sysutils/xen-tools47</package> packages that are
based on Xen version 4.7. Systems running on &os;-CURRENT
with at least revision r336475 or higher, can use Xen 4.11
provided by <package>emulators/xen-kernel411</package> and
based on Xen version 4.7. Systems running on &os;-12.0 or
newer can use Xen 4.11 provided by
<package>emulators/xen-kernel411</package> and
<package>sysutils/xen-tools411</package>, respectively.</para>
<para>Configuration files must be edited to prepare the host
@ -1483,7 +1483,7 @@ kld_list="nmdm vmm"</programlisting>
<para>Add an entry for the &xen; console to
<filename>/etc/ttys</filename>:</para>
<screen>&prompt.root; <userinput>echo 'xc0 "/usr/libexec/getty Pc" xterm on secure' >> /etc/ttys</userinput></screen>
<screen>&prompt.root; <userinput>echo 'xc0 "/usr/libexec/getty Pc" xterm onifconsole secure' >> /etc/ttys</userinput></screen>
<para>Selecting a &xen; kernel in
<filename>/boot/loader.conf</filename> activates the Dom0.
@ -1498,23 +1498,23 @@ kld_list="nmdm vmm"</programlisting>
<para>The following command is used for Xen 4.7 packages:</para>
<screen>&prompt.root; <userinput>sysrc -f /boot/loader.conf hw.pci.mcfg=0</userinput>
&prompt.root; <userinput>sysrc -f /boot/loader.conf if_tap_load="YES"</userinput>
&prompt.root; <userinput>sysrc -f /boot/loader.conf xen_kernel="/boot/xen"</userinput>
&prompt.root; <userinput>sysrc -f /boot/loader.conf xen_cmdline="dom0_mem=<replaceable>8192M</replaceable> dom0_max_vcpus=<replaceable>4</replaceable> dom0pvh=1 console=com1,vga com1=115200,8n1 guest_loglvl=all loglvl=all"</userinput></screen>
<para>For Xen versions 4.11 and higher, the following command
should be used instead:</para>
<screen>&prompt.root; <userinput>sysrc -f /boot/loader.conf hw.pci.mcfg=0</userinput>
<screen>&prompt.root; <userinput>sysrc -f /boot/loader.conf if_tap_load="YES"</userinput>
&prompt.root; <userinput>sysrc -f /boot/loader.conf xen_kernel="/boot/xen"</userinput>
&prompt.root; <userinput>sysrc -f /boot/loader.conf xen_cmdline="dom0_mem=<replaceable>8192M</replaceable> dom0_max_vcpus=<replaceable>4</replaceable> dom0=pvh console=com1,vga com1=115200,8n1 guest_loglvl=all loglvl=all"</userinput></screen>
<para>Log files that &xen; creates for the Dom0 and DomU VMs
are stored in <filename>/var/log/xen</filename>. This
directory does not exist by default and must be
created.</para>
<screen>&prompt.root; <userinput>mkdir -p /var/log/xen</userinput>
&prompt.root; <userinput>chmod 644 /var/log/xen</userinput></screen>
<tip>
<para>Log files that &xen; creates for the DomU VMs
are stored in <filename>/var/log/xen</filename>. Please
be sure to check the contents of that directory if
experiencing issues.</para>
</tip>
<para>&xen; provides a boot menu to activate and de-activate
the hypervisor on demand in
@ -1576,7 +1576,7 @@ Domain-0 0 8192 4 r----- 962.0<
retrieved with &man.fetch.1; and saved locally in a file
called <filename>freebsd.iso</filename>.</para>
<screen>&prompt.root; <userinput>fetch <replaceable>ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/10.3/FreeBSD-10.3-RELEASE-amd64-bootonly.iso</replaceable> -o <replaceable>freebsd.iso</replaceable></userinput></screen>
<screen>&prompt.root; <userinput>fetch <replaceable>ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/<replaceable>12.0</replaceable>/FreeBSD-<replaceable>12.0</replaceable>-RELEASE-amd64-bootonly.iso</replaceable> -o <replaceable>freebsd.iso</replaceable></userinput></screen>
<para>A ZFS volume of 20&nbsp;GB called
<filename>xendisk0</filename> is created to serve as the disk