<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Solaris Blog &#187; Solaris How-To</title>
	<atom:link href="http://solaris.reys.net/articles/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://solaris.reys.net</link>
	<description>Tips and tricks on DTrace, ZFS, Zones and Solaris administration</description>
	<lastBuildDate>Sun, 08 Jan 2012 13:47:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Solaris 8 Migration Assistant (Project Etude)</title>
		<link>http://solaris.reys.net/solaris-8-migration-assistant-project-etude/</link>
		<comments>http://solaris.reys.net/solaris-8-migration-assistant-project-etude/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:39:45 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Solaris How-To]]></category>
		<category><![CDATA[s8ma]]></category>
		<category><![CDATA[solaris 8]]></category>
		<category><![CDATA[solaris zones]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=45</guid>
		<description><![CDATA[I&#8217;ve finally completed my first successful experiment with Solaris 8 Migration Assistant (S8MA) today &#8211; a new product from Sun which allows you to run Solaris 8 branded zones. It&#8217;s a fully and officially supported solution (for an extra price), but you can download the free 90-day trial to play with it and understand how [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally completed my first successful experiment with <strong>Solaris 8 Migration Assistant</strong> (<strong>S8MA</strong>) today &#8211; a new product from Sun which allows you to run Solaris 8 branded zones. It&#8217;s a fully and officially supported solution (for an extra price), but you can download the free 90-day trial to play with it and understand how really cool it is.</p>
<h3>Why use Solaris 8 zones?</h3>
<p>First of all, just a few words about the niche for this product. Many companies are rather conservative about their Solaris upgrades. Most systems are still running Solaris 8, if not something older. Quite often this is also dictated by third-party software dependencies &#8211; products which were bought and configured for Solaris 8, which are now so tightly integrated that there isn&#8217;t an easy way to migrated them into Solaris 10. Such systems are doomed for slow but very expensive death. Expensive, because with every year the hardware support for  servers capable of running Solaris 8 raises again and again.</p>
<p><span id="more-45"></span></p>
<p>That&#8217;s where the Solaris 8 zones come in. It&#8217;s very easy, really: you create a flar-copy fo your existing physical server under Solaris 8, then create a Solaris 8 zone, import your flar-archive and get a virtual copy of your Solaris 8 environment, with all your processes, programs and startup scripts.</p>
<p>To make things easier, it&#8217;s even possible to configure your hostid in Solaris 8 zone to match the one of the physical Solaris 8 system, this way no programs running in the zone will even guess that they&#8217;ve been virtualized.</p>
<p>Who knows, maybe I&#8217;ll tell you more about this technology some other day, but for now &#8211; just the simplest list of actions and commands for your S8MA proof of concept.</p>
<h3>Preparation: Solaris 10u4 server an S8MA packages</h3>
<p>1. Find and prepare a sparc box with Solaris 10u4. It is important to have the latest Solaris 10 update. Preparations are usually limited to applying a kernel patch, 127111-01 in my case.</p>
<p>2. Download the Solaris 8 Migration Assitant (current version is 1.0) from this location: <a href="http://www.sun.com/download/products.xml?id=470c4a45">Solaris 8 Migration Assistant</a>. The 3 packages in archive are dead easy to install using standard pkgadd.</p>
<p>Here are the packages you&#8217;ll get:</p>
<div><code>SUNWs8brandr     Solaris 8 Migration Assistant: solaris8 brand support (Root)<br />
SUNWs8brandu     Solaris 8 Migration Assistant: solaris8 brand support (Usr)<br />
SUNWs8p2v       Solaris 8 p2v Tool</code></div>
<h3>Make a snapshot of your old Solaris 8 server</h3>
<p>You need to create a flar-archive of your Solaris 8 system.</p>
<p>Log onto your Solaris 8 box, and run the command. In this and all the following examples, solaris8 is nothing but an arbitrary name I&#8217;ve chosen for my zone. You might as well call it anything you like.</p>
<pre><span style="font-family: -webkit-monospace;">solaris# <strong>flarcreate -S -n solaris8 solaris8.flar</strong></span></pre>
<h3>Set up a Solaris 8 zone</h3>
<p>Here&#8217;s how you do it:</p>
<pre><code>solaris# <strong>zonecfg -z solaris8</strong>
solaris8: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:solaris8-system&gt; <strong>create -t SUNWsolaris8</strong>
zonecfg:solaris8&gt; <strong>set zonepath=/export/solaris8</strong>
zonecfg:solaris8&gt; <strong>add net</strong>
zonecfg:solaris8:net&gt; <strong>set address=172.21.7.155/24</strong>
zonecfg:solaris8:net&gt; <strong>set physical=ce0</strong>
zonecfg:solaris8:net&gt; <strong>end</strong>
zonecfg:solaris8&gt; <strong>commit</strong>
zonecfg:solaris8&gt; <strong>exit</strong></code></pre>
<p>Naturally, your IP and network device name will be different. As of now, our zone is fully configured, but not yet installed.</p>
<h3>Install Solaris 8 zone using flar-archive</h3>
<p><span style="font-family: -webkit-monospace;">solaris# <strong>zoneadm -z solaris8 install -u -a /export/solaris8.flar</strong><br />
Log File: /var/tmp/solaris8.install.13597.log<br />
Source: /export/solaris8.flar<br />
Installing: This may take several minutes&#8230;<br />
Postprocessing: This may take several minutes&#8230;<br />
WARNING: zone did not finish booting.</span></p>
<div><code>Result: Installation completed successfully.<br />
Log File: /export/solaris8/root/var/log/solaris8.install.13597.log</code></div>
<p>In my case the Solaris 8 zone got stuck on sys-unconfig, and so I had to connect to the virtual console of the zone to help it move on:</p>
<p>Here&#8217;s how you connect to a zone&#8217;s console:</p>
<pre>solaris# <strong>zlogin -C solaris8</strong></pre>
<p>That&#8217;s it! The rest was easy &#8211; just a few minutes of configuring the network parameters and DNS/NIS settings. Finally, I was able to ssh into the new zone and run uname:</p>
<div>
<pre>solaris8 #<strong>uname -a</strong>
SunOS solaris8 5.8 Generic_Virtual sun4u sparc SUNW,Sun-Fire-V490</pre>
</div>
<p>I liked <strong>Solaris 8 Migration Assistant</strong> very much. It&#8217;s an incredibly quick and easy way to have a whole bunch of Solaris 8 systems virtualized and running under on one of the most advanced servers with the most advanced OS &#8211; Solaris 10u4.</p>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/solaris-8-migration-assistant-project-etude/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How-To: Installing Solaris with PXE/DHCP</title>
		<link>http://solaris.reys.net/how-to-installing-solaris-with-pxe-dhcp/</link>
		<comments>http://solaris.reys.net/how-to-installing-solaris-with-pxe-dhcp/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:28:21 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Solaris How-To]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[solaris install]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=26</guid>
		<description><![CDATA[Next Solaris Express build will probably contain one of the long awaited features: Solaris NewBoot architecture for x86 systems. Among other boot architecture improvements, NewBoot introduces GRUB with ufs support, and a pxegrub for PXE booting. Casper Dik describes it here: The End Of Realmode Boot. In this entry I&#8217;ll try and explain how to set [...]]]></description>
			<content:encoded><![CDATA[<p>Next <a title="http://www.sun.com/software/solaris/solaris-express/get.jsp" onmouseover="window.status='http://www.sun.com/software/solaris/solaris-express/get.jsp';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url_id=932&amp;entry_id=63">Solaris Express</a> build will probably contain one of the long awaited features: Solaris NewBoot architecture for x86 systems. Among other boot architecture improvements, NewBoot introduces <a title="http://www.gnu.org/software/grub/" onmouseover="window.status='http://www.gnu.org/software/grub/';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url_id=933&amp;entry_id=63">GRUB</a> with ufs support, and a <strong>pxegrub</strong> for PXE booting. Casper Dik describes it here: <a title="http://blogs.sun.com/roller/page/casper/20050427#the_end_of_realmode_boot" onmouseover="window.status='http://blogs.sun.com/roller/page/casper/20050427#the_end_of_realmode_boot';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url_id=934&amp;entry_id=63">The End Of Realmode Boot</a>.</p>
<p>In this entry I&#8217;ll try and explain how to set up an install server to allow you do a network install of Solaris with <a title="http://www.pxe.ca/" onmouseover="window.status='http://www.pxe.ca/';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url_id=935&amp;entry_id=63">PXE</a>.</p>
<h3>Solaris PXE/DHCP server howto</h3>
<p>The procedure described below describes steps necessary for PXE booting and installing a client with Grub bootloader, which is the default one in Solaris since Nevada b14. Obviously, the very first requirement is that you absolutely must have a PXE-enabled network card installed in the client machine you&#8217;re about to install.</p>
<p><span id="more-26"></span>Here is the full list of server-side components you need to have in order to be able to PXE-boot and install a client machine over network:</p>
<ol>
<li>DHCP server setup and configured</li>
<li>Network install OS image</li>
<li>Jumstart configuration files for a given client</li>
</ol>
<p>I&#8217;ll go through this list first, and then will give a list of actions you have to take to configure and PXE-boot a client:</p>
<h3><strong>1. DHCP server configuration</strong></h3>
<p><strong>1.1. Setup</strong><br />
Start off by doing this:</p>
<pre>solaris# <strong>dhcpconfig -D -r SUNWbinfiles -p /var/dhcp</strong></pre>
<p>This configures your DHCP server: it creates an empty resources table for its use in /var/dhcp, and creates an <strong>/etc/inet/dhcpsvc.conf</strong> file with a contents like this:</p>
<div class="bb-code">
<pre>DAEMON_ENABLED=TRUE
RESOURCE=SUNWbinfiles
RUN_MODE=server
PATH=/var/dhcp
CONVER=1</pre>
</div>
<p>Your default DHCP daemon (<strong>/usr/lib/inet/in.dhcpd<span style="font-weight: normal;">) is started at this stage, andthe above shown dhcpsvc.conf file ensures your dhcp server gets started up automatically upon reboot from <strong>/etc/init.d/dhcp <span style="font-weight: normal;">script.</span></strong></span></strong></p>
<p><strong>1.2. Networks</strong></p>
<p>Here you have to look at your topology and decide, which networks are going to be served by your DHCP server. If you have a DHCP server configured by someone else, here&#8217;s how you look at the list of networks served:</p>
<pre>solaris# <strong>pntadm -L</strong></pre>
<p>It returns you a list, on our server it looks like this:</p>
<pre>192.1.3.0
192.1.4.0
192.1.1.0
192.1.2.0
192.1.9.0</pre>
<p>To create a table for another network, do this:</p>
<pre>solaris# <strong>pntadm -C 192.1.10.0</strong></pre>
<p>Make sure you have<strong>/etc/netmasks <span style="font-weight: normal;">updated, if your network is subnetted. Update your <strong>/etc/inet/dhcpsvc.conf <span style="font-weight: normal;">file to include a line with all the DHCP active interfaces. On our server it looks like this:</span></strong></span></strong></p>
<pre>INTERFACES=hme1,qfe0,qfe1,qfe3</pre>
<h3><strong>2. Network install OS image setup</strong></h3>
<h3><span style="font-weight: normal; font-size: 13px;">Follow the instructions from this page: <a title="http://docsview.sfbay/app/docs/doc/817-5504/6mkv4nh3m?a=view" onmouseover="window.status='http://docsview.sfbay/app/docs/doc/817-5504/6mkv4nh3m?a=view';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url=aHR0cDovL2RvY3N2aWV3LnNmYmF5L2FwcC9kb2NzL2RvYy84MTctNTUwNC82bWt2NG5oM20/YT12aWV3&amp;entry_id=63">Creating an install server with CD media</a></span></h3>
<p>In short: create a directory for your netinstall image, and use <strong>setup_install_server</strong> and <strong>add_instll_server c<span style="font-weight: normal;">ommands to copy necessary files from Solaris_10.1/Tools directory of your install media (CDs or DVD).</span></strong></p>
<p>Share your netinstall image out.</p>
<p>Checklist:</p>
<ul>
<li>make sure the netinstall directory is shared out to your clients</li>
<li>if you have more than one network, make sure all your networks have access to this directory.</li>
</ul>
<p>Share command should return you something like this for your install directory:</p>
<pre>-               /export/install2   ro=@192.1.1:@192.1.2:@192.1.3:@192.1.4:@192.1.9	""</pre>
<h3><strong>3. JumpStart configuration</strong></h3>
<p>Follow the instructions from this page: <a title="http://docsview.sfbay/app/docs/doc/817-2753/6mid55lo8?q=jumpstart&amp;a=view" onmouseover="window.status='http://docsview.sfbay/app/docs/doc/817-2753/6mid55lo8?q=jumpstart&amp;a=view';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url=aHR0cDovL2RvY3N2aWV3LnNmYmF5L2FwcC9kb2NzL2RvYy84MTctMjc1My82bWlkNTVsbzg/cT1qdW1wc3RhcnQmYT12aWV3&amp;entry_id=63">Creating a profile for networked system</a>.</p>
<p>On our server, the JumpStart directory is <strong>/export/install/config</strong>. Then each machine has a directory there, like <strong>/export/install/config/perf-123</strong>.</p>
<p>Okay. Assuming you&#8217;ve done everything above, you&#8217;ve got a DHCP server configured, netinstall image ready and JumpStart files created for your client machine.</p>
<p>Now we&#8217;re ready to reinstall your client. Here&#8217;s what to do:</p>
<p><strong>1. Generic add_install_client</strong></p>
<p>Go to your netinstall image directory, and go to <strong>Solaris_10.1/Tools</strong> dir, where you have add_install_script. On our server, for Nevada b14 it&#8217;s this directory:</p>
<pre>/export/install2/nv/snv_14/Solaris_10.1/Tools</pre>
<p>Now, do this:</p>
<pre>solaris# <strong>./add_install_client -d SUNW.i86pc i86pc</strong></pre>
<p>It&#8217;s a very important commant. It creates, if necessary, <strong>/tftpboot <span style="font-weight: normal;">directory, or updates it with generic files for the netinstall OS image we&#8217;re using. This command will also enable TFTP server on your machine. At last, it will create a <strong>/tftboot/pxegrub.I86PC.Solaris_10.1-1 <span style="font-weight: normal;">file, which will be used to PXE boot each client you want to install with this build.</span></strong></span></strong></p>
<p><strong>2. Client-specific add_install_client</strong></p>
<p>Then, for our client, we have to do this:</p>
<div class="bb-code">
<pre>solaris# <strong>./add_install_client -d -e $ETHER 
-c $SERVER:/export/install/config/$SYSNAME 
-p $SERVER:/export/install/config/$SYSNAME 
-s $SERVER:$SOLARIS_PATH 
-b "console=$TTY" i86pc </strong></pre>
</div>
<p>It&#8217;s a line from our script which automates the installation, and it shows clearly what is being passed to the add_install_client command: <strong>$ETHER <span style="font-weight: normal;">is an MAC-address of the client box. Bear in mind, that for most MAC-addresses you have to add &#8220;01&#8243; to the beginning of the address. Also, you have to get rid of the colons usually found in MAC address. So, for instance, if your client has this entry in <strong>/etc/ethers <span style="font-weight: normal;">file on your server:</span></strong></span></strong></p>
<pre>00:09:3d:00:68:f3 perf-123</pre>
<p>The MAC-address you&#8217;ll pass to the add_install_client will be this: <strong>0100093D0068F3<span style="font-weight: normal;">.</span></strong></p>
<p>Other parameters are:</p>
<ul>
<li><strong>$SERVER <span style="font-weight: normal;">- IP address of your server&#8217;s interface on the subnet your client is on </span></strong></li>
<li><strong><span style="font-weight: normal;"><strong>$SYSNAME <span style="font-weight: normal;">- a hostname of the client</span></strong></span></strong></li>
<li><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>$SOLARIS_PATH <span style="font-weight: normal;">- is a full path to the netinstall image you&#8217;re using</span></strong></span></strong></span></strong></li>
<li><strong>$TTY<span style="font-weight: normal;">- is an input-output device used during pxegrub boot. You can specify ttya/ttyb here to get an output on a console, connected to your client. You may also not specify this parameter at all for the default device to be used (screen/keyboard).</span></strong></li>
</ul>
<p>So, for our client perf-123 the final line looks like this:</p>
<div class="bb-code">
<pre>solaris# <strong>./add_install_client -d -e 0100093D0068F3</strong>
-c 192.1.1.254:/export/install/config/perf-123 
-p 192.1.1.254:/export/install/config/perf-123 
-s 192.1.1.254:/export/install2/nv/snv_14 
-b "console=ttya" i86pc</pre>
</div>
<p>This line creates three files in your <strong>/tftpboot <span style="font-weight: normal;">directory:</span></strong></p>
<ul>
<li><strong>menu.lst.0100093D0068F3 <span style="font-weight: normal;">- grub menu for your client&#8217;s PXE boot</span></strong></li>
<li><strong><span style="font-weight: normal;"><strong>rm.0100093D0068F3 <span style="font-weight: normal;">- a standard shell script for cleaning up /tftpboot files for your client</span></strong></span></strong></li>
<li><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>0100093D0068F3 <span style="font-weight: normal;">- a symbolic link to a build&#8217;s pxegrub file in /tftpboot</span></strong></span></strong></span></strong></li>
</ul>
<p>For perf-123, this link looks like this:</p>
<div class="bb-code">
<pre>solaris# <strong>ls -al /tftpboot/0100093D0068F3</strong>
lrwxrwxrwx   1 root     other         28 May 23 17:27 
/tftpboot/0100093D0068F3 -&gt; pxegrub.I86PC.Solaris_10.1-1</pre>
</div>
<p>If you check now, the grub menu file will look like this:</p>
<div class="bb-code">
<pre>solaris# <strong>more /tftpboot/menu.lst.0100093D0068F3 </strong>
default=0
timeout=30
title Solaris_10.1 Jumpstart
        kernel /I86PC.Solaris_10.1-1/multiboot kernel/unix -B  
console=ttya,install_config=192.1.1.254:/export/install/config/perf-123,  
sysid_config=192.1.1.254:/export/install/config/perf-123,  
install_media=192.1.1.254:/export/install2/nv/snv_14
        module /I86PC.Solaris_10.1-1/x86.miniroot</pre>
</div>
<p>Unfortunatelly, at this early stage, we have to manually update this file so that the machine not only boots off the network, but starts JumpStart install automatically. To do this, you have to pass a &#8220;- install dhcp&#8221; as a boot argument to Solaris kernel. So we update one of the menu file lines to look like this:</p>
<div class="bb-code">
<pre>kernel /I86PC.Solaris_10.1-1/multiboot kernel/unix - install dhcp  -B  
console=ttya,install_config=192.1.1.254:/export/install/config/perf-123,  
sysid_config=192.1.1.254:/export/install/config/perf-123,  
install_media=192.1.1.254:/export/install2/nv/snv_14</pre>
</div>
<p>I&#8217;m sure later there will be a command line option, so I&#8217;ll update this how-to accordingly.</p>
<p>As you can see, most of the add_install_clients parameters end up in this file. A menu file is also a good way to do basic sanity checks, cause it shows you where your client will try to mount a netinstall image from, and where JumpStart will expect to have your client&#8217;s configuration files to be found.</p>
<h3><strong>4. DHCP &#8211; IP address and a macro for your client system</strong></h3>
<p>First, add a fixed IP for your client, which will be issued to it by your server upon DHCP request:</p>
<pre>solaris# <strong>pntadm -f 01 -e 12/31/2010 -A $IPADDR -i $ETHER -m $SYSNAME -s $SERVER $NETWORK.0</strong></pre>
<p>Most of the parameters are self-explanatory, and you know most of them from add_install_client command. So I&#8217;ll mention only the new ones:</p>
<ul>
<li><strong>$IPADDR <span style="font-weight: normal;">is the IP address you want DHCP server to assign to your client</span></strong></li>
<li><strong><span style="font-weight: normal;"><strong>$NETWORK <span style="font-weight: normal;">is the network your client belongs to. Obviously, $IPADDR should be in this network as well.</span></strong></span></strong></li>
<li><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>-f 01 <span style="font-weight: normal;">means that this IP lease is permanent</span></strong></span></strong></span></strong></li>
<li><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><strong>-e 12/31/2010<span style="font-weight: normal;">sets the expiration date for this lease (we sure have got some time before 2010)</span></strong></span></strong></span></strong></span></strong></li>
</ul>
<p>Now, what this line does apart from assigning an IP address to our client, is that it also assigns the client a DHCP macro. By following the macro specified, your DHCP server will give the client all the additional info the client needs to PXE boot.</p>
<p>Here&#8217;s the line:</p>
<pre>solaris# <strong>dhtadm -A -m $SYSNAME -d ":BootSrvA=$SERVER:BootFile=$ETHER:"</strong></pre>
<p>This line tells the client to try and PXE boot off a specified server with IP $SERVER, and suggests that the bootfile will be $ETHER. This file, as you remember, essentially points to a pxegrub file for the netinstall build.</p>
<p>That&#8217;s it! Make sure your BIOS points to a PXE-enabled network card on your client, reboot the box, and you should see it downloading the Solaris miniroot onto the client and then booting Solaris. As always, <a title="http://docs.sun.com/app/docs/doc/817-0690/6mgflntn3?q=snoop&amp;a=view" onmouseover="window.status='http://docs.sun.com/app/docs/doc/817-0690/6mgflntn3?q=snoop&amp;a=view';return true;" onmouseout="window.status='';return true;" href="http://solaris.reys.net/exit.php?url_id=938&amp;entry_id=63">snoop</a> is your friend with network troubleshooting.</p>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/how-to-installing-solaris-with-pxe-dhcp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HOW-TO: using pkg-get to install CSW packages in Solaris</title>
		<link>http://solaris.reys.net/how-to-using-pkg-get-to-install-csw-packages-in-solaris/</link>
		<comments>http://solaris.reys.net/how-to-using-pkg-get-to-install-csw-packages-in-solaris/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:19:20 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Solaris How-To]]></category>
		<category><![CDATA[opencsw]]></category>
		<category><![CDATA[pkg-get]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=18</guid>
		<description><![CDATA[As I&#8217;ve mentioned already, a couple day ago I&#8217;ve installed Solaris Express 2/06 on my desktop. And while the system isn&#8217;t tuned for the maximum comfort, I thought I&#8217;d write a few entries for those of you who have just started learning and using Solaris 10. CSW software repository CSW (Community SoftWare) available through openCSW.org [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve mentioned already, a couple day ago <a href="http://solaris.reys.net/2006/02/solaris_express_on_my_x86_desktop">I&#8217;ve installed Solaris Express 2/06 on my desktop</a>. And while the system isn&#8217;t tuned for the maximum comfort, I thought I&#8217;d write a few entries for those of you who have just started learning and using <strong>Solaris 10</strong>.</p>
<h3>CSW software repository</h3>
<p>CSW (Community SoftWare) available through <a href="http://www.opencsw.org">openCSW.org</a> is wonderful repository with hundreds of software packages for Solaris 8, Solaris 9 and Solaris 10. Armed with the mighty <strong>pkg-get</strong> tool, this is definitely one of the easiest and quicked ways to get new software installed without having to compile anything to meet dependencies.</p>
<p>Today I&#8217;ll just give you a very brief intro, with a promise to revisit CSW in more detail later.</p>
<p><strong>1. Packages storage</strong><br />
Create a directory where all the downloaded packages will be stored. It will be better if this directory is on a filesystem with plenty of space &#8211; it&#8217;s hard to make any space usage predictions, but I believe a couple of available gigabytes would be useful.</p>
<p><strong>WARNING:</strong> this directory is merely a storage for the packages. The software installed from these packages will reside in a different directory structure &#8211; under <strong>/opt/csw</strong> (read on).</p>
<div>
<pre>solaris# <strong>mkdir /export/dist/csw</strong>
solaris# <strong>cd /export/dist/csw</strong></pre>
</div>
<p><strong>2. Using pkg-get command</strong></p>
<p>This command line tool is all you&#8217;re going to ever need to download, install or update your CSW packages. Before you do anything else, you have to download the package with this tool and get it installed. I&#8217;m not showing the standard output commands will give you. Here I&#8217;m only giving you the commands you may use.</p>
<div>
<pre>solaris# <strong>/usr/sfw/bin/wget http://www.opencsw.org/pkg_get.pkg</strong>
solaris# <strong>pkgadd -d ./pkg_get.pkg</strong></pre>
</div>
<p>At this stage you&#8217;ll have a <strong>/opt/csw</strong> directory created, where all the installed software will be put. <strong>pkg-get</strong> is the first installed software, and the full path to this command will be <strong>/opt/csw/bin/pkg-get</strong></p>
<p><strong>3. Configuring pkg-get</strong></p>
<p>To change configuration parameters of pkg-get you&#8217;re going to edit the <strong>/opt/csw/etc/pkg-get.conf</strong> file. There are parameters you may want to change.</p>
<p><strong>URL parameter in pkg-get</strong></p>
<p><strong>url</strong> &#8211; this specifies what mirror of the openCSW repository we want to use.</p>
<p>For best results, visit the <a href="http://www.opencsw.org/mirrors">openCSW mirrors</a> page and select the mirror closest to you geographically.</p>
<p>In the <strong>pkg-get.conf</strong> file you have to find this:</p>
<div>
<pre># default site, in USA:
url=http://ibiblio.org/pub/packages/solaris/opencsw/current</pre>
</div>
<p>and now edit the line to include your new mirror server, and not the default ibiblio.org. The closest one to me is heanet.ie:</p>
<pre># default site, in USA:
url=http://ftp.heanet.ie/pub/opencsw/current</pre>
<p><strong>WARNING:</strong> updating mirrors is a responsibility of their personnel, and not the opencsw.org maintainers. Because of this, some of the official mirrors might not have all the latest changes of the main repository ibiblio.org. So, if something doesn&#8217;t work, try changing this url parameter back.</p>
<p><strong>UPDATED:</strong> for instance, heanet.ie didn&#8217;t seem to have the Solaris 11 support &#8211; which is essentially what all the latest Solaris Express builds are. Because of his, <strong>pkg-get</strong> couldn&#8217;t find the 5.11 catalog file for my Solaris version, so I had to get back to ibiblio.org, even though my access to it can some be really slow.</p>
<p><strong>PKGADDFLAGS=-G</strong> &#8211; this line has to be uncommented if you don&#8217;t want pkg-get trying to install new packages into any Solaris zones but the global one</p>
<p><strong>PKGGET_DOWNLOAD</strong></p>
<p>This parameter has to be changed to reflect the location of packages storage directory:</p>
<pre><span style="font-style: normal;">PKGGET_DOWNLOAD_DIR=/export/dist/csw</span></pre>
<p><strong>4. CSWcommon package</strong></p>
<p>This package has all the core files and directories pkg-get needs to begin with. This is also the necessary package to  be installed as most of other openCSW packages depend on it.</p>
<pre>solaris# <strong>/opt/csw/bin/pkg-get -i common</strong></pre>
<p>That&#8217;s it! Now you&#8217;re ready to install any CSW software packages!</p>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/how-to-using-pkg-get-to-install-csw-packages-in-solaris/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HOW-TO: using truss, ldd and nm to observe binary files</title>
		<link>http://solaris.reys.net/how-to-using-truss-ldd-and-nm-to-observe-binary-files/</link>
		<comments>http://solaris.reys.net/how-to-using-truss-ldd-and-nm-to-observe-binary-files/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:13:31 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Solaris How-To]]></category>
		<category><![CDATA[ldd]]></category>
		<category><![CDATA[truss]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=10</guid>
		<description><![CDATA[I&#8217;ve decided to write down a few useful tips on observing binary files in Solaris. The commands used are available since Solaris 8, so hopefully you&#8217;ll find these tricks useful. Quite often it happens that the programs we run don&#8217;t work as they should, showing us errors like &#8220;referenced symbol not found&#8221; or this: ld.so.1: [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to write down a few useful tips on observing binary files in Solaris. The commands used are available since Solaris 8, so hopefully you&#8217;ll find these tricks useful.</p>
<p>Quite often it happens that the programs we run don&#8217;t work as they should, showing us errors like &#8220;referenced symbol not found&#8221; or this:</p>
<pre>ld.so.1: ./thunderbird-bin: fatal: libmozjs.so: open failed: No such file or directory</pre>
<p>So in order for us to find out what exact librabries are being used by a given binary, or where it expects these libraries to be found, and what libraries are not found at all, we have to take the following steps:</p>
<h3>1. Determine what libraries are needed</h3>
<p>First we have to see what libraries the ld linker is going to use for our file. For instance, this is how you would find our what libraries are used by the main executable of the Thunderbird mail client:</p>
<p><span id="more-10"></span></p>
<pre>solaris$ <strong>ldd thunderbird-bin
<span style="font-weight: normal;">libmozjs.so =&gt;   (file not found)
libgtk-x11-2.0.so.0 =&gt;   /usr/lib/libgtk-x11-2.0.so.0
libgdk-x11-2.0.so.0 =&gt;   /usr/lib/libgdk-x11-2.0.so.0
libatk-1.0.so.0 =&gt;       /usr/lib/libatk-1.0.so.0
libgdk_pixbuf-2.0.so.0 =&gt;        /usr/lib/libgdk_pixbuf-2.0.so.0
libm.so.2 =&gt;     /lib/libm.so.2
...</span></strong></pre>
<p>As always in my examples, the command output is abridged, but you get the idea. It&#8217;s clearly seen that one of the files &#8211; the <strong>libmozjs.so</strong> library &#8211; isn&#8217;t found. This means, there is no such file in either of the standard library paths or in the current working directory.</p>
<h3>2. Confirm where dynamic libraries are expected</h3>
<p>Now it&#8217;s about time we find our where the linker expects this <strong>libmozjs.so</strong> to be found. To do this, we&#8217;re going to use the <strong>truss</strong> command. All we&#8217;re interested in at this stage are the <strong>stat</strong> and <strong>open</strong> system calls: <strong>stat</strong> is used to verify whether some file exists, and <strong>open</strong> is used to open this file for the later access.</p>
<pre>bash-3.00$ <strong>truss -f -t stat,open ./thunderbird-bin
<span style="font-weight: normal;">13070:  stat("/export/soft/thunderbird/thunderbird-bin", 0xFFBFFAD0) = 0
13070:  open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
13070:  stat("/export/soft/thunderbird/libc.so.1", 0xFFBFF600) Err#2 ENOENT
13070:  stat("/export/soft/thunderbird/../libc.so.1", 0xFFBFF600) Err#2 ENOENT
13070:  stat("/usr/sfw/lib/libc.so.1", 0xFFBFF600)      Err#2 ENOENT
13070:  stat("/opt/sfw/lib/libc.so.1", 0xFFBFF600)      Err#2 ENOENT
13070:  stat("/usr/local/lib/libc.so.1", 0xFFBFF600)    Err#2 ENOENT
13070:  stat("/usr/openwin/lib/libc.so.1", 0xFFBFF600)  Err#2 ENOENT
13070:  stat("/lib/libc.so.1", 0xFFBFF600)              = 0
13070:  open("/lib/libc.so.1", O_RDONLY)                = 3
13070:  stat("/export/soft/thunderbird/libxpcom.so", 0xFFBFF418) = 0
13070:  open("/export/soft/thunderbird/libxpcom.so", O_RDONLY) = 3
13070:  stat("/export/soft/thunderbird/libmozjs.so", 0xFFBFF398) Err#2 ENOENT
13070:  stat("/export/soft/thunderbird/../libmozjs.so", 0xFFBFF398) Err#2 ENOENT
13070:  stat("/usr/sfw/lib/libmozjs.so", 0xFFBFF398)    Err#2 ENOENT
13070:  stat("/opt/sfw/lib/libmozjs.so", 0xFFBFF398)    Err#2 ENOENT
13070:  stat("/usr/local/lib/libmozjs.so", 0xFFBFF398)  Err#2 ENOENT
13070:  stat("/usr/openwin/lib/libmozjs.so", 0xFFBFF398) Err#2 ENOENT
13070:  stat("/lib/libmozjs.so", 0xFFBFF398)            Err#2 ENOENT
13070:  stat("/usr/lib/libmozjs.so", 0xFFBFF398)        Err#2 ENOENT
ld.so.1: ./thunderbird-bin: fatal: libmozjs.so: open failed: No such file or directory
13070:  stat("/export/soft/thunderbird/libgtk-x11-2.0.so.0", 0xFFBFF398) Err#2 ENOENT
...</span></strong></pre>
<p>From this output you can see very well how linker goes through one standard libraries directory to another in a cyclic search for ever library our binary needs. And for our <strong>libmozjs.so</strong> we can see that logically this library would be found in the current directory where I&#8217;m running the <strong>thunderbird-bin</strong> from, /export/soft/thunderbird. There is no such file there, simply because I&#8217;ve renamed it for this demo.</p>
<p>And this is how the same <strong>ldd</strong> command would look when all the files are in place:</p>
<pre>bash-3.00$ <strong>ldd thunderbird-bin
<span style="font-weight: normal;">libmozjs.so =&gt;   /export/soft/thunderbird/libmozjs.so
libgtk-x11-2.0.so.0 =&gt;   /usr/lib/libgtk-x11-2.0.so.0
libgdk-x11-2.0.so.0 =&gt;   /usr/lib/libgdk-x11-2.0.so.0
libatk-1.0.so.0 =&gt;       /usr/lib/libatk-1.0.so.0
libgdk_pixbuf-2.0.so.0 =&gt;        /usr/lib/libgdk_pixbuf-2.0.so.0
libm.so.2 =&gt;     /lib/libm.so.2
...</span></strong></pre>
<p>So you can be assured now that our library is found and loaded from the <strong>/export/soft/thunderbird/libmozjs.so</strong> location.</p>
<p>Thus, by using this simple yet very powerful combination of <strong>ldd</strong> and <strong>truss</strong> commands, you can stop guessing and find out exactly which libraries are loaded in a particular order and where they are loaded from.</p>
<h3>3. Resolve the referenced symbols errors</h3>
<p>For the &#8220;referenced symbol not found&#8221; errors, we have to take one more step. These errors happen mostly because the linker finds the library our binary needs, but this library somehow doesn&#8217;t have the functions we&#8217;re interested in. So, once we know the exact library file after following the steps 1 and 2 of this manual, it&#8217;s time for us to look at this particular file and see what functions are available. Many libraries have thousands of functions accessible, so it would make sense to use <strong>grep</strong> if you know the function you&#8217;re looking for.</p>
<p>For instance, the following command shows all the functions of the libgdk-x11-2.0 library, which have <strong>gdk_threads</strong> in their names:</p>
<pre>solaris$ <strong>nm /usr/lib/libgdk-x11-2.0.so.0 | grep gdk_threads
<span style="font-weight: normal;">[3632] | 86512| 68|FUNC |GLOB |0 |11 |gdk_threads_enter
[219] | 86648| 104|FUNC |LOCL |0 |11 |gdk_threads_impl_lock
[220] | 86752| 104|FUNC |LOCL |0 |11 |gdk_threads_impl_unlock
[4329] | 86856| 212|FUNC |GLOB |0 |11 |gdk_threads_init
[3507] | 86580| 68|FUNC |GLOB |0 |11 |gdk_threads_leave
[4095] | 532720| 4|OBJT |GLOB |0 |17 |gdk_threads_lock
[3579] | 532716| 4|OBJT |GLOB |0 |17 |gdk_threads_mutex
[4391] | 87068| 144|FUNC |GLOB |0 |11 |gdk_threads_set_lock_functions
[4443] | 532724| 4|OBJT |GLOB |0 |17 |gdk_threads_unlock</span></strong></pre>
<p>As you understand, if you get a &#8220;referenced symbol not found&#8221; error, this is quite often because an incorrect (incompatible) version of some library is used &#8211; it could be very old or just too new a version of the library, so the functions your binary is looking for are simply not there anymore or called differently.</p>
<p>Well, that&#8217;s all for today. If you have any additional info to add to this short manual, you&#8217;re very welcome to leave comments. I&#8217;ll be happy to hear your opinion.</p>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/how-to-using-truss-ldd-and-nm-to-observe-binary-files/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HOW-TO: X11 forwarding using ssh, putty and Xming</title>
		<link>http://solaris.reys.net/how-to-x11-forwarding-using-ssh-putty-and-xming/</link>
		<comments>http://solaris.reys.net/how-to-x11-forwarding-using-ssh-putty-and-xming/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:09:31 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Solaris How-To]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[x11]]></category>
		<category><![CDATA[xming]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=5</guid>
		<description><![CDATA[I&#8217;ve been using this combination on a daily basis for more than a year now, and I can&#8217;t stress enough how really useful it is. I use it both at home and at work, and everything is very easy and &#8211; most importantly &#8211; absolutely free. X11 forwarding with SSH X11 Forwarding with ssh is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using this combination on a daily basis for more than a year now, and I can&#8217;t stress enough how really useful it is. I use it both at home and at work, and everything is very easy and &#8211; most importantly &#8211; absolutely free.</p>
<h3>X11 forwarding with SSH</h3>
<p>X11 Forwarding with ssh is a wonderful feature which allows you get windows of a remotely started applications shown on your own desktop. For Windows, there are lots of pretty good albeit expensive products like Citrix, GoGlobal and XWin32, which allow you access your remote Unix desktop sessions. But in reality, if you don&#8217;t need any sessions but only want to remotely start an application and get a window from it on your desktop, you won&#8217;t need any of these expensive products &#8211; the easiest will be to use X11 forwarding and Xming.</p>
<p><span id="more-5"></span></p>
<h3>Xming</h3>
<p><a href="http://freedesktop.org/wiki/Xming">Xming</a> is an X Windows port for Microsoft Windows. Essentially it&#8217;s an X-server which starts transparently on top of your MS Windows desktop. It allows you to redirect graphical output of applications you run on remote Unix servers and therefore see these applications windows on your MS Windows desktop.</p>
<p>Xming is very simple and easy to use. All you have to do is download its distribution archive from the project&#8217;s page on SourceForge: <a href="http://sourceforge.net/projects/xming">XMing @ SourceForge</a>.</p>
<p>After you install it, I recommend you have a quickstart panel shortcut created for it, and have your command line altered to something like this:</p>
<pre>"C:Program FilesXmingXming.exe" :0 -clipboard -multiwindow</pre>
<h3>Configure SSHd for X11 forwarding</h3>
<p>Now that you have Xming installed, start it and it&#8217;s time to take care of the ssh side of things. We have to alter the ssh daemon config file: <strong>/etc/ssh/sshd_config</strong>. Just ensure that it has the following:</p>
<pre># X11 tunneling options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes</pre>
<p>If you already have similar parameters, don&#8217;t do anything. But if you had to change the config file, it&#8217;s time to restart ssh:</p>
<pre>solaris# svcadm restart svc:/network/ssh</pre>
<p>All that&#8217;s left now is to download the wonderful free Putty client, that is if you&#8217;re not using it yet. You can get it here:<br />
<a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/">Putty: a free telnet/ssh client</a>.</p>
<p>I won&#8217;t go into all the Putty configuration details, I&#8217;ll only mention that for X11 forwarding, you have to do the following: in the main configuration window of Putty (you get it when you start Putty), select Connection section, then SSH, then X11, and make sure you tick the Enable X11 Forwarding option.</p>
<p>That&#8217;s it, you&#8217;re good to go! Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/how-to-x11-forwarding-using-ssh-putty-and-xming/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

