Diff for /wikisrc/tutorials/how_to_set_up_a_guest_os_using_xen3.mdwn between versions 1.2 and 1.5

version 1.2, 2012/02/05 07:14:36 version 1.5, 2020/09/08 21:05:59
Line 2 Line 2
   
 [[!toc levels=3]]  [[!toc levels=3]]
   
   # Meta
   
   Note that there is also a [Xen HOWTO](../../ports/xen/howto/).
   Arguably this content could be folded in there.
   
 #  Requirements  #  Requirements
   
 Xen3 is supported from NetBSD-4.0 onward. If you plan on using NetBSD-CURRENT,  Xen3 is supported from NetBSD-4.0 onward. If you plan on using NetBSD-CURRENT,
Line 101  And copy it into / directory, like this: Line 106  And copy it into / directory, like this:
     # cp /usr/pkg/xen3-kernel/xen.gz /      # cp /usr/pkg/xen3-kernel/xen.gz /
           
   
 Finally, decompress it so that all versions of GRUB can read it:  
   
       
     # gunzip /xen.gz  
       
   
 ##  Xen DOM0 kernel  ##  Xen DOM0 kernel
   
 Lastly, we need a XEN-enabled kernel for our DOM0 domain. There are two  Lastly, we need a XEN-enabled kernel for our DOM0 domain. There are two
Line 132  copy and move it into the root directory Line 131  copy and move it into the root directory
     # cp netbsd-XEN3_DOM0.gz /      # cp netbsd-XEN3_DOM0.gz /
           
   
 Now decompress it to avoid any issues GRUB or Xen might have with gzipped  
 kernels  
   
       
     # gunzip /netbsd-XEN3_DOM0.gz  
       
   
 ##  Building it from source  ##  Building it from source
   
 Building a kernel from source is out of the scope of this section. Please  Building a kernel from source is out of the scope of this section. Please
Line 150  version, copy or move netbsd-XEN3_DOM0 i Line 142  version, copy or move netbsd-XEN3_DOM0 i
   
 #  Selecting a bootloader  #  Selecting a bootloader
   
 In NetBSD 5.0 the native boot loader, /boot, can load Xen directly. For  In NetBSD 5.0 the native boot loader, /boot, can load Xen directly.
 earlier versions of NetBSD you will need to use Grub. The NetBSD 5.0  The NetBSD 5.0 bootloader can be easily dropped into a NetBSD 4.x system by coping them into
 bootloader can be easily dropped into a NetBSD 4.x system by coping them into  
 /boot and running installboot(8) properly.  /boot and running installboot(8) properly.
   
 ##  Updating /boot  ##  Updating /boot
Line 196  for dom0' option and make sure you see X Line 187  for dom0' option and make sure you see X
 NetBSD kernel messages. Once you're satisfied it is working you can change the  NetBSD kernel messages. Once you're satisfied it is working you can change the
 "default=1" line to "default=5" to automatically boot Xen on reboot.  "default=1" line to "default=5" to automatically boot Xen on reboot.
   
 #  Setting up Grub  
   
 Before installing and configuring XEN3, we need to install grub, the  
 bootloader required to boot our XEN-enabled system.  
   
 To install it, use its package provided in pkgsrc ([sysutils/grub](http://pkgsrc.se/sysutils/grub)):  
   
       
     # cd /usr/pkgsrc/sysutils/grub  
     # make install  
       
   
 Building grub may take a while.  
   
 When installation is finished, you can proceed to grub's configuration in the  
 _/grub_ directory.  
   
 ##  GRUB configuration  
   
 First, create `/grub` (if it is not present), and copy paste the menu.lst file  
 below used by grub to read its configuration:  
   
       
     # mkdir /grub  
     # vi /grub/menu.lst  
       
   
 This typical _/grub/menu.lst_ file should have following content:  
   
       
       
     #Grub config file for NetBSD/xen. Copy as /grub/menu.lst and run  
     # grub-install /dev/rwd0d (assuming your boot device is wd0).  
     #  
     # The default entry to load will be the first one  
     default=0  
       
     # boot after 10s the default entry if the user didn't hit keyboard  
     timeout=10  
       
     # Same as above, but using VGA console  
     # We can use console=tty0 (Linux syntax) or console=pc (NetBSD syntax)  
     title Xen 3.0 / NetBSD (hda0, vga)  
       root(hd0,0)  
       kernel (hd0,a)/xen dom0_mem=514624  
       module (hd0,a)/netbsd-XEN3_DOM0 bootdev=/dev/wd0a ro console=tty0   
       
     #Load a regular NetBSD/i386 kernel. Can be useful if you end up with a  
     #nonworking /xen.gz  
     title NetBSD 4.0  
       root (hd0,a)  
       kernel --type=netbsd /netbsd  
       
     #Load the NetBSD bootloader, letting it load the NetBSD/i386 kernel.  
     #May be better than the above, as grub can't pass all required infos  
     #to the NetBSD/i386 kernel (e.g. console, root device, ...)  
     title NetBSD via chain  
     root        (hd0,a)  
     chainloader +1  
       
     # end of grub config file.  
       
   
 Notice that the statement **dom0_mem** is allocating half a gig to Xen. If you  
 have a box with 4Gb of RAM you probably want to change that to something  
 larger. A smaller number might be wise on systems with less RAM, etc...  
   
 #  Setting up DOM0  #  Setting up DOM0
   
 ##  Creating xen devices  ##  Creating xen devices
Line 280  sources and you will have to create the  Line 204  sources and you will have to create the 
   
 ##  Configuring the bridge interface  ##  Configuring the bridge interface
   
 The [bridge(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bridge+4+NetBSD-current) interface is used to provide network access to DOMUs.  The [bridge(4)](//man.NetBSD.org/bridge.4) interface is used to provide network access to DOMUs.
   
 To use one, edit (or create) the file `/etc/ifconfig.bridge0` and insert  To use one, edit (or create) the file `/etc/ifconfig.bridge0` and insert
 following lines to:  following lines to:
Line 291  following lines to: Line 215  following lines to:
           
   
 Where 'bge0' should be changed to the name of the interface you want to use  Where 'bge0' should be changed to the name of the interface you want to use
 with your guest operating systems. use [ifconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?ifconfig+8+NetBSD-current) to get more details  with your guest operating systems. use [ifconfig(8)](//man.NetBSD.org/ifconfig.8) to get more details
 about your actual interfaces.  about your actual interfaces.
   
 ##  Rebooting into DOM0  ##  Rebooting into DOM0
Line 303  Time to reboot: Line 227  Time to reboot:
           
   
 If all has gone well, you should have booted into the XEN3_DOM0 kernel. Check  If all has gone well, you should have booted into the XEN3_DOM0 kernel. Check
 this with [uname(1)](http://netbsd.gw.com/cgi-bin/man-cgi?uname+1+NetBSD-current):  this with [uname(1)](//man.NetBSD.org/uname.1):
   
           
     # uname -v      # uname -v
Line 510  consider the swap). These partitions mus Line 434  consider the swap). These partitions mus
 and may be either of primary or extended type. Of course, you can use more  and may be either of primary or extended type. Of course, you can use more
 than two, but adapt your labels and partitions accordingly.  than two, but adapt your labels and partitions accordingly.
   
 We do not cover the partition/slices manipulations through [fdisk(8)](http://netbsd.gw.com/cgi-bin/man-cgi?fdisk+8+NetBSD-current) and  We do not cover the partition/slices manipulations through [fdisk(8)](//man.NetBSD.org/fdisk.8) and
 [disklabel(8)](http://netbsd.gw.com/cgi-bin/man-cgi?disklabel+8+NetBSD-current), as it depends strongly on how you manage your hard drive's  [disklabel(8)](//man.NetBSD.org/disklabel.8), as it depends strongly on how you manage your hard drive's
 space.  space.
   
 For this tutorial, we will use this partitioning:  For this tutorial, we will use this partitioning:
Line 584  NetBSD, you can use [sysutils/e2fsprogs] Line 508  NetBSD, you can use [sysutils/e2fsprogs]
     # make install      # make install
           
   
 And then use e2fsck, mke2fs and [mount_ext2fs(8)](http://netbsd.gw.com/cgi-bin/man-cgi?mount_ext2fs+8+NetBSD-current) directly from NetBSD.  And then use e2fsck, mke2fs and [mount_ext2fs(8)](//man.NetBSD.org/mount_ext2fs.8) directly from NetBSD.
   
 ###  Getting XEN aware Linux kernels  ###  Getting XEN aware Linux kernels
   

Removed from v.1.2  
changed lines
  Added in v.1.5


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