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

version 1.192, 2021/03/03 13:19:06 version 1.200, 2021/03/07 01:06:00
Line 49  See [PV](https://wiki.xen.org/wiki/Parav Line 49  See [PV](https://wiki.xen.org/wiki/Parav
   
 In HVM mode, no guest modification is required; however, hardware  In HVM mode, no guest modification is required; however, hardware
 support is required, such as VT-x on Intel CPUs and SVM on AMD CPUs.  support is required, such as VT-x on Intel CPUs and SVM on AMD CPUs.
 The dom0 runs qemu to emulate hardware.  The dom0 runs qemu to emulate hardware.  It is therefore non-sensical
   to have an HVM dom0.
   
 In PVHVM mode, the guest runs as HVM, but additionally can use PV  In PVHVM mode, the guest runs as HVM, but additionally can use PV
 drivers for efficiency.  drivers for efficiency.  Therefore it is non-sensical for to have a
 See [PV on HVM](https://wiki.xen.org/wiki/PV_on_HVM).  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.  PVHv2 is
Line 160  ftp.netbsd.org/pub/NetBSD/NetBSD-9.1/amd Line 161  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 178  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:losad /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
   
Line 328  the dom0.  NetBSD's /dev/random system w Line 362  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 domU
 serves as a network file server.  serves as a network file server.
Line 353  are stored in files and Xen attaches the Line 386  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 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, e.g.  `type = "hvm"`.
   
 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 385  file by "memory = N" (in megabytes).  In Line 420  file by "memory = N" (in megabytes).  In
 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 585  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 630  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.
   
   Use type='pvh'.  Probably, use a GENERIC kernel within the disk image,
   which in current has PV support.
   
   \todo Verify.
   
 \todo Explain where the kernel comes from.  \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 651  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

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


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