2011
Mar 24

Installing Olive 10.4R1 under VMware

It’s been a long time since I’ve taken a run at getting Olive up and working. I wanted to take another stab at it and document how to get a working Olive installation using the latest JUNOS code. I also wanted to document how to get Olive up inside VMware ESXi since I hadn’t actually done that before.

Update June 3 2011: Mention that it’s ESXi that I’m working with.

Overview

The installation breaks down into four major steps:

  1. Gather prerequisites
  2. Create virtual machine
  3. Install FreeBSD
  4. Install JUNOS

Prerequisites

I had these items on-hand before starting:

  • FreeBSD 4.11 mini-iso (I specifically needed 4.11; more on this below)
  • A copy of the jinstall 10.4R1 package (specifically, I used the M/MX/T series install package)
  • A working installation of ESXi 4.1u1

I will not share copies of any Juniper software so please don’t ask. You will need a valid Juniper support contract to download the jinstall bundle.

Create the Virtual Machine

The VM is pretty basic:

  • 1 vCPU
  • 512MB RAM
  • CD/DVD drive
    • Not needed for Olive, but needed to install FreeBSD
  • e1000 network adapter(s)
    • The e1000 adapter type causes VMware to present an Intel based chip to the VM which JUNOS is capable of using.
  • Hard drive
    • I used the default size of 8G which turns out to be more than enough. My final Olive install is sitting around 1G used.
  • Guest OS: FreeBSD 32-bit

Install FreeBSD

Through some experimentation and reading of the em(4) man page I found that FreeBSD 4.11 is the only 4.x release that supports the Intel 82545EM chipset. This is the chipset that is emulated by VMware (at least under ESXi 4.1) when choosing the e1000 network adapter type. If you install something older than 4.11 you will not have any network interfaces that are usable by Olive.

Once the VM was created I connected its CD/DVD drive to the FreeBSD ISO I downloaded and powered on the VM. I ran through the FreeBSD installation, choosing the “standard” installation. I told fdisk to use the entire disk (option A) and laid out my disklabels like so:

Part Mount Size
a / 1G
b swap 1G
e /config 12M
f /var 6G

The /var disklabel needs to be big enough to hold future software update bundles, core dumps, log files, etc. On my fresh install it’s sitting at just under 700M used. If the JUNOS installer doesn’t like your disk layout, it seems it’ll tweak it to meet its needs. It also doesn’t matter if you install FreeBSD on a UFS2 or softupdate-enabled disklabel as JUNOS will reformat it for UFS.

Finally, I chose the “user” distribution, waited for the files to copy and then said “no” to all of the questions the installer asks afterward (things like, install ports collection? enable NTP? setup the network? etc). After rebooting from the hard drive, I was ready to install JUNOS.

Installing JUNOS

Ok, as I wrote earlier, I downloaded the jinstall package from Juniper. This is basically a FreeBSD binary package that is installed with pkg_add(1). However, this package expects it’s being installed on true Juniper hardware so some of the checks it does during installation fail under generic FreeBSD.

The first error I got was:

sysctl: unknown oid ‘hw.re.model’
ERROR hw.re.name sysctl not supported.

This comes from the +INSTALL file because, as the first line in the error says, there is no hw.re.model sysctl oid in FreeBSD. I fixed this by uncompressing the jinstall-X-domestic-signed.tgz file and editing the +INSTALL file by replacing the sysctl line in the check_arch_compatibility() function with a line that assigns a dummy value to re_name.

Olive +INSTALL Script

Sadly, this same function needs fixing in two more locations both of which are inside the jinstall-X-domestic.tgz archive. It looks something like this:

  • jinstall-X-domestic-signed.tgz
    • +INSTALL — needs fixing here
    • jinstall-X-domestic.tgz
      • +INSTALL — needs fixing here
      • +REQUIRE — needs fixing here

Uncompress jinstall-X-domestic, edit +INSTALL and +REQUIRE and fix re_name. But before bundling it all back up, replace the well documented “checkpic” file which lives inside pkgtools.tgz which lives inside jinstall-X-domestic.tgz which lives inside jinstall-X-domestic-signed.tgz. Ugh! So the whole picture really looks like this:

  • jinstall-X-domestic-signed.tgz
    • +INSTALL — fix re_name
    • jinstall-X-domestic.tgz
      • +INSTALL — fix re_name
      • +REQUIRE — fix re_name
      • pkgtools.tgz
        • bin/checkpic — replace with /usr/bin/true

Once I made these changes, I was almost ready to bundle all the tgz files back up but first the signature and hash files needed to be removed from jinstall-X-domestic-signed.tgz because none of them will match up now that changes have been made inside the packages.

/var/tmp/jinstall# rm *.sig *.md5 *.sha1
/var/tmp/jinstall# tar zcf ../jinstall-X-olive.tgz *

The jinstall-X-olive.tgz package is now ready to install using pkg_add(1).

/var/tmp# pkg_add jinstall-X-olive.tgz

When the install is complete, reboot the system.

Results

During the reboot JUNOS will install itself and then automatically reboot the system again. It’ll then come up in JUNOS.

