Changeset View
Changeset View
Standalone View
Standalone View
head/en_US.ISO8859-1/books/handbook/virtualization/chapter.xml
Show First 20 Lines • Show All 1,438 Lines • ▼ Show 20 Lines | <sect2 xml:id="virtualization-host-xen-requirements"> | ||||
<para>To run the &xen; hypervisor on a host, certain hardware | <para>To run the &xen; hypervisor on a host, certain hardware | ||||
functionality is required. Hardware virtualized domains | functionality is required. Hardware virtualized domains | ||||
require Extended Page Table (<link | require Extended Page Table (<link | ||||
xlink:href="http://en.wikipedia.org/wiki/Extended_Page_Table">EPT</link>) | xlink:href="http://en.wikipedia.org/wiki/Extended_Page_Table">EPT</link>) | ||||
and Input/Output Memory Management Unit (<link | and Input/Output Memory Management Unit (<link | ||||
xlink:href="http://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardware">IOMMU</link>) | xlink:href="http://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardware">IOMMU</link>) | ||||
support in the host processor.</para> | support in the host processor.</para> | ||||
<note> | |||||
<para>In order to run a FreeBSD &xen; Dom0 the box must be | |||||
booted using legacy boot (BIOS).</para> | |||||
</note> | |||||
</sect2> | </sect2> | ||||
<sect2 xml:id="virtualization-host-xen-dom0-setup"> | <sect2 xml:id="virtualization-host-xen-dom0-setup"> | ||||
<title>&xen; Dom0 Control Domain Setup</title> | <title>&xen; Dom0 Control Domain Setup</title> | ||||
<para>Users of &os; 11 should install the | <para>Users of &os; 11 should install the | ||||
<package>emulators/xen-kernel47</package> and | <package>emulators/xen-kernel47</package> and | ||||
<package>sysutils/xen-tools47</package> packages that are | <package>sysutils/xen-tools47</package> packages that are | ||||
based on Xen version 4.7. Systems running on &os;-12.0 or | based on Xen version 4.7. Systems running on &os;-12.0 or | ||||
newer can use Xen 4.11 provided by | newer can use Xen 4.11 provided by | ||||
<package>emulators/xen-kernel411</package> and | <package>emulators/xen-kernel411</package> and | ||||
<package>sysutils/xen-tools411</package>, respectively.</para> | <package>sysutils/xen-tools411</package>, respectively.</para> | ||||
<para>Configuration files must be edited to prepare the host | <para>Configuration files must be edited to prepare the host | ||||
for the Dom0 integration after the Xen packages are installed. | for the Dom0 integration after the Xen packages are installed. | ||||
An entry to <filename>/etc/sysctl.conf</filename> disables the | An entry to <filename>/etc/sysctl.conf</filename> disables the | ||||
limit on how many pages of memory are allowed to be wired. | limit on how many pages of memory are allowed to be wired. | ||||
Otherwise, DomU VMs with higher memory requirements will not | Otherwise, DomU VMs with higher memory requirements will not | ||||
run.</para> | run.</para> | ||||
<screen>&prompt.root; <userinput>sysrc -f /etc/sysctl.conf vm.max_wired=-1</userinput></screen> | <screen>&prompt.root; <userinput>echo 'vm.max_wired=-1' >> /etc/sysctl.conf</userinput></screen> | ||||
<para>Another memory-related setting involves changing | <para>Another memory-related setting involves changing | ||||
<filename>/etc/login.conf</filename>, setting the | <filename>/etc/login.conf</filename>, setting the | ||||
<literal>memorylocked</literal> option to | <literal>memorylocked</literal> option to | ||||
<literal>unlimited</literal>. Otherwise, creating DomU | <literal>unlimited</literal>. Otherwise, creating DomU | ||||
domains may fail with <errorname>Cannot allocate | domains may fail with <errorname>Cannot allocate | ||||
memory</errorname> errors. After making the change to | memory</errorname> errors. After making the change to | ||||
<filename>/etc/login.conf</filename>, run | <filename>/etc/login.conf</filename>, run | ||||
Show All 35 Lines | &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> | ||||
<tip> | <tip> | ||||
<para>Log files that &xen; creates for the DomU VMs | <para>Log files that &xen; creates for the DomU VMs | ||||
are stored in <filename>/var/log/xen</filename>. Please | are stored in <filename>/var/log/xen</filename>. Please | ||||
be sure to check the contents of that directory if | be sure to check the contents of that directory if | ||||
experiencing issues.</para> | experiencing issues.</para> | ||||
</tip> | </tip> | ||||
<para>&xen; provides a boot menu to activate and de-activate | |||||
the hypervisor on demand in | |||||
<filename>/boot/menu.rc.local</filename>:</para> | |||||
<screen>&prompt.root; <userinput>echo "try-include /boot/xen.4th" >> /boot/menu.rc.local</userinput></screen> | |||||
<para>Activate the xencommons service during system | <para>Activate the xencommons service during system | ||||
startup:</para> | startup:</para> | ||||
<screen>&prompt.root; <userinput>sysrc xencommons_enable=yes</userinput></screen> | <screen>&prompt.root; <userinput>sysrc xencommons_enable=yes</userinput></screen> | ||||
<para>These settings are enough to start a Dom0-enabled | <para>These settings are enough to start a Dom0-enabled | ||||
system. However, it lacks network functionality for the | system. However, it lacks network functionality for the | ||||
DomU machines. To fix that, define a bridged interface with | DomU machines. To fix that, define a bridged interface with | ||||
the main NIC of the system which the DomU VMs can use to | the main NIC of the system which the DomU VMs can use to | ||||
connect to the network. Replace | connect to the network. Replace | ||||
<replaceable>igb0</replaceable> with the host network | <replaceable>em0</replaceable> with the host network | ||||
interface name.</para> | interface name.</para> | ||||
<screen>&prompt.root; <userinput>sysrc autobridge_interfaces=bridge0</userinput> | <screen>&prompt.root; <userinput>sysrc cloned_interfaces="bridge0"</userinput> | ||||
&prompt.root; <userinput>sysrc autobridge_bridge0=<replaceable>igb0</replaceable></userinput> | &prompt.root; <userinput>sysrc ifconfig_bridge0="addm <replaceable>em0</replaceable> SYNCDHCP"</userinput> | ||||
&prompt.root; <userinput>sysrc ifconfig_bridge0=SYNCDHCP</userinput></screen> | &prompt.root; <userinput>sysrc ifconfig_<replaceable>em0</replaceable>="up"</userinput></screen> | ||||
<para>Restart the host to load the &xen; kernel and start the | <para>Restart the host to load the &xen; kernel and start the | ||||
Dom0.</para> | Dom0.</para> | ||||
<screen>&prompt.root; <userinput>reboot</userinput></screen> | <screen>&prompt.root; <userinput>reboot</userinput></screen> | ||||
<para>After successfully booting the &xen; kernel and logging | <para>After successfully booting the &xen; kernel and logging | ||||
into the system again, the &xen; management tool | into the system again, the &xen; management tool | ||||
▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines |