4 Replies Latest reply: Dec 20, 2010 7:24 AM by 825110 RSS

    Solaris 10 Whole Root Zones Missing Files

    825110
      I am new to solaris so please correct me if I am wrong.

      I created whole root zones and from what I've read this is suppose to copy all the files and applications from the global zone. Below is my zone configuration:

      create -b
      set zonepath=/zonefiles/lstu-t2
      set autoboot=true
      set ip-type=shared
      add net
      set address=x.x.x.x
      set physical=nxge0
      end
      add dedicated-cpu
      set ncpus=1-4
      end
      add capped-memory
      set physical=7.8G
      end

      It is not shown here but per the oracle documentation I ran the following commands to configure a whole root zone during zone configuration:

      remove inherit-pkg-dir dir=/lib
      remove inherit-pkg-dir dir=/platform
      remove inherit-pkg-dir dir=/sbin
      remove inherit-pkg-dir dir=/usr

      Now that you have my configuration; my question is do I have to manually install c compilers and other appliations that are located in the /opt/SUNW* directories on my global zone, in my whole root zones?

      The only directories my whole root zone has in /opt is SUNWits, SUNWmlib, SUNWrtvc and staroffice8. I was trying to install sudo on one of my zones and it said I needed a c compiler which is located in /opt/SUNWspro on my host machine (global zone).

      Is there a way to configure the zone to copy all of these directories plus the symlinks mostly located in /usr/bin/ or do I have to manually reinstall this software in all my zones?

      For example the c compiler: lrwxrwxrwx 1 root root 20 Nov 17 2009 /usr/bin/cc -> /opt/SUNWspro/bin/cc

      Thanks for your help.
        • 1. Re: Solaris 10 Whole Root Zones Missing Files
          j.m.krueger
          You don't need to issue the "remove inherit-pkg-dir" commands if you use the create -b statement in your zone configuration.
          If you use -b the blank zone-template is used.
          /opt should be part of the whole-root configuration, but there may be packages that are not zone aware or are global zone only. I can't check at the moment if this is true for SUN Studio.
          You could either install SUN Studio in the zone or you could use the "add fs" statements in your zone configuration to share /opt/SUNWspro with the zone.
          Basically you can edit your zone configuration with zonecfg -z $ZONENAME.
          use the commands
          add fs
          set fs=/dir/in/zone
          set special=/dir/in/globalzone
          set type=lofs
          end
          commit
          exit

          If you want to protect the directory in the global zone you can use the "set options [ro]" statement to make the directory read-only in the whole root zone.

          Avoid linking into the zone from the global zone. It's a Bad Thing™ todo.
          • 2. Re: Solaris 10 Whole Root Zones Missing Files
            825110
            Thanks for your reply,

            This is great news for me but I do have two other questions.

            1. You suggested not to link to the global zone lofs directories. I'm assuming the only other alternative is to copy the directory in my root zone, point any application I install to the directory for required binaries or add the directory in my path variable. Why wouldn't you suggest linking besides broken links if the binary is removed?
            2. Instead of using lofs do you think it would be better to use the package database to distribute wanted packages to the zones?

            Thanks for all your help and insight.
            • 3. Re: Solaris 10 Whole Root Zones Missing Files
              j.m.krueger
              822107 wrote:
              1. You suggested not to link to the global zone lofs directories. I'm assuming the only other alternative is to copy the directory in my root zone, point any application I install to the directory for required binaries or add the directory in my path variable. Why wouldn't you suggest linking besides broken links if the binary is removed?
              No, you can use the lofs mechanism that is provided with the zones when using the add fs commands. That would share say /opt/SUNWspro in the global zone with the zone.
              That would not give you the symlinks in /usr of course. You will have to manually add them.

              If you want a clean install, grab the latest SUN Studio Compiler an install it into the zone.
              • 4. Re: Solaris 10 Whole Root Zones Missing Files
                825110
                Thanks for your help.