Diff for /wikisrc/ports/xen/howto.mdwn between versions 1.192 and 1.205

version 1.192, 2021/03/03 13:19:06 version 1.205, 2021/03/15 23:01:56
Line 1 Line 1
 [[!meta title="Xen HowTo"]]  [[!meta title="Xen Status and HowTo"]]
   
 Xen is a Type 1 hypervisor which supports running multiple guest operating  Xen is a Type 1 hypervisor which supports running multiple guest operating
 systems on a single physical machine. One uses the Xen kernel to control the  systems on a single physical machine. One uses the Xen kernel to control the
Line 8  systems which operate in an unprivileged Line 8  systems which operate in an unprivileged
 from the domU systems are forwarded by the Xen hypervisor to the dom0 to be  from the domU systems are forwarded by the Xen hypervisor to the dom0 to be
 fulfilled.  fulfilled.
   
 This HOWTO presumes a basic familiarity with the Xen system  This document provides status on what Xen things work on NetBSD
 architecture, with installing NetBSD on amd64 hardware, and with  (upstream documentation might say something works if it works on some
 installing software from pkgsrc.  See also the [Xen  particular Linux system).
   
   This document is also a HOWTO that presumes a basic familiarity with
   the Xen system architecture, with installing NetBSD on amd64 hardware,
   and with installing software from pkgsrc.  See also the [Xen
 website](http://www.xenproject.org/).  website](http://www.xenproject.org/).
   
   If this document says that something works, and you find that it does
   not, it is best to ask on port-xen and if you are correct to file a
   PR.
   
 [[!toc]]  [[!toc]]
   
 # Overview  # Overview
   
 The basic concept of Xen is that the hypervisor (xenkernel) runs on  The basic concept of Xen is that the hypervisor (xenkernel) runs on
 the hardware, and runs a privileged domain ("dom0") that can access  the hardware, and runs a privileged domain ("dom0") that can access
 disks/networking/etc.  One then runs additonal unprivileged domains  disks/networking/etc.  One then runs additional unprivileged domains
 (each a "domU"), presumably to do something useful.  (each a "domU"), presumably to do something useful.
   
 This HOWTO addresses how to run a NetBSD dom0 (and hence also build  This HOWTO addresses how to run a NetBSD dom0 (and hence also build
Line 32  approach and limits discussion of altern Line 40  approach and limits discussion of altern
   
 ## Guest Styles  ## Guest Styles
   
 Xen supports different styles of guests.  Xen supports different styles of guests.  See
   https://wiki.xenproject.org/wiki/Virtualization_Spectrum for a
   discussion.
   
   This table shows the styles, and if a NetBSD dom0 can run in that
   style, if a NetBSD dom0 can sypport that style of guest in a domU, and
   if NetBSD as a domU can support that style.
   
 [[!table data="""  [[!table data="""
 Style of guest  |Supported by NetBSD  Style of guest  |dom0 can be?   |dom0 can support?      |domU can be?
 PV              |Yes (dom0, domU)  PV              |yes            |yes                    |yes
 HVM             |Yes (domU)  HVM             |N/A            |yes                    |yes
 PVHVM           |current-only (domU)  PVHVM           |N/A            |yes                    |current only
 PVH             |current-only (domU, dom0 not yet)  PVH             |not yet        |current only           |current only
 """]]  """]]
   
 In Para-Virtualized (PV) mode, the guest OS does not attempt to access  In PV (paravirtualized) mode, the guest OS does not attempt to access
 hardware directly, but instead makes hypercalls to the hypervisor; PV  hardware directly, but instead makes hypercalls to the hypervisor; PV
 guests must be specifically coded for Xen.  guests must be specifically coded for Xen.  See
 See [PV](https://wiki.xen.org/wiki/Paravirtualization_(PV\)).  [PV](https://wiki.xen.org/wiki/Paravirtualization_(PV\)).
   
 In HVM mode, no guest modification is required; however, hardware  In HVM (Hardware Virtual Machine) mode, no guest modification is
 support is required, such as VT-x on Intel CPUs and SVM on AMD CPUs.  required.  However, hardware support is required, such as VT-x on
 The dom0 runs qemu to emulate hardware.  Intel CPUs and SVM on AMD CPUs to assist with the processor emulation.
   The dom0 runs qemu to emulate hardware other than the processor.  It
 In PVHVM mode, the guest runs as HVM, but additionally can use PV  is therefore non-sensical to have an HVM dom0, because there is no
 drivers for efficiency.  underlying system to provide emulation.
 See [PV on HVM](https://wiki.xen.org/wiki/PV_on_HVM).  
   In PVHVM mode, the guest runs as HVM, but additionally uses PV
   drivers for efficiency.  Therefore it is non-sensical for to have a
   PVHVM dom0.  See [PV on HVM](https://wiki.xen.org/wiki/PV_on_HVM).
   
 There have been two PVH modes: original PVH and PVHv2.  Original PVH  There have been two PVH modes: original PVH and PVHv2.  Original PVH
 was based on PV mode and is no longer relevant at all.  PVHv2 is  was based on PV mode and is no longer relevant at all.  Therefore
 basically lightweight HVM with PV drivers.  A critical feature of it  PVHv2 is written as PVH, here and elsewhere.  PVH is basically
 is that qemu is not needed; the hypervisor can do the emulation that  lightweight HVM with PV drivers.  A critical feature of it is that
 is required.  Thus, a dom0 can be PVHv2.  qemu is not needed; the hypervisor can do the emulation that is
 The source code uses PVH and config files use pvh; this refers to PVHv2.  required.  Thus, a dom0 can be PVH.  The source code uses PVH and
 See [PVH(v2)](https://wiki.xenproject.org/wiki/PVH_(v2\)_Domu).  config files use pvh, but NB that this refers to PVHv2.  See
   [PVH(v2)](https://wiki.xenproject.org/wiki/PVH_(v2\)_Domu).
 At system boot, the dom0 kernel is loaded as a module with Xen as the kernel.  
 The dom0 can start one or more domUs.  (Booting is explained in detail  At system boot, the dom0 kernel is loaded as a module with Xen as the
 in the dom0 section.)  kernel.  The dom0 can start one or more domUs.  (Booting is explained
   in detail in the dom0 section.)
   
 ## CPU Architecture  ## CPU Architecture
   
Line 75  There is a concept of Xen running on ARM Line 93  There is a concept of Xen running on ARM
   
 The dom0 system should be amd64.  (Instructions for i386PAE dom0 have been removed from the HOWTO.)  The dom0 system should be amd64.  (Instructions for i386PAE dom0 have been removed from the HOWTO.)
   
 The domU can be i386PAE or amd64.  The domU can be i386 PAE or amd64.
 i386PAE at one point was considered as [faster](https://lists.xen.org/archives/html/xen-devel/2012-07/msg00085.html) than amd64.  i386 PAE at one point was considered as [faster](https://lists.xen.org/archives/html/xen-devel/2012-07/msg00085.html) than amd64.
   However, as of 2021 it is normal to use amd64 as the domU architecture, and use of i386 is dwindling.
   
 ## Xen Versions  ## Xen Versions
   
Line 95  Xen Version |Package Name |Xen CPU Suppo Line 114  Xen Version |Package Name |Xen CPU Suppo
   
 See also the [Xen Security Advisory page](http://xenbits.xen.org/xsa/).  See also the [Xen Security Advisory page](http://xenbits.xen.org/xsa/).
   
 Older Xen had a python-based management tool called xm, now replaced  Older Xen had a python-based management tool called xm; this has been
 by xl.  replaced by xl.
   
 ## NetBSD versions  ## NetBSD versions
   
 Xen has been supported in NetBSD for a long time, at least since 2005.  Xen has been supported in NetBSD for a long time, at least since 2005.
 Initially Xen was PV only.  Initially Xen was PV only.
   
 NetBSD 8 and up support PV and HVM modes.  NetBSD Xen has always supported PV, in both dom0 and domU; for a long
   time this was the only way.  NetBSD >=8 as a dom0 supports HVM mode in
 Support for PVHVM and PVH is available only in NetBSD-current.  domUs.
   
 NetBSD up to and including NetBSD 9 as a dom0 does not run SMP,  Support for PVHVM and PVH is available only in NetBSD-current; this is
 because some drivers are not yet safe for this.  NetBSD-current  currently somewhat experimental, although PVHVM appears reasonably
 supports SMP in dom0.  solid.
   
 NetBSD, when run as a domU, can and does typically run SMP.  NetBSD up to and including NetBSD 9 as a dom0 cannot safely run SMP.
   Even if one added "options MULTIPROCESSOR" and configured multiple
   vcpus, the kernel is likely to crash because of drivers without
   adequate locking.
   
   NetBSD-current supports SMP in dom0, and XEN3_DOM0 includes "options
   MULTIPROCESSOR".
   
   NetBSD (since NetBSD 6), when run as a domU, can run SMP, using
   multiple CPUs if provided.  The XEN3_DOMU kernel is built
   with "options MULITPROCESSOR".
   
 Note that while Xen 4.13 is current, the kernel support is still  Note that while Xen 4.13 is current, the kernel support is still
 called XEN3, because the hypercall interface has not changed  called XEN3, because the hypercall interface has not changed
Line 133  In 2018-05, trouble booting a dom0 was r Line 162  In 2018-05, trouble booting a dom0 was r
 using Xen.  Therefore, use the most recent release, or a build from  using Xen.  Therefore, use the most recent release, or a build from
 the most recent stable branch.  Alternatively, use -current, being  the most recent stable branch.  Alternatively, use -current, being
 mindful of all the usual caveats of lower stability of current, and  mindful of all the usual caveats of lower stability of current, and
 likely a bit more so.  likely a bit more so.  Think about how you will provide storage for
   disk images.
   
 ## Installation of Xen  ## Installation of Xen
   
 ### Building Xen  ### Building Xen
   
 Use the most recent version of Xen in pkgsrc, unless the DESCR says that it is not suitable.  Use the most recent version of Xen in pkgsrc, unless the DESCR says
 Therefore, choose 4.13.  that it is not suitable.  Therefore, choose 4.13.  In the dom0,
 In the dom0, install xenkernel413 and xentools413 from pkgsrc.  install xenkernel413 and xentools413 from pkgsrc.
   
 Once this is done, copy the Xen kernel from where pkgsrc puts it to  Once this is done, copy the Xen kernel from where pkgsrc puts it to
 where the boot process will be able to find it:  where the boot process will be able to find it:
Line 160  ftp.netbsd.org/pub/NetBSD/NetBSD-9.1/amd Line 190  ftp.netbsd.org/pub/NetBSD/NetBSD-9.1/amd
   
 ### Configuring booting  ### Configuring booting
   
 Read boot.cfg(8) carefully.  Add lines to /boot.cfg to boot Xen:  Read boot.cfg(8) carefully.  Add lines to /boot.cfg to boot Xen,
   adjusting for your root filesystem:
   
 [[!template id=filecontent name="/boot.cfg" text="""  [[!template id=filecontent name="/boot.cfg" text="""
 menu=Xen:load /netbsd-XEN3_DOM0.gz console=pc;multiboot /xen.gz dom0_mem=512M  menu=Xen:load /netbsd-XEN3_DOM0.gz root=wd0a console=pc;multiboot /xen.gz dom0_mem=512M
 menu=Xen single user:load /netbsd-XEN3_DOM0.gz console=pc -s;multiboot /xen.gz dom0_mem=512M  menu=Xen single user:load /netbsd-XEN3_DOM0.gz root=wd0a console=pc -s;multiboot /xen.gz dom0_mem=512M
 """]]  """]]
   
 \todo Explain why console=pc is given.  Perhaps there is some notion  
 of a separate console instead of xencons.  
   
 \todo Check the single user line.  
   
 This specifies that the dom0 should have 512MB of ram, leaving the rest  This specifies that the dom0 should have 512MB of ram, leaving the rest
 to be allocated for domUs.  to be allocated for domUs.
   
Line 181  want to set it as default.  It is highly Line 207  want to set it as default.  It is highly
 trouble at some point, and keeping an up-to-date GENERIC for use in  trouble at some point, and keeping an up-to-date GENERIC for use in
 fixing problems is the standard prudent approach.  fixing problems is the standard prudent approach.
   
   \todo Explain why rndseed is not set with Xen as part of the dom0
   subconfiguration.
   
   Note that you are likely to have to set root= because the boot device
   from /boot is not passed via Xen to the dom0 kernel.  With one disk,
   it will work, but e.g. plugging in USB disk to a machine with root on
   wd0a causes boot to fail.
   
   Beware that userconf statements must be attached to the dom0 load, and
   may not be at top-level, because then they would try to configure the
   hypervisor, if there is a way to pass them via multiboot.  It appears
   that adding `userconf=pckbc` to `/boot.cfg` causes Xen to crash very
   early with a heap overflow.
   
 ### Console selection  ### Console selection
   
 See boot_console(8).  Understand that you should start from a place of  See boot_console(8).  Understand that you should start from a place of
 having console setup correct for booting GENERIC before trying to  having console setup correct for booting GENERIC before trying to
 configure Xen.  configure Xen.
   
 By default, the hypervisor (Xen itself) will use \todo as the console  Generally for GENERIC, one sets the console in bootxx_ffsv1 or
   equivalent, and this is passed on to /boot (where one typically does
 By default, the NetBSD dom0 kernel will use xencons(4) (the man page  not set the console).  This configuration of bootxx_ffsv1 should also
 does not exist) as console.  be in place for Xen systems, to allow seeing messages from /boot and
   use of a keyboard to select a line from the menu.  And, one should
 To use a serial console for the Xen hypervisor, add settings as follows:  have a working boot path to GENERIC for rescue situations.
   
   With GENERIC, the boot options are passed on to /netbsd, but there is
   currently no mechanism to pass these via multiboot to the hypervisor.
   Thus, in addition to configuring the console in the boot blocks, one
   must also configure it for Xen.
   
   By default, the hypervisor (Xen itself) will use some sort of vga
   device as the console, much like GENERIC uses by default.  The vga
   console is relinquished at the conclusion of hypervisor boot, before
   the dom0 is started.  Xen when using a vga console does not process
   console input.
   
   The hypervisor can be configured to use a serial port console, e.g.
 [[!template id=filecontent name="/boot.cfg" text="""  [[!template id=filecontent name="/boot.cfg" text="""
 menu=Xen:load /netbsd-XEN3_DOM0.gz;multiboot /xen.gz dom0_mem=512M console=com1 com1=9600,8n1  menu=Xen:load /netbsd-XEN3_DOM0.gz console=com0;multiboot /xen.gz dom0_mem=512M console=com1 com1=9600,8n1
 """]]  """]]
   This example uses the first serial port (Xen counts from 1; this is
 which will use the first serial port for Xen (which counts starting  what NetBSD would call com0), and sets speed and parity.  (The dom0 is
 from 1, unlike NetBSD which counts starting from 0), forcing  then configured to use the same serial port in this example.)
 speed/parity.  Because the NetBSD command line lacks a  
 "console=pc" argument, it will use the default "xencons" console device,  With the hypervisor configured for a serial console, it can get input,
 which directs the console I/O through Xen to the same console device Xen  and there is a notion of passing this input to the dom0.  \todo
 itself uses (in this case, the serial port).  Explain why, if Xen has a serial console, the dom0 console is
   typically also configured to open that same serial port, instead of
 \todo Explain why boot.cfg shows forcing the dom0 console also,  getting the passthrough input via the xen console.
 separately from the hypervisor console.  
   One also configures the console for the dom0.  While one might expect
   console=pc to be default, following behavior of GENERIC, a hasty read
   of the code suggests there is no default and booting without a
   selected console might lead to a panic.  Also, there is merit in
   explicit configuration.  Therefore the standard approach is to place
   console=pc as part of the load statement for the dom0 kernel, or
   alternatively console=com0.
   
   The NetBSD dom0 kernel will attach xencons(4) (the man page does not
   exist), but this is not used as a console.  It is used to obtain the
   messages from the hypervisor's console; run `xl dmesg` to see them.
   
 ### Tuning  ### Tuning
   
 In an attempt to add performance, one can also add `dom0_max_vcpus=1 dom0_vcpus_pin`,  In an attempt to add performance, one can also add `dom0_max_vcpus=1
 to force only one vcpu to be provided (since NetBSD dom0 can't use  dom0_vcpus_pin`, to force only one vcpu to be provided (since NetBSD
 more) and to pin that vcpu to a physical CPU. Xen has  dom0 can't use more) and to pin that vcpu to a physical CPU. Xen has
 [many boot options](http://xenbits.xenproject.org/docs/4.13-testing/misc/xen-command-line.html),  [many boot
   options](http://xenbits.xenproject.org/docs/4.13-testing/misc/xen-command-line.html),
 and other than dom0 memory and max_vcpus, they are generally not  and other than dom0 memory and max_vcpus, they are generally not
 necessary.  necessary.
   
 \todo Revisit this advice with current.  \todo Revisit this advice with current.
 \todo Explain if anyone has ever actually measured that this helps.  \todo Explain if anyone has ever actually measured that this helps.
   
Line 274  dom0 kernel compared to hardware. Line 339  dom0 kernel compared to hardware.
   
 One is that through NetBSD 9 the module ABI is different because some  One is that through NetBSD 9 the module ABI is different because some
 of the #defines change, so there are separate sets of modules in  of the #defines change, so there are separate sets of modules in
 /stand.  In NetBSD-current, there is only one set of modules.  /stand.  (Further, zfs in Xen is troubled because of differing
   MAXPHYS; see the zfs howto for more.)  In NetBSD-current, there is
   only one set of modules.
   
 The other difference is that XEN3_DOM0 does not have exactly the same  The other difference is that XEN3_DOM0 does not have exactly the same
 options as GENERIC.  While it is debatable whether or not this is a  options as GENERIC.  While this is roughly agreed to be in large part
 bug, users should be aware of this and can simply add missing config  a bug, users should be aware of this and can simply add missing config
 items if desired.  items if desired.
   
 Finally, there have been occasional reports of trouble with X11  Finally, there have been occasional reports of trouble with X11
 servers in NetBSD as a dom0.  servers in NetBSD as a dom0.  Some hardware support is intentionally
   disabled in XEN3_DOM0.
   
 ## Updating Xen in a dom0  ## Updating Xen in a dom0
   
Line 303  rescue purposes, as well as the DOM0 ker Line 371  rescue purposes, as well as the DOM0 ker
   
 ## anita (for testing NetBSD)  ## anita (for testing NetBSD)
   
 With a NetBSD dom0, even without any domUs, one should be able to run  With a NetBSD dom0, even without any domUs, one can run anita (see
 anita (see pkgsrc/misc/py-anita) to test NetBSD releases, by doing (as  pkgsrc/misc/py-anita) to test NetBSD releases, by doing (as root,
 root, because anita must create a domU):  because anita must create a domU):
   
 [[!template id=programlisting text="""  [[!template id=programlisting text="""
 anita --vmm=xl test file:///usr/obj/i386/  anita --vmm=xl test file:///usr/obj/i386/
Line 328  the dom0.  NetBSD's /dev/random system w Line 396  the dom0.  NetBSD's /dev/random system w
   
 ## Config files  ## Config files
   
 See /usr/pkg/share/examples/xen/xlexample*  See /usr/pkg/share/examples/xen/xlexample* for a very small number of
 for a small number of well-commented examples, mostly for running  examples for running GNU/Linux.
 GNU/Linux.  
   
 The following is an example minimal domain configuration file. The domU  The following is an example minimal domain configuration file.  The
 serves as a network file server.  domU serves as a network file server.
   
 [[!template id=filecontent name="/usr/pkg/etc/xen/foo" text="""  [[!template id=filecontent name="/usr/pkg/etc/xen/foo" text="""
 name = "domU-id"  name = "domU-id"
Line 353  are stored in files and Xen attaches the Line 420  are stored in files and Xen attaches the
 dom0 on domain creation.  The system treats xbd0 as the boot device  dom0 on domain creation.  The system treats xbd0 as the boot device
 without needing explicit configuration.  without needing explicit configuration.
   
 There is not type line; that implicitly defines a pv domU.  There is not a type line; that implicitly defines a pv domU.
   Otherwise, one sets type to the lower-case version of the domU type in
   the table above; see later sections.
   
 By convention, domain config files are kept in `/usr/pkg/etc/xen`.  Note  By convention, domain config files are kept in `/usr/pkg/etc/xen`.  Note
 that "xl create" takes the name of a config file, while other commands  that "xl create" takes the name of a config file, while other commands
Line 376  will trigger controlled shutdowns of all Line 445  will trigger controlled shutdowns of all
   
 ## CPU and memory  ## CPU and memory
   
 A domain is provided with some number of vcpus, up to the number  A domain is provided with some number of vcpus; any domain can have up
 of CPUs seen by the hypervisor. For a domU, it is controlled  to the number of CPUs seen by the hypervisor. For a domU, it is
 from the config file by the "vcpus = N" directive.  controlled from the config file by the "vcpus = N" directive.  It is
   normal to overcommit vcpus; a 4-core machine machine might well provide 4
   vcpus to each domU.  One might also configure fewer vcpus for a domU.
   
 A domain is provided with memory; this is controlled in the config  A domain is provided with memory; this is controlled in the config
 file by "memory = N" (in megabytes).  In the straightforward case, the  file by "memory = N" (in megabytes).  In the straightforward case, the
 sum of the the memory allocated to the dom0 and all domUs must be less  sum of the the memory allocated to the dom0 and all domUs must be less
 than the available memory.  than the available memory.
   
 Xen also provides a "balloon" driver, which can be used to let domains  ## Balloon driver
 use more memory temporarily.  
   Xen provides a `balloon` driver, which can be used to let domains use
   more memory temporarily.
   
   \todo Explain how to set up a aystem to use the balloon scheme in a
   useful manner.
   
 ## Virtual disks  ## Virtual disks
   
Line 545  missing with Xen.) Line 621  missing with Xen.)
 Note that NetBSD by default creates only xbd[0123].  If you need more  Note that NetBSD by default creates only xbd[0123].  If you need more
 virtual disks in a domU, run e.g. "./MAKEDEV xbd4" in the domU.  virtual disks in a domU, run e.g. "./MAKEDEV xbd4" in the domU.
   
 ## Creating a Linux domU  ## Creating a Linux PV domU
   
 Creating unprivileged Linux domains isn't much different from  Creating unprivileged Linux domains isn't much different from
 unprivileged NetBSD domains, but there are some details to know.  unprivileged NetBSD domains, but there are some details to know.
Line 590  tty to the xen console. Line 666  tty to the xen console.
   
 ## Creating a NetBSD HVM domU  ## Creating a NetBSD HVM domU
   
 Use type='hmv', probably.  Use a GENERIC kernel within the disk image.  Use type='hvm', probably.  Use a GENERIC kernel within the disk image.
   
 ## Creating a NetBSD PVH domU  ## Creating a NetBSD PVH domU
   
 Use type='pvh'.  This only works with a current kernel in the domU.
   
 \todo Explain where the kernel comes from.  Use type='pvh'.  Probably, use a GENERIC kernel within the disk image,
   which in current has PV support.
   
   \todo Verify.
   
   \todo Verify if one can have current PVH domU on a 9 dom0.
   
 ## Creating a Solaris domU  ## Creating a Solaris domU
   
Line 606  See possibly outdated Line 687  See possibly outdated
 ## PCI passthrough: Using PCI devices in guest domains  ## PCI passthrough: Using PCI devices in guest domains
   
 NB: PCI passthrough only works on some Xen versions and as of 2020 it  NB: PCI passthrough only works on some Xen versions and as of 2020 it
 is not clear that it works on any version in pkgsrc.  Reports  is not clear that it works on any version in pkgsrc.  \todo Reports
 confirming or denying this notion should be sent to port-xen@.  confirming or denying this notion should be sent to port-xen@.
   
 The dom0 can give other domains access to selected PCI  The dom0 can give other domains access to selected PCI
Line 680  note that only the "xpci" lines are unus Line 761  note that only the "xpci" lines are unus
   
 ## Nesting under Linux KVM  ## Nesting under Linux KVM
   
 It is possible to run a Xen and a NetBSD dom0 under Linux KVM.  One  It is possible to run Xen and a NetBSD dom0 under Linux KVM.  One
 can enable virtio in the dom0 for greater speed.  can enable virtio in the dom0 for greater speed.
   
   ## Nesting under qemu
   
   It is possible to run Xen and a NetBSD dom0 under qemu on NetBSD, and
   also with nvmm.
   \todo Check this.
   
 ## Other nesting  ## Other nesting
   
 In theory, any full emulation should be able to run Xen and a NetBSD  In theory, any full emulation should be able to run Xen and a NetBSD
 dom0.  The HOWTO does not currently have information about Xen XVM  dom0.  The HOWTO does not currently have information about Xen XVM
 mode, nvmm, qemu, Virtualbox, etc.  mode, Virtualbox, etc.
   
 ## NetBSD 5 as domU  ## NetBSD 5 as domU
   
Line 728  different choices. Line 815  different choices.
   
 ### stub domains  ### stub domains
   
 Some (Linux only?) dom0 systems use something called "stub domains" to  Some (Linux) dom0 systems use something called "stub domains" to
 isolate qemu from the dom0 system, as a security and reliabilty  isolate qemu from the dom0 system, as a security and reliabilty
 mechanism when running HVM domUs.  Somehow, NetBSD's GENERIC kernel  mechanism when running HVM domUs.  Somehow, NetBSD's GENERIC kernel
 ends up using PIO for disks rather than DMA.  Of course, all of this  ends up using PIO for disks rather than DMA.  Of course, all of this
Line 738  currently understood. Line 825  currently understood.
 ### Grant tables  ### Grant tables
   
 There are multiple versions of using grant tables, and some security  There are multiple versions of using grant tables, and some security
 advisories have suggested disabling some versions.  Some versions of  advisories have suggested disabling some versions.  NetBSD through 9
 NetBSD apparently only use specific versions and this can lead to  uses version 1 and NetBSD-current uses version 2.  This can lead to
 "NetBSD current doesn't run on hosting provider X" situations.  "NetBSD current doesn't run on hosting provider X" situations.
   
 \todo Explain better.  \todo Explain better.
Line 752  pvgrub is a version of grub that uses PV Line 839  pvgrub is a version of grub that uses PV
 calls.  It is booted from the dom0 as the domU kernel, and then reads  calls.  It is booted from the dom0 as the domU kernel, and then reads
 /grub/menu.lst and loads a kernel from the domU file system.  /grub/menu.lst and loads a kernel from the domU file system.
   
 [Panix](http://www.panix.com/) lets users use pvgrub.  Panix reports  
 that pvgrub works with FFsv2 with 16K/2K and 32K/4K block/frag sizes  
 (and hence with defaults from "newfs -O 2").  See [Panix's pvgrub  
 page](http://www.panix.com/v-colo/grub.html), which describes only  
 Linux but should be updated to cover NetBSD :-).  
   
 [prgmr.com](http://prgmr.com/) also lets users with pvgrub to boot  
 their own kernel.  See then [prgmr.com NetBSD  
 HOWTO](http://wiki.prgmr.com/mediawiki/index.php/NetBSD_as_a_DomU)  
 (which is in need of updating).  
   
 It appears that [grub's FFS  It appears that [grub's FFS
 code](http://xenbits.xensource.com/hg/xen-unstable.hg/file/bca284f67702/tools/libfsimage/ufs/fsys_ufs.c)  code](http://xenbits.xensource.com/hg/xen-unstable.hg/file/bca284f67702/tools/libfsimage/ufs/fsys_ufs.c)
 does not support all aspects of modern FFS, but there are also reports  does not support all aspects of modern FFS, but there are also reports
 that FFSv2 works fine.  At prgmr, typically one has an ext2 or FAT  that FFSv2 works fine.
 partition for the kernel with the intent that grub can understand it,  
 which leads to /netbsd not being the actual kernel.  One must remember  
 to update the special boot partition.  
   
 ### pygrub  ### pygrub
   
   As of 2014, pygrub seems to be of mostly historical interest.  As of
   2021, the section should perhaps be outright deleted.
   
 pygrub runs in the dom0 and looks into the domU file system.  This  pygrub runs in the dom0 and looks into the domU file system.  This
 implies that the domU must have a kernel in a file system in a format  implies that the domU must have a kernel in a file system in a format
 known to pygrub.  known to pygrub.
   
 pygrub doesn't seem to work to load Linux images under NetBSD dom0,  pygrub doesn't seem to work to load Linux images under NetBSD dom0,
 and is inherently less secure than pvgrub due to running inside dom0. For both these  and is inherently less secure than pvgrub due to running inside
 reasons, pygrub should not be used, and is only still present so that  dom0. For both these reasons, pygrub should not be used, and is only
 historical DomU images using it still work.  still present so that historical DomU images using it still work.
   
 As of 2014, pygrub seems to be of mostly historical  
 interest. New DomUs should use pvgrub.  
   
 ## Specific Providers  ## Specific Providers
   
   The intent is to list providers only if they document support for
   running NetBSD, and to point to their resources briefly.
   
   ### panix.com
   
   [Panix](http://www.panix.com/) provides NetBSD as an OS option.  See
   https://www.panix.com/v-colo/nupgrade.html for some information.
   Users can use pvgrub.  Panix reports that pvgrub works with FFsv2 with
   16K/2K and 32K/4K block/frag sizes (and hence with defaults from
   "newfs -O 2").  See [Panix's pvgrub
   page](http://www.panix.com/v-colo/grub.html) which describes how to
   boot NetBSD.
   
   ### prgmr.com
   
   [prgmr.com](http://prgmr.com/) provides released versions of
   NetBSD/amd64 as installation options.  Users can use pvgrub to boot
   their own kernel, and a small FAT32 /boot is encouraged.  See the
   [prgmr.com NetBSD
   HOWTO](http://wiki.prgmr.com/mediawiki/index.php/NetBSD_as_a_DomU)
   (which is in need of updating).
   
 ### Amazon  ### Amazon
   
 See the [Amazon EC2 page](/amazon_ec2/).  See the [Amazon EC2 page](/amazon_ec2/).

Removed from v.1.192  
changed lines
  Added in v.1.205


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb