Diff for /wikisrc/ports/xen/howto.mdwn between versions 1.3 and 1.4

version 1.3, 2013/10/31 12:43:04 version 1.4, 2013/10/31 14:14:13
Line 379  configuring: Line 379  configuring:
   
 #!/bin/sh  #!/bin/sh
     #============================================================================      #============================================================================
     # $NetBSD: howto.mdwn,v 1.2 2013/10/31 12:34:39 mspo Exp $      # $NetBSD: howto.mdwn,v 1.3 2013/10/31 12:43:04 mspo Exp $
     #      #
     # /usr/pkg/etc/xen/vif-bridge      # /usr/pkg/etc/xen/vif-bridge
     #      #
Line 582  is attached to the guest as a "phy" devi Line 582  is attached to the guest as a "phy" devi
 configuration file with the following contents. Substitute */dev/wd0k*  configuration file with the following contents. Substitute */dev/wd0k*
 with an empty partition at least 8 GB large.  with an empty partition at least 8 GB large.
   
 ~~~ {.programlisting}      memory = 640
 memory = 640      name = 'solaris'
 name = 'solaris'      disk = [ 'phy:/dev/wd0k,0,w' ]
 disk = [ 'phy:/dev/wd0k,0,w' ]      disk += [ 'phy:/dev/vnd0d,6:cdrom,r' ]
 disk += [ 'phy:/dev/vnd0d,6:cdrom,r' ]      vif = [ 'bridge=bridge0' ]
 vif = [ 'bridge=bridge0' ]      kernel = '/root/solaris/unix'
 kernel = '/root/solaris/unix'      ramdisk = '/root/solaris/x86.microroot'
 ramdisk = '/root/solaris/x86.microroot'      # for a 64-bit guest
 # for a 64-bit guest      extra = '/platform/i86xpv/kernel/amd64/unix - nowin -B install_media=cdrom'
 extra = '/platform/i86xpv/kernel/amd64/unix - nowin -B install_media=cdrom'      # for a 32-bit guest
 # for a 32-bit guest      #extra = '/platform/i86xpv/kernel/unix - nowin -B install_media=cdrom'
 #extra = '/platform/i86xpv/kernel/unix - nowin -B install_media=cdrom'  
               
 ~~~  
   
 Start the guest.  Start the guest.
   
 ~~~ {.programlisting}      dom0# xm create -c solaris.cfg
 dom0# xm create -c solaris.cfg      Started domain solaris
 Started domain solaris                            v3.3.2 chgset 'unavailable'
                       v3.3.2 chgset 'unavailable'      SunOS Release 5.11 Version snv_124 64-bit
 SunOS Release 5.11 Version snv_124 64-bit      Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
 Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.      Use is subject to license terms.
 Use is subject to license terms.      Hostname: opensolaris
 Hostname: opensolaris      Remounting root read/write
 Remounting root read/write      Probing for device nodes ...
 Probing for device nodes ...      WARNING: emlxs: ddi_modopen drv/fct failed: err 2
 WARNING: emlxs: ddi_modopen drv/fct failed: err 2      Preparing live image for use
 Preparing live image for use      Done mounting Live image
 Done mounting Live image  
               
 ~~~  
   
 Make sure the network is configured. Note that it can take a minute for  Make sure the network is configured. Note that it can take a minute for
 the xnf0 interface to appear.  the xnf0 interface to appear.
   
 ~~~ {.programlisting}      opensolaris console login: jack
 opensolaris console login: jack      Password: jack
 Password: jack      Sun Microsystems Inc.   SunOS 5.11      snv_124 November 2008
 Sun Microsystems Inc.   SunOS 5.11      snv_124 November 2008      jack@opensolaris:~$ pfexec sh
 jack@opensolaris:~$ pfexec sh      sh-3.2# ifconfig -a
 sh-3.2# ifconfig -a      sh-3.2# exit
 sh-3.2# exit  
               
 ~~~  
   
 Set a password for VNC and start the VNC server which provides the X11  Set a password for VNC and start the VNC server which provides the X11
 display where the installation program runs.  display where the installation program runs.
   
 ~~~ {.programlisting}      jack@opensolaris:~$ vncpasswd
 jack@opensolaris:~$ vncpasswd      Password: solaris
 Password: solaris      Verify: solaris
 Verify: solaris      jack@opensolaris:~$ cp .Xclients .vnc/xstartup
 jack@opensolaris:~$ cp .Xclients .vnc/xstartup      jack@opensolaris:~$ vncserver :1
 jack@opensolaris:~$ vncserver :1  
               
 ~~~  
   
 From a remote machine connect to the VNC server. Use **ifconfig xnf0**  From a remote machine connect to the VNC server. Use **ifconfig xnf0**
 on the guest to find the correct IP address to use.  on the guest to find the correct IP address to use.
   
 ~~~ {.programlisting}      remote$ vncviewer 172.18.2.99:1
 remote$ vncviewer 172.18.2.99:1  
         
 ~~~  
   
 It is also possible to launch the installation on a remote X11 display.  It is also possible to launch the installation on a remote X11 display.
   
 ~~~ {.programlisting}      jack@opensolaris:~$ export DISPLAY=172.18.1.1:0
 jack@opensolaris:~$ export DISPLAY=172.18.1.1:0      jack@opensolaris:~$ pfexec gui-install
 jack@opensolaris:~$ pfexec gui-install  
          
 ~~~  
   
 After the GUI installation is complete you will be asked to reboot.  After the GUI installation is complete you will be asked to reboot.
 Before that you need to determine the ZFS ID for the new boot filesystem  Before that you need to determine the ZFS ID for the new boot filesystem
 and update the configuration file accordingly. Return to the guest  and update the configuration file accordingly. Return to the guest
 console.  console.
   
 ~~~ {.programlisting}      jack@opensolaris:~$ pfexec zdb -vvv rpool | grep bootfs
 jack@opensolaris:~$ pfexec zdb -vvv rpool | grep bootfs                      bootfs = 43
                 bootfs = 43      ^C
 ^C      jack@opensolaris:~$
 jack@opensolaris:~$  
                 
 ~~~  
   
 The final configuration file should look like this. Note in particular  The final configuration file should look like this. Note in particular
 the last line.  the last line.
   
   
 ~~~ {.programlisting}      memory = 640
 memory = 640      name = 'solaris'
 name = 'solaris'      disk = [ 'phy:/dev/wd0k,0,w' ]
 disk = [ 'phy:/dev/wd0k,0,w' ]      vif = [ 'bridge=bridge0' ]
 vif = [ 'bridge=bridge0' ]      kernel = '/root/solaris/unix'
 kernel = '/root/solaris/unix'      ramdisk = '/root/solaris/x86.microroot'
 ramdisk = '/root/solaris/x86.microroot'      extra = '/platform/i86xpv/kernel/amd64/unix -B zfs-bootfs=rpool/43,bootpath="/xpvd/xdf@0:a"'
 extra = '/platform/i86xpv/kernel/amd64/unix -B zfs-bootfs=rpool/43,bootpath="/xpvd/xdf@0:a"'  
                 
 ~~~  
   
 Restart the guest to verify it works correctly.  Restart the guest to verify it works correctly.
   
 ~~~ {.programlisting}      dom0# xm destroy solaris
 dom0# xm destroy solaris      dom0# xm create -c solaris.cfg
 dom0# xm create -c solaris.cfg      Using config file "./solaris.cfg".
 Using config file "./solaris.cfg".      v3.3.2 chgset 'unavailable'
 v3.3.2 chgset 'unavailable'      Started domain solaris
 Started domain solaris      SunOS Release 5.11 Version snv_124 64-bit
 SunOS Release 5.11 Version snv_124 64-bit      Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
 Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.      Use is subject to license terms.
 Use is subject to license terms.      WARNING: emlxs: ddi_modopen drv/fct failed: err 2
 WARNING: emlxs: ddi_modopen drv/fct failed: err 2      Hostname: osol
 Hostname: osol      Configuring devices.
 Configuring devices.      Loading smf(5) service descriptions: 160/160
 Loading smf(5) service descriptions: 160/160      svccfg import warnings. See /var/svc/log/system-manifest-import:default.log .
 svccfg import warnings. See /var/svc/log/system-manifest-import:default.log .      Reading ZFS config: done.
 Reading ZFS config: done.      Mounting ZFS filesystems: (6/6)
 Mounting ZFS filesystems: (6/6)      Creating new rsa public/private host key pair
 Creating new rsa public/private host key pair      Creating new dsa public/private host key pair
 Creating new dsa public/private host key pair      
       osol console login:
 osol console login:  
                 
 ~~~  
   
 Using PCI devices in guest domains  Using PCI devices in guest domains
 ----------------------------------  ----------------------------------
Line 733  instead of the usual driver. The list of Line 713  instead of the usual driver. The list of
 `(bus:dev.func)`{.literal}, where bus and dev are 2-digit hexadecimal  `(bus:dev.func)`{.literal}, where bus and dev are 2-digit hexadecimal
 numbers, and func a single-digit number:  numbers, and func a single-digit number:
   
 ~~~ {.programlisting}      pciback.hide=(00:0a.0)(00:06.0)
 pciback.hide=(00:0a.0)(00:06.0)  
 ~~~  
   
 pciback devices should show up in the domain0's boot messages, and the  pciback devices should show up in the domain0's boot messages, and the
 devices should be listed in the `/kern/xen/pci`{.filename} directory.  devices should be listed in the `/kern/xen/pci`{.filename} directory.
Line 744  PCI devices to be exported to a domU are Line 722  PCI devices to be exported to a domU are
 array of the domU's config file, with the format  array of the domU's config file, with the format
 `'0000:bus:dev.func'`{.literal}  `'0000:bus:dev.func'`{.literal}
   
 ~~~ {.programlisting}      pci = [ '0000:00:06.0', '0000:00:0a.0' ]
 pci = [ '0000:00:06.0', '0000:00:0a.0' ]  
 ~~~  
   
 In the domU an `xpci`{.literal} device will show up, to which one or  In the domU an `xpci`{.literal} device will show up, to which one or
 more pci busses will attach. Then the PCI drivers will attach to PCI  more pci busses will attach. Then the PCI drivers will attach to PCI
Line 755  busses as usual. Note that the default N Line 731  busses as usual. Note that the default N
 build your own kernel to use PCI devices in a domU. Here's a kernel  build your own kernel to use PCI devices in a domU. Here's a kernel
 config example:  config example:
   
 ~~~ {.programlisting}      include         "arch/i386/conf/XEN3_DOMU"
 include         "arch/i386/conf/XEN3_DOMU"      #include         "arch/i386/conf/XENU"           # in NetBSD 3.0
 #include         "arch/i386/conf/XENU"           # in NetBSD 3.0      
       # Add support for PCI busses to the XEN3_DOMU kernel
 # Add support for PCI busses to the XEN3_DOMU kernel      xpci* at xenbus ?
 xpci* at xenbus ?      pci* at xpci ?
 pci* at xpci ?      
       # Now add PCI and related devices to be used by this domain
 # Now add PCI and related devices to be used by this domain      # USB Controller and Devices
 # USB Controller and Devices      
       # PCI USB controllers
 # PCI USB controllers      uhci*   at pci? dev ? function ?        # Universal Host Controller (Intel)
 uhci*   at pci? dev ? function ?        # Universal Host Controller (Intel)      
       # USB bus support
 # USB bus support      usb*    at uhci?
 usb*    at uhci?      
       # USB Hubs
 # USB Hubs      uhub*   at usb?
 uhub*   at usb?      uhub*   at uhub? port ? configuration ? interface ?
 uhub*   at uhub? port ? configuration ? interface ?      
       # USB Mass Storage
 # USB Mass Storage      umass*  at uhub? port ? configuration ? interface ?
 umass*  at uhub? port ? configuration ? interface ?      wd*     at umass?
 wd*     at umass?      # SCSI controllers
 # SCSI controllers      ahc*    at pci? dev ? function ?        # Adaptec [23]94x, aic78x0 SCSI
 ahc*    at pci? dev ? function ?        # Adaptec [23]94x, aic78x0 SCSI      
       # SCSI bus support (for both ahc and umass)
 # SCSI bus support (for both ahc and umass)      scsibus* at scsi?
 scsibus* at scsi?      
       # SCSI devices
 # SCSI devices      sd*     at scsibus? target ? lun ?      # SCSI disk drives
 sd*     at scsibus? target ? lun ?      # SCSI disk drives      cd*     at scsibus? target ? lun ?      # SCSI CD-ROM drives
 cd*     at scsibus? target ? lun ?      # SCSI CD-ROM drives  
 ~~~  
   
 Links and further information  Links and further information
 -----------------------------  -----------------------------
Line 805  Links and further information Line 779  Links and further information
     [boot.cfg(5)](http://netbsd.gw.com/cgi-bin/man-cgi?boot.cfg+5+NetBSD-6.0+i386)      [boot.cfg(5)](http://netbsd.gw.com/cgi-bin/man-cgi?boot.cfg+5+NetBSD-6.0+i386)
     manpages.      manpages.
   
   

Removed from v.1.3  
changed lines
  Added in v.1.4


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