Friday Feb 27, 2009

Solaris U6 on Dell Vostro 200

The USB detection is broken with ICH9 Use -B acpi-user-options=0x8 to boot.

Thursday Feb 26, 2009

Sun Ray 4.1 on OpenSolaris 2008.11

This is installation and troubleshoot procedures to install Sun Ray 4.1 on Opensolaris 2008.11 on my latop. Excellent write up on this is available on the following blog entries:

My intent is to use this at home as well as demo VDI at customer presentations. As such, I did not want to load the Sun Ray server in a Virtual Box session which would unnecessarily slow the the applications.

The networking setup is the crucial as I did not disable the NWAM properly and made system config as utadm expects. Troubleshooting the mistakes I made here took many hours. DO THE FOLLOWING.

  • Disable NWAM per Sun Sun Ray Wiki
  • Make sure /etc/hostname.interfacename has name and not the IP address. Otherwise, the DHCP config will not be successful.
  • /etc/nodename and /etc/hosts need to match /etc/hostname.interface. Otherwise, the DHCP config will not be successful.
  • Use utadm -A method and don't take default.
      Accept as is? ([Y]/N): n
      Do you want to offer IP addresses for this subnet? (Y/[N]): y
    
  • If you are staring at 26D on the Sun Ray device, then apply this work around.
    netservices open
    /opt/SUNWut/sbin/utrestart -c
    

Useful debugging commands:

utquery -d xx.xx.xx.xx
dhtadm -P
pntadm -L
pntadm -P

Tuesday Feb 24, 2009

ZFS Delegated Administration

ZFS is one of the coolest features Solaris. In addition to having an unlimited snapshots automatically so that you can go back and recover deleted or modified files , the administration of this power can be delegated to the individual users. For example

# zfs allow rslee create,mount,snapshot rpool/export/home/rslee
$ zfs snapshot rpool/export/home/rslee@beforebigchange

Friday Feb 20, 2009

OpenSolaris 2009.06 107 Install

Tried a copy of OpenSolaris 2009.06 Build 107. For some reason, the graphical installer does not start by itself. The following is couple of steps to get the installer up:

login:jack
password:jack
su opensolaris
PATH=/usr/openwin/bin:$PATH
/usr/bin/dbus-uuidgen [--ensure=/var/lib/dbus/machine-id
gdm

Alternate way:

Work-around: Login as user "jack", password "jack" and then
issue the command

    $ svcadm clear nwam

The boot process should continue and start the graphical
desktop.

Once the system is up and running, use the development package tree as below:

pkg set-authority -O http://pkg.opensolaris.org/dev/ opensolaris.org.dev

Thursday Feb 19, 2009

Google App Engine on OpenSolaris 2008.11

Google App Engine SDK does not list explicitly list Solaris as one of the platforms. Would it work? Unfortunately, the GAE does not seem to work. Defect 1082 was filed with Google.

  • Download Google App Engine SDK (the Linux/Other Platforms version)
  • Unpack the zip file. I put mine under ~bin directory
  • Install Python 2.5 per GAE Requirement. Python 2.4 is standard install on OpenSolaris 2008.11.
    pfexec pkg install SUNWPython25
    

    Follow the Hello World instruction. Unfortunately, dev_appserver.py returns with below:

    SystemError: frexp() result out of range
    ValueError: bad marshal data
    
  • Install Python 2.5 from sunfreeware.com

    This is somewhat complicated as sunfreeware.com does not resolve the dependencies for you. But the following is list of packages downloaded to make Python work with GAE on OpenSolaris work. (not 100%. see below. Don't think PIL will be required for testing for now). Use script to automate the install of all the packages.

    bzip2
    coreutils
    expat
    fontconfig
    freetype
    gcc
    gd
    glib
    gnuplot
    gtk+
    jpeg
    libgcc
    libiconv
    libintl
    libpng
    mhash
    ncurses
    openssl
    pango
    python
    readline
    render
    renderproto
    tiff
    wxgtk
    xrender
    zlib
    

    Finally, the GAE on OpenSolaris...

    rslee@x61:~/bin/google_appengine$ ./dev_appserver.py ~/src/helloworld/
    INFO     2009-02-22 02:09:41,730 appengine_rpc.py] Server: appengine.google.com
    INFO     2009-02-22 02:09:41,743 appcfg.py] Checking for updates to the SDK.
    INFO     2009-02-22 02:09:44,750 appcfg.py] Update check failed: 
    WARNING  2009-02-22 02:09:44,751 datastore_file_stub.py] Could not read datastore data from /tmp/dev_appserver.datastore
    WARNING  2009-02-22 02:09:44,751 datastore_file_stub.py] Could not read datastore data from /tmp/dev_appserver.datastore.history
    WARNING  2009-02-22 02:09:44,774 dev_appserver.py] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
    INFO     2009-02-22 02:09:44,794 dev_appserver_main.py] Running application helloworld on port 8080: http://localhost:8080
    

Wednesday Feb 18, 2009

Lenovo x61 and OpenSolaris 2008.11

The following is list of things to make my laptop fully function with OpenSolaris 2008.11 so that I can finally remove Windows, for obvious reasons. I still need to maintain Windows within VirtualBox, which by the way boots up Windows faster than on native machine.

Additional Device Drivers/Software

Out of Box Functionality

The following items works without needing any tweaking:

  • Display brightness adjustment using the FN key
  • Keyboard LED light control using the FN key

Some tweaking required

  • To send display to external VGA screen
    xrandr --output VGA --auto
    

Booting OpenSolaris off USB Stick

Booting/Installing OpenSolaris 2008.11 from USB stick is described here Works very well. I followed just the first 3 steps.

wget http://genunix.org/distributions/indiana/osol-0811.usb 
pkg install SUNWdistro-const
usbcopy osol-0811.usb

If a prebuilt USB is not available, an ISO image can be converted to USB manually. This blog has instructions. The following is my example to convert Sun's xVM Server EA3 into USB stick

pfexec pkg install SUNWdistro-const
pfexec usbgen `pwd`/xVM-Server-full-i14_03.iso `pwd`/xVM-Server-full-i14_03.usb /tmp
pfexec usbcopy xVM-Server-full-i14_03.gen
Found the following USB devices:
0:	/dev/rdsk/c3t0d0p0	4.0 GB	USB      Flash Disk       5.00
1:	/dev/rdsk/c5t0d0p0	 HL-DT-ST	DVDRAM GSA-E50L  NE01
Enter the number of your choice: 0

WARNING: All data on your USB storage will be lost.
Are you sure you want to install to
USB Flash Disk 5.00, 4000 MB at /dev/rdsk/c3t0d0p0 ?  (y/n) y

Wednesday Jan 28, 2009

Install OpenSolaris 2008.11 as DomU under xVM Server

Install of OpenSolaris 2008.11 was a bit tricky (could be the user problem :-))

Reference material can be found here. One abnormality I noticed is that if the install does not complete successfully, then the ISO image gets corrupted. I need to delete the ISO image, then copy the image from external USB drive and start over again.

virt-install -n os0811 --paravirt -r 512 --file-size=20 \
  --nographics \
  --file /export/home/xvm/os0811.img \
  -l /export/home/rslee/Download/osol-0811.iso



Starting install...
Creating storage file...  100% |=========================|  20 GB    00:00     
Creating domain...                                                 0 B 00:43 
v3.1.4-xvm chgset 'Mon Oct 13 22:14:51 2008 -0700 15904:94bd0a643efe'
SunOS Release 5.11 Version snv_101b 32-bit
Copyright 1983-2008 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: opensolaris
Remounting root read/write
Probing for device nodes ...
Preparing live image for use
Done mounting Live image
USB keyboard
 1. Albanian                      22. Latvian                       
 2. Belarusian                    23. Macedonian                    
 3. Belgian                       24. Malta_UK                      
 4. Bulgarian                     25. Malta_US                      
 5. Croatian                      26. Norwegian                     
 6. Czech                         27. Polish                        
 7. Danish                        28. Portuguese                    
 8. Dutch                         29. Russian                       
 9. Finnish                       30. Serbia-And-Montenegro         
10. French                        31. Slovenian                     
11. French-Canadian               32. Slovakian                     
12. Hungarian                     33. Spanish                       
13. German                        34. Swedish                       
14. Greek                         35. Swiss-French                  
15. Icelandic                     36. Swiss-German                  
16. Italian                       37. Traditional-Chinese           
17. Japanese-type6                38. TurkishQ                      
18. Japanese                      39. TurkishF                      
19. Korean                        40. UK-English                    
20. Latin-American                41. US-English                    
21. Lithuanian                    
To select the keyboard layout, enter a number [default 41]:

 1. Chinese - Simplified          
 2. Chinese - Traditional         
 3. English                       
 4. French                        
 5. German                        
 6. Italian                       
 7. Japanese                      
 8. Korean                        
 9. Portuguese - Brazil           
10. Russian                       
11. Spanish                       
To select desktop language, enter a number [default is 3]: 
User selected: English
Configuring devices.
Mounting cdroms
Reading ZFS config: done.

opensolaris console login: 

At this point, we are looking at the prompt. Additional instructions from here to compete the installation process. BTW, the "ssh -X" did not work for me out of the box as ssh is not enabled by default on the LiveCD (on 2008.11) Maybe it was on 2008.05.

opensolaris console login: jack
Password: 
Sun Microsystems Inc.   SunOS 5.11      snv_101b        November 2008
jack@opensolaris:~$ su - root
Password: 
Jan 28 18:54:36 opensolaris su: 'su root' succeeded for jack on /dev/console
Sun Microsystems Inc.   SunOS 5.11      snv_101b        November 2008
root@opensolaris:~# ifconfig xnf0
xnf0: flags=201004843 mtu 1500 index 2
        inet 192.168.0.105 netmask ffffff00 broadcast 192.168.0.255
        ether 0:16:3e:78:14:87 
root@opensolaris:~# exit
jack@opensolaris:~$ mkdir .vnc;cp .Xclients .vnc/xstartup
jack@opensolaris:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /jack/.Xauthority

New 'opensolaris:1 ()' desktop is opensolaris:1

Starting applications specified in /jack/.vnc/xstartup
Log file is /jack/.vnc/opensolaris:1.log

jack@opensolaris:~$ 

After this point, go back to Dom0, start the VNCviewer, then install normally.

Install Solaris Nevada as DomU under xVM Server

Install of Solaris Nevada is straight forward; however, it does take rather long time. Reference material can be found here

The following command and the couple of screen scrap from the install

# virt-install -n nv106b --paravirt -r 512 --file-size=20 \
  --nographics \
  --file /export/home/xvm/nv106b.img \
  -l /export/home/rslee/Download/sol-nv-b106-x86-dvd.iso

Starting install...
Creating storage file...  100% |=========================| 20.0 GB    00:00     
Creating domain...                                                 0 B 00:03 
v3.1.4-xvm chgset 'Mon Oct 13 22:14:51 2008 -0700 15904:94bd0a643efe'
SunOS Release 5.11 Version snv_106 32-bit
Copyright 1983-2008 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
NOTICE: Invalid iBFT table 0x1
Configuring /dev
/

    1.     Solaris Interactive Text (Console session) (default)
    2.     Apply driver updates
    3.     Single user shell

Enter the number of your choice.
Selected: 1                                        

Solaris Interactive Text (Console session)

Using install cd in /dev/dsk/c0t1d0p0
Using RPC Bootparams for network configuration information.
Attempting to configure interface xnf0...
Skipped interface xnf0
Reading ZFS config: done.
Setting up Java. Please wait...
Serial console, reverting to text install
Beginning system identification...
Searching for configuration file(s)...
Search complete.
Discovering additional network configuration...

From here on is standard Solaris text based install.

Install Windows in Sun xVM Server under OpenSolaris 2008.11

The following is steps required to install and running Windows in HVM under Sun's xVM Server

There are two ways to go about it: GUI (using virt-manager) and CLI (virsh). Both ways are described below:

GUI Way

  • Bring up virt-manager
    # virt-manager
    
  • Select on File->New Machine...
  • Follow the screens below. Most of the info should he self explanatory. The online help (use the Help button) is helpful as well.

  • The graphical console should automatically start. Otherwise,
    1. From the Virtual Machine Manager window, select the guest domain,
    2. From the Virtual Machine Manager window, select Edit->Machine Details
    3. From the Virtual Machine Details window, select View->Graphical Console
  • Follow the normal Windows install steps
  • When the Windows reboots for the second part of the install, the CD-ROM ISO image is still required, so drop back to command line and issue the following before the Windows starts back again.
    # virsh
    detach-disk winxp hdc
    attach-disk winxp /export/home/rslee/Download/en_winxp_pro.iso hdc --driver file --type cdrom --mode readonly
    
  • Follow the normal Windows install steps
  • Success at last

    CLI Way

    1. man virt-install. It has excellent example
      # virt-install --name windows1 --ram 1024 \
              --cdrom //en_winxp_pro_with_sp2.iso \
              --file /guests/windows1-disk \
              --file-size 10 --vnc
      

  • Mount NTFS partion on Solaris w/ ntfs-3g

    Sometime, read/write into Windows NTFS partition on one's laptop. Solaris support was added into ntfs-3g package 1.2812 (August 15, 2008)

    Reading and creating new files on a NTFS partition seems to work fine; however, I cannot overwrite a file. Waiting for bug fix. Will update the page when the NTFS overwrite works.

    For compiling, please check this blog The following are my steps that consolidates some of the issues I had encountered:

    
    download and install http://dlc.sun.com/osol/on/downloads/current/SUNWonbld.i386.tar.bz2
    
    pkg install gcc-dev sunstudioexpress
    pkg install SUNWgnome-common-devel
    
    
    hg clone ssh://anon@hg.opensolaris.org/hg/fuse/libfuse
    hg clone ssh://anon@hg.opensolaris.org/hg/fuse/fusefs
    cd libfuse/
    export PATH=/opt/onbld/bin:/opt/onbld/bin/i386:/opt/SunStudioExpress/bin:/usr/bin:/usr/sfw/bin
    
    make
    make install
    make pkg
    
    cd ../fusefs/kernel
    make
    make install
    make pkg
    
    pfexec /usr/sbin/pkgadd -d packages SUNWfusefs
    $ pfexec /usr/sbin/pkgadd -d ../../libfuse/packages SUNWlibfuse
    
    
    export PATH=/opt/SunStudioExpress/bin:/usr/bin:/usr/sfw/bin
    wget http://ntfs-3g.org/ntfs-3g-1.2717.tgz
    $ gtar xf ntfs-3g-1.2717.tgz
    $ export CC=gcc
    $ ./configure --prefix=/usr
    $ make
    $ pfexec make install
    

    For downloading pre-build package, please check this blog entry

    These are packages created from the above procedure

    Thursday Jan 22, 2009

    Manipulating OpenOffice Document via Python

    OpenOffice has UNO, http://udk.openoffice.org/, which allows Python and other languages to manipulate an OpenOffice document. One downside of UNO, depending on one's view, is that UNO requires an OpenOffice program to run and accept commands via socket.

    For applications that would prefer direct manipulation of the OpenOffice document via Python, there are two alternatives.

    http://pypi.python.org/pypi/OOoPy/ is one method; however, the documentation is somewhat sparse.

    http://opendocumentfellowship.com/ has another Python based tool with documentation.

    Wednesday Jan 21, 2009

    Install software from www.sunfreeware.com

    Some of the applications have rather long list of dependencies that are not auto resolved. The following script takes all of the packages listed as the dependencies and installs the latest version if multiple versions are found.

    The script does not do all of the work as dependencies listed for an application need to be screen scraped and put into a file. Still, it does make things easier.

    The script uses the pkg-get from http://www.sunfreeware.com/pkg-get.html

    Usage and Description:

    In /tmp/pkglist, cut and paste of the packages required. /tmp/pkg-get-err.$$ may have multiple versions of software. take the last one and install it

    Script:

    for pkg in `cat /tmp/pkglist | sort -u`; do
      echo $pkg
      pkg-get install $pkg 2>/tmp/pkg-get-err.$$
      if [ ! -z `tail -1 /tmp/pkg-get-err.$$ | grep "pkg-get"` ]; then
        inst=`tail -1 /tmp/pkg-get-err.$$`
        `$inst`
      fi
      rm /tmp/pkg-get-err.$$
    done
                        

    Wednesday Dec 21, 2005

    DVD Free Jumpstart Install Server


    Overview

    You have existing servers running Solaris already and want to install new releases or newer updates? You want to Jumpstart but don’t have access to a DVD burner? Well, you don’t have to burn a DVD with a copy of downloaded Solaris DVD ISO image in order to setup a Jumpstart install server. Use Solaris’ loop back file system mechanism to mount the DVD ISO image and perform the install server setup.


    If you want to work with CD-ROM Solaris ISO image instead, please check out BigAdmin: A CD-Free Installer for the Solaris OS. Working with CD-ROM Solaris ISO image is a bit more complicated due to how the boot partition is organized.


    Requirements

    Shown below is based on a server running Solaris 9 with Solaris 10 Update 1 DVD image. Assume:

    • /export has about 10G free

    • DVD ISO image is at /export/iso

    • /export/install is where the install server image will be located at

    Downloaded DVD ISO image of Solaris, Solaris Express or OpenSolaris


    Solution

    # lofiadm -a /export/iso/s10-u1/sol-10-u1-ga-sparc-dvd.iso

    /dev/lofi/1

    # mkdir /mnt/iso

    # mount -F hsfs /dev/lofi/1 /mnt/iso

    # cd /mnt/iso/Solaris_10/Tools

    # ./setup_install_server /export/install/s10_u1

    Verifying target directory...

    Calculating the required disk space for the Solaris_10 product

    Calculating space required for the installation boot image

    Copying the CD image to disk...

    Copying Install Boot Image hierarchy...

    Install Server setup complete



    Calendar

    Feeds

    Search

    Links

    Navigation

    Referrers