root> show version
Model: olive
JUNOS Base OS boot [10.4R1.9]
JUNOS Base OS Software Suite [10.4R1.9]
JUNOS Kernel Software Suite [10.4R1.9]
JUNOS Crypto Software Suite [10.4R1.9]
JUNOS Packet Forwarding Engine Support (M/T Common) [10.4R1.9]
JUNOS Packet Forwarding Engine Support (M20/M40) [10.4R1.9]
JUNOS Online Documentation [10.4R1.9]
JUNOS Voice Services Container package [10.4R1.9]
JUNOS Border Gateway Function package [10.4R1.9]
JUNOS Services AACL Container package [10.4R1.9]
JUNOS Services LL-PDF Container package [10.4R1.9]
JUNOS Services PTSP Container package [10.4R1.9]
JUNOS Services Stateful Firewall [10.4R1.9]
JUNOS Services NAT [10.4R1.9]
JUNOS Services Application Level Gateways [10.4R1.9]
JUNOS Services Captive Portal and Content Delivery Container package [10.4R1.9]
JUNOS Services RPM [10.4R1.9]
JUNOS AppId Services [10.4R1.9]
JUNOS IDP Services [10.4R1.9]
JUNOS Runtime Software Suite [10.4R1.9]
JUNOS Routing Software Suite [10.4R1.9]

14 Comments

  1. By orangepeelbeef on September 12, 2011 at 1:12pm MST |

    Tried this on 10.4R6.5 and ran into issues.

    followed your directions, then:
    pkg_add jinstall-10.4R6.5-domestic-olive.tgz
    Adding jinstall..
    /usr/bin/tar: This does not look like a tar archive
    /usr/bin/tar: Skipping to next header
    /usr/bin/tar: +CONTENTS not found in archive
    /usr/bin/tar: Error exit delayed from previous errors
    pkg_add: tar extract of /var/tmp/instmp.fl9hIO/jinstall_pkg failed
    pkg_Add: unable to extract table of contents file from /var/tmp/instmp.fl9hIO/jinstall_pkg – not a package?
    pkg_add: install script returned error status

    • By Joel Knight on September 12, 2011 at 8:32pm MST |

      You’re the second person recently to tell me that they had this issue. The other guy also happened to be using 10.4R6.5. What we discovered was that the original jinstall file that he downloaded from Juniper gave the same error when he tried to install it. This ruled out an error on his part when he was bundling up the tar files as per above. He reported that vanilla 10.4R4.5 did not give the same errors so he was going to try using that for Olive.

      I’m eager to try 10.4R6.5+ myself but I won’t have the free time for at least a few days.

      • By Wayne Tucker on October 23, 2011 at 11:34am MST |

        I ran into the same problem with 10.4R7.5. The older versions of the outer +INSTALL file (verified in 10.4R4.5) run pkg_add directly on the inner jinstall file. The newer versions (>=10.4R6.5) extract that archive into a directory named jinstall_pkg and run pkg_add against that directory.

        The pkg_add command (at least the one in FreeBSD 4.11) doesn’t like being run against a directory instead of a tarball, so it throws that error about not being able to find +CONTENTS.

        I’m looking into either hacking up the +INSTALL file or using a newer version of FreeBSD as the base (maybe a newer pkg_add command will like running against a directory).

        :w

        • By Wayne Tucker on October 23, 2011 at 12:39pm MST |

          Update: the outer +INSTALL file from 10.4R4.5 works with 10.4R7.5 if you replace all instances of 4.5 with 7.5.

          :w

        • By Joel Knight on October 23, 2011 at 1:08pm MST |

          Wow, nice find.

        • By aj on October 23, 2011 at 4:02pm MST |

          Great testing!!!.
          for 10.4R7.5 what are the names of the directories to use?, i.e.
          /var/tmp/jinstall_pkg and
          /var/tmp/jinstall_pkg/jinstall

          or /var/tmp/jinstall and
          /var/tmp/jinstall/jinstall_pkg

          we are pkg_add from /var/tmp ??? or from some other directory ?

          thanks
          P.S. I am having the same problems with 10.4R6.5 and 10.4R7.5

    • By Kovilpatti on January 3, 2012 at 12:26am MST |

      Wish you all a very Happy New Year 2012 !!!

      As a new year gift, do the below changes to get the installation of JunOS >=10.4R6.5 like 11.2R2.4 work :)

      Only the outer +INSTALL file need changes

      1. Comment the extractInner line

      # extractInner

      2. Comment and add like the following

      # pkg_add $PKG_FORCE $inner || fail=1
      pkg_add $PKG_FORCE jinstall-11.2R2.4-domestic.tgz || fail=1

      Now pack them and do the pkg_add and it should install successfully … :)

      • By Kovilpatti on January 3, 2012 at 12:29am MST |

        Still if you run in to any problem … try updating all the +CONTENTS with updated md5 checksums of the files, removing unneeded entries like .sig, .md5, .sha1

      • By Joel Knight on January 4, 2012 at 10:03pm MST |

        Kovilpatti, thanks for outlining the steps so clearly.

  2. By Michael on September 17, 2011 at 11:28am MST |

    on later vbox I’ve installed 10.4R7.5 without any problems with freebsd 4.11.

  3. By vb2k on October 30, 2011 at 8:16am MST |

    I followed the instructions above to create a new tar for 10.4R4.5. I get the following error while booting:

    md0: Preloaded image 7729152 bytes at 0xc0a7e288
    WATCHDOG_TIMER : Loss of soft watchdog
    panic:
    db_log_stack_trace_cmd(c094e900,c094e900,e04e3b28,e04e3b14,e04e3b14) at db_log_stack_trace_cmd+0×36
    ….

    I’m using ESXi 5.0.0 btw

    • By vb2k on October 31, 2011 at 2:28pm MST |

      Well I found out wat the problem was, don’t use a SCSI disk :p

  4. By Fipsorg on December 29, 2011 at 8:53am MST |

    I got the same issue with JunOS 11.4R1.14. Therefore, I took the +INSTALL files of JunOS 11.1R1.14 that was installing fine, I replaced the version numbers.

    And… victory 11.4R1.14 can be installed in VMWare (VMware player 4.0.1)

  5. By Charles on February 1, 2012 at 12:40pm MST |

    I am stymied at the pkg_add – it absolutely fails every time. I tried the modifications suggested here – no luck. Anyone else get a fix for this?