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,446 Lines • ▼ Show 20 Lines | support in the host processor.</para> | ||||
</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;-CURRENT | based on Xen version 4.7. Systems running on &os;-12.0 or | ||||
with at least revision r336475 or higher, can use Xen 4.11 | newer can use Xen 4.11 provided by | ||||
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> | ||||
Show All 12 Lines | --> | ||||
details.</para> | details.</para> | ||||
<screen>&prompt.root; <userinput>sed -i '' -e 's/memorylocked=64K/memorylocked=unlimited/' /etc/login.conf</userinput> | <screen>&prompt.root; <userinput>sed -i '' -e 's/memorylocked=64K/memorylocked=unlimited/' /etc/login.conf</userinput> | ||||
&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen> | &prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen> | ||||
<para>Add an entry for the &xen; console to | <para>Add an entry for the &xen; console to | ||||
<filename>/etc/ttys</filename>:</para> | <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 | <para>Selecting a &xen; kernel in | ||||
<filename>/boot/loader.conf</filename> activates the Dom0. | <filename>/boot/loader.conf</filename> activates the Dom0. | ||||
&xen; also requires resources like CPU and memory from the | &xen; also requires resources like CPU and memory from the | ||||
host machine for itself and other DomU domains. How much CPU | host machine for itself and other DomU domains. How much CPU | ||||
and memory depends on the individual requirements and hardware | and memory depends on the individual requirements and hardware | ||||
capabilities. In this example, 8 GB of memory and 4 | capabilities. In this example, 8 GB of memory and 4 | ||||
virtual CPUs are made available for the Dom0. The serial | virtual CPUs are made available for the Dom0. The serial | ||||
console is also activated and logging options are | console is also activated and logging options are | ||||
defined.</para> | defined.</para> | ||||
<para>The following command is used for Xen 4.7 packages:</para> | <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> | <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_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> | &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 | <para>For Xen versions 4.11 and higher, the following command | ||||
should be used instead:</para> | 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_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> | &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 | <tip> | ||||
are stored in <filename>/var/log/xen</filename>. This | <para>Log files that &xen; creates for the DomU VMs | ||||
directory does not exist by default and must be | are stored in <filename>/var/log/xen</filename>. Please | ||||
created.</para> | be sure to check the contents of that directory if | ||||
experiencing issues.</para> | |||||
</tip> | |||||
<screen>&prompt.root; <userinput>mkdir -p /var/log/xen</userinput> | |||||
&prompt.root; <userinput>chmod 644 /var/log/xen</userinput></screen> | |||||
<para>&xen; provides a boot menu to activate and de-activate | <para>&xen; provides a boot menu to activate and de-activate | ||||
the hypervisor on demand in | the hypervisor on demand in | ||||
<filename>/boot/menu.rc.local</filename>:</para> | <filename>/boot/menu.rc.local</filename>:</para> | ||||
<screen>&prompt.root; <userinput>echo "try-include /boot/xen.4th" >> /boot/menu.rc.local</userinput></screen> | <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> | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | <para>Unprivileged domains consist of a configuration file and | ||||
the DomU can be files created by &man.truncate.1; or ZFS | the DomU can be files created by &man.truncate.1; or ZFS | ||||
volumes as described in <xref linkend="zfs-zfs-volume"/>. | volumes as described in <xref linkend="zfs-zfs-volume"/>. | ||||
In this example, a 20 GB volume is used. A VM is | In this example, a 20 GB volume is used. A VM is | ||||
created with the ZFS volume, a &os; ISO image, 1 GB of | created with the ZFS volume, a &os; ISO image, 1 GB of | ||||
RAM and two virtual CPUs. The ISO installation file is | RAM and two virtual CPUs. The ISO installation file is | ||||
retrieved with &man.fetch.1; and saved locally in a file | retrieved with &man.fetch.1; and saved locally in a file | ||||
called <filename>freebsd.iso</filename>.</para> | 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 GB called | <para>A ZFS volume of 20 GB called | ||||
<filename>xendisk0</filename> is created to serve as the disk | <filename>xendisk0</filename> is created to serve as the disk | ||||
space for the VM.</para> | space for the VM.</para> | ||||
<screen>&prompt.root; <userinput>zfs create -V20G -o volmode=dev zroot/xendisk0</userinput></screen> | <screen>&prompt.root; <userinput>zfs create -V20G -o volmode=dev zroot/xendisk0</userinput></screen> | ||||
<para>The new DomU guest VM is defined in a file. Some specific | <para>The new DomU guest VM is defined in a file. Some specific | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |