File:  [NetBSD Developer Wiki] / wikisrc / ports / xen / howto-solaris.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Fri Dec 26 20:28:45 2014 UTC (5 years, 3 months ago) by gdt
Branches: MAIN
CVS tags: HEAD
Move solaris to own page.

Solaris domU creation
=====================

Download an Opensolaris [release](http://opensolaris.org/os/downloads/)
or [development snapshot](http://genunix.org/) DVD image. Attach the DVD
image to a MAN.VND.4 device. Copy the kernel and ramdisk filesystem
image to your dom0 filesystem.

    dom0# mkdir /root/solaris
    dom0# vnconfig vnd0 osol-1002-124-x86.iso
    dom0# mount /dev/vnd0a /mnt

    ## for a 64-bit guest
    dom0# cp /mnt/boot/amd64/x86.microroot /root/solaris
    dom0# cp /mnt/platform/i86xpv/kernel/amd64/unix /root/solaris

    ## for a 32-bit guest
    dom0# cp /mnt/boot/x86.microroot /root/solaris
    dom0# cp /mnt/platform/i86xpv/kernel/unix /root/solaris

    dom0# umount /mnt
          

Keep the MAN.VND.4 configured. For some reason the boot process stalls
unless the DVD image is attached to the guest as a "phy" device. Create
an initial configuration file with the following contents. Substitute
*/dev/wd0k* with an empty partition at least 8 GB large.

    memory = 640
    name = 'solaris'
    disk = [ 'phy:/dev/wd0k,0,w' ]
    disk += [ 'phy:/dev/vnd0d,6:cdrom,r' ]
    vif = [ 'bridge=bridge0' ]
    kernel = '/root/solaris/unix'
    ramdisk = '/root/solaris/x86.microroot'
    # for a 64-bit guest
    extra = '/platform/i86xpv/kernel/amd64/unix - nowin -B install_media=cdrom'
    # for a 32-bit guest
    #extra = '/platform/i86xpv/kernel/unix - nowin -B install_media=cdrom'
          

Start the guest.

    dom0# xm create -c solaris.cfg
    Started domain solaris
                          v3.3.2 chgset 'unavailable'
    SunOS Release 5.11 Version snv_124 64-bit
    Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
    Use is subject to license terms.
    Hostname: opensolaris
    Remounting root read/write
    Probing for device nodes ...
    WARNING: emlxs: ddi_modopen drv/fct failed: err 2
    Preparing live image for use
    Done mounting Live image
          

Make sure the network is configured. Note that it can take a minute for
the xnf0 interface to appear.

    opensolaris console login: jack
    Password: jack
    Sun Microsystems Inc.   SunOS 5.11      snv_124 November 2008
    jack@opensolaris:~$ pfexec sh
    sh-3.2# ifconfig -a
    sh-3.2# exit
          

Set a password for VNC and start the VNC server which provides the X11
display where the installation program runs.

    jack@opensolaris:~$ vncpasswd
    Password: solaris
    Verify: solaris
    jack@opensolaris:~$ cp .Xclients .vnc/xstartup
    jack@opensolaris:~$ vncserver :1
          

From a remote machine connect to the VNC server. Use `ifconfig xnf0` on
the guest to find the correct IP address to use.

    remote$ vncviewer 172.18.2.99:1
          

It is also possible to launch the installation on a remote X11 display.

    jack@opensolaris:~$ export DISPLAY=172.18.1.1:0
    jack@opensolaris:~$ pfexec gui-install
           

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
and update the configuration file accordingly. Return to the guest
console.

    jack@opensolaris:~$ pfexec zdb -vvv rpool | grep bootfs
                    bootfs = 43
    ^C
    jack@opensolaris:~$
           

The final configuration file should look like this. Note in particular
the last line.

    memory = 640
    name = 'solaris'
    disk = [ 'phy:/dev/wd0k,0,w' ]
    vif = [ 'bridge=bridge0' ]
    kernel = '/root/solaris/unix'
    ramdisk = '/root/solaris/x86.microroot'
    extra = '/platform/i86xpv/kernel/amd64/unix -B zfs-bootfs=rpool/43,bootpath="/xpvd/xdf@0:a"'
           

Restart the guest to verify it works correctly.

    dom0# xm destroy solaris
    dom0# xm create -c solaris.cfg
    Using config file "./solaris.cfg".
    v3.3.2 chgset 'unavailable'
    Started domain solaris
    SunOS Release 5.11 Version snv_124 64-bit
    Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
    Use is subject to license terms.
    WARNING: emlxs: ddi_modopen drv/fct failed: err 2
    Hostname: osol
    Configuring devices.
    Loading smf(5) service descriptions: 160/160
    svccfg import warnings. See /var/svc/log/system-manifest-import:default.log .
    Reading ZFS config: done.
    Mounting ZFS filesystems: (6/6)
    Creating new rsa public/private host key pair
    Creating new dsa public/private host key pair

    osol console login:

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