version 1.18, 2014/12/24 00:11:15
|
version 1.19, 2014/12/24 00:41:04
|
Line 27 code for Xen and need not be aware that
|
Line 27 code for Xen and need not be aware that
|
Attempts to access hardware registers are trapped and emulated. This |
Attempts to access hardware registers are trapped and emulated. This |
style is less efficient but can run unmodified guests. |
style is less efficient but can run unmodified guests. |
|
|
|
Generally any amd64 machine will work with Xen and PV guests. For HVM |
|
guests, the VMX cpu feature (Intel) or VT?? (amd64) is needed. TODO: |
|
Explain if i386 (non-amd64) machines can still be used - I think that |
|
witthe requirement to use PAE kernels is about the hypervisor being |
|
amd64 only. |
|
|
At boot, the dom0 kernel is loaded as module with Xen as the kernel. |
At boot, the dom0 kernel is loaded as module with Xen as the kernel. |
The dom0 can start one or more domUs. (Booting is explained in detail |
The dom0 can start one or more domUs. (Booting is explained in detail |
in the dom0 section.) |
in the dom0 section.) |
Line 50 architecture. This HOWTO presumes famil
|
Line 56 architecture. This HOWTO presumes famil
|
on i386/amd64 hardware and installing software from pkgsrc. |
on i386/amd64 hardware and installing software from pkgsrc. |
See also the [Xen website](http://www.xen.org/). |
See also the [Xen website](http://www.xen.org/). |
|
|
|
History |
|
------- |
|
|
|
NetBSD used to support Xen2; this has been removed. |
|
|
|
Before NetBSD's native bootloader could support Xen, the use of |
|
grub was recommended. If necessary, see the |
|
[old grub information](/xen/howto-grub/). |
|
|
Versions of Xen and NetBSD |
Versions of Xen and NetBSD |
========================== |
========================== |
|
|
Line 78 of 2014-12.
|
Line 93 of 2014-12.
|
|
|
Ideally newer versions of Xen will be added to pkgsrc. |
Ideally newer versions of Xen will be added to pkgsrc. |
|
|
|
Xen command program |
|
------------------- |
|
|
|
Early Xen used a program called "xm" to manipulate the system from the |
|
dom0. Starting in 4.1, a replacement program with similar behavior |
|
called "xl" is provided. In 4.2, "xm" is no longer available. |
|
|
NetBSD |
NetBSD |
------ |
------ |
|
|
Line 106 Recommendation
|
Line 128 Recommendation
|
-------------- |
-------------- |
|
|
Therefore, this HOWTO recommends running xenkernel42 (and xentools42), |
Therefore, this HOWTO recommends running xenkernel42 (and xentools42), |
the NetBSD 6 stable branch, and to use amd64 as the dom0. Either the |
xl, the NetBSD 6 stable branch, and to use amd64 as the dom0. Either |
i386 or amd64 of NetBSD may be used as domUs. |
the i386 or amd64 of NetBSD may be used as domUs. |
|
|
NetBSD as a dom0 |
NetBSD as a dom0 |
================ |
================ |
|
|
NetBSD can be used as a dom0 and works very well. The following |
NetBSD can be used as a dom0 and works very well. The following |
sections address installation, updating NetBSD, and updating Xen. |
sections address installation, updating NetBSD, and updating Xen. |
|
Note that it doesn't make sense to talk about installing a dom0 OS |
|
without also installing Xen itself. We first address installing |
|
NetBSD, which is not yet a dom0, and then adding Xen, pivoting the |
|
NetBSD install to a dom0 install by just changing the kernel and boot |
|
configuration. |
|
|
Styles of dom0 operation |
Styles of dom0 operation |
------------------------ |
------------------------ |
Line 136 Xen daemons when not running Xen.
|
Line 163 Xen daemons when not running Xen.
|
Note that NetBSD as dom0 does not support multiple CPUs. This will |
Note that NetBSD as dom0 does not support multiple CPUs. This will |
limit the performance of the Xen/dom0 workstation approach. |
limit the performance of the Xen/dom0 workstation approach. |
|
|
Installation of NetBSD and Xen |
Installation of NetBSD |
------------------------------ |
---------------------- |
|
|
Note that it doesn't make sense to talk about installing a dom0 OS |
First, |
without also installing Xen itself. |
[install NetBSD/amd64](../../docs/guide/en/chap-inst.html) |
|
just as you would if you were not using Xen. |
|
However, the partitioning approach is very important. |
|
|
|
If you want to use RAIDframe for the dom0, there are no special issues |
|
for Xen. Typically one provides RAID storage for the dom0, and the |
|
domU systems are unaware of RAID. |
|
|
|
There are 4 styles of providing backing storage for the virtual disks |
|
used by domUs: raw partitions, LVM, file-backed vnd(4), and SAN, |
|
|
|
With raw partitions, one has a disklabel (or gpt) partition sized for |
|
each virtual disk to be used by the domU. (If you are able to predict |
|
how domU usage will evolve, please add an explanation to the HOWTO. |
|
Seriously, needs tend to change over time.) |
|
|
|
One can use lvm(8) to create logical devices to use for domU disks. |
|
This is almost as efficient sa raw disk partitions and more flexible. |
|
Hence raw disk partitions should typically not be used. |
|
|
|
One can use files in the dom0 filesystem, typically created by dd'ing |
|
/dev/zero to create a specific size. This is somewhat less efficient, |
|
but very convenient, as one can cp the files for backup, or move them |
|
between dom0 hosts. |
|
|
|
Finally, in theory one can place the files backing the domU disks in a |
|
SAN. (This is an invitation for someone who has done this to add a |
|
HOWTO page.) |
|
|
First do a NetBSD/i386 or NetBSD/amd64 |
Installation of Xen |
[installation](../../docs/guide/en/chap-inst.html) of the 5.1 release |
------------------- |
(or newer) as you usually do on x86 hardware. The binary releases are |
|
available from [](ftp://ftp.NetBSD.org/pub/NetBSD/). Binary snapshots |
|
for current and the stable branches are available on daily autobuilds. |
|
If you plan to use the `grub` boot loader, when partitioning the disk |
|
you have to make the root partition smaller than 512Mb, and formatted as |
|
FFSv1 with 8k block/1k fragments. If the partition is larger than this, |
|
uses FFSv2 or has different block/fragment sizes, grub may fail to load |
|
some files. Also keep in mind that you'll probably want to provide |
|
virtual disks to other domains, so reserve some partitions for these |
|
virtual disks. Alternatively, you can create large files in the file |
|
system, map them to vnd(4) devices and export theses vnd devices to |
|
other domains. |
|
|
|
Next step is to install the Xen packages via pkgsrc or from binary |
Next step is to install the Xen packages via pkgsrc or from binary |
packages. See [the pkgsrc |
packages. See [the pkgsrc |
Line 461 working vif-bridge is also provided with
|
Line 503 working vif-bridge is also provided with
|
|
|
#!/bin/sh |
#!/bin/sh |
#============================================================================ |
#============================================================================ |
# $NetBSD: howto.mdwn,v 1.17 2014/12/24 00:06:31 gdt Exp $ |
# $NetBSD: howto.mdwn,v 1.18 2014/12/24 00:11:15 gdt Exp $ |
# |
# |
# /usr/pkg/etc/xen/vif-bridge |
# /usr/pkg/etc/xen/vif-bridge |
# |
# |