Interested in trying out JunOS? Can’t afford to build a real Juniper lab? Sounds like you need some Olives. No, we’re not talking about the green fruit commonly seen in a martini glasses across the nation. Olive is the codename name given to JunOS software running on something other than a Juniper router. It can either run on a PC of similar specifications to a Routing Engine, with no forwarding hardware (or PFE) attached, or inside a Virtual Machine (VM). If you took a Routing Engine out of a Juniper router and booted it in a blade server chassis, it would effectively be an Olive.
This guide is to help you run Olive inside vmware to create a virtual Juniper router lab. You can also extend your lab to dynamips (Cisco Emulation), or other router VMs that you may have. My screenshots will be from VMWare Fusion on Mac OS X, but should work perfectly well, possibly even better (since you’ll be able to setup multiple interfaces) on VMWare Server. At some point, I would like to test using VMWare ESXi as well.
As far as ESXi is concerned, this only works on 4.0 which requires x64 hardware. I’m out of luck and stuck running ESXi 3.5 for now.
Software
The first step is obtaining a copy of JunOS. I recommend using 9.4 (jinstall-9.4R1.8-export-signed.tgz) or higher as earlier versions had issues with multicast working properly under vmware. Do not ask for me for copies of JunOS Since JunOS runs top of FreeBSD, you will also need to download the FreeBSD 4.11 mini .iso from the FreeBSD FTP site.
Setting up your Virtual Machine
Our initial settings should be something along the lines of …
- Disk – IDE 4gb
- Memory – 512MB (you can reduce later to 128MB (or less ( untested ) ) )
- Interface – NAT or Shared ( up to you )
- CD/Optical – Point to the FreeBSD ISO
Installing FreeBSD 4.11
- Feel free to skip the custom kernel config
- Standard Install
- On fdsik screen select a (use entire disk) then q (finish)
- You can use the default FreeBSD boot manager
[singlepic id=194 w=100]
- In the BSD Disk Label Editor, use the following setup.
ad0s1a / 512M ad0s1b swap 1024M ad0s1e /config 12M ad0s1f /var the rest
- Next it will ask you which distribution set you wish to install. Go with User, and do not install the ports collection.
- On the next screen, choose CD as your media for install. It will then ask if you you’re sure you wish to proceed. Choose yes, unless you’re scared.
Post Install Config
After the install, you’ll be taken through some configuration options…
- Config Ethernet: Yes
- Select em0
- Config IPv6: No
- Config DHCP: Yes
- Network Gateway: No
- Config Inetd: No
- Config Anonymous FTP: No
- Config NFS Server: No
- Config NFS Client: No
- Select Default Security Profile: No
- Customize System Console: No
- Set Time Zone: Yes/NoIts really up to you if you want to do this…
- Enable Linux Binary Compatibility: No
- Non USB Mouse: No
- Browse Package Collection: No
- Add Accounts: Yes
- General Configuration Menu: No
- After the post install config, you will be taken back to the sysinstall Main Menu, go ahead and exit / reboot
- On the first boot, it may hang here for a moment, be patient..
Preparing and Installing JunOS
Ok, now that we have a working FreeBSD installation, we need to copy our jinstall image over using the account we created. Use ifconfig to figure out your DHCP address and scp the file over.. go ahead and put it in /var/tmp
In order to install JunOS, we have to circumvent some things.. Juniper has installed a binary in JunOS packages since version 7.4 called checkpic. This binary will fail during install and and interrupt the process. Extracting the package and replacing this binary with /usr/bin/true and repackaging fixes this issue.
cd /var/tmp mkdir jinst-signed cd jinst-signed tar zxvf ../jinstall-9.4R1.8-export-signed.tgz mkdir jinst cd jinst tar zxvf ../jinstall-9.4R1.8-export.tgz mkdir pkgtools cd pkgtools tar zxvf ../pkgtools.tgz cd bin cp /usr/bin/true ./checkpic cd .. tar zcvf ../pkgtools.tgz * cd .. rm -rf pkgtools tar zcfv /var/tmp/jinstall-9.4R1.8-export-olive.tgz *
Install your new modified jinstall package.
pkg_add -f /var/tmp/jinstall-9.4R1-8-export-olive.tgz
After it has finished, go ahead and issue a normal reboot command. Upon reboot, you may think the VM is hung, but its just fine. It is no longer outputting kernel messages to the screen, behind the scenes the JunOS install is completing and will reboot when finished. You will be able to login in a few minutes.

Update – 11/8/2009
VMware Server Users have had some issues with the secondary install (1st reboot after jinstall) hanging on the following line.
The simple fix for this is to edit the appropriate VMware configuration file ( whatever.vmx ) and change the line that reads.
scsi0.present = "TRUE"
to
scsi0.present = "FALSE"
Since JunOS has no support for SCSI devices, this prevents it from hanging when one is present. Many thanks to the commenters that suggested this fix.
Post Install
To tell the boot loader to send kernel messages to the video console is simple. Just edit the file /boot/loader.conf and change the line that reads….
console="comconsole"
to
console="vidconsole"
Conclusion
While this is far from a perfect solution ( at least under VMWare fusion.. ) It works quite well for getting your feet well in the JunOS environment. If you have any issues with getting this setup, feel free to comment below and I’ll try to point you in the right direction.
Also many thanks to everyone from the ineternetwork pro wiki, without their guide on qemu I would’ve been completely lost.



{ 33 comments… read them below or add one }
This is the most informative demonstration for Olive I’ve seen yet. Rock on!
As I remember, multicast didn't work properly in vmware -> no ldp/ospf/etc.
I was told it should work on 9.5, I only had 9.4 on hand and it works fine. I have a video demonstrating OSPF functionality here –> http://tony.mattke.net/2009/10/04/junos-olive-dem...
Hi tony,
First of all, nice tutorial. ;-). Did you try PIM or IPv6?… I think that isn't works. Al least in my olive.
Thanks again.
Hi Tony
I follow your guide and after the instalation, the VM "freezes" on "BTX loader 1.00 BTX version is 1.02" screen and don't start.
Have you any ideas about this problem?
Thanks
Well, it could be a few things. First off, its not going to output the kernel messages to the console when you reboot/during the install after the first reboot. So, unless you gave it enough time, it could of still been installing… Since that is mentioned in the guide, I'll assume its the second issue – The install will fail if it doesn't have enough memory. Thats why my guide recommends an inital config of 512MB of memory. You'll need to start over, or remove your virtual disks and increase the memory. After installing the jinstall file, but before rebooting follow the post install instructions for adding console="vidconsole" to /boot/loader.conf — this will get overwritten during the install process again (on first boot) but it'll at least show you whats going on. And if it does encounter an issue, you'll be able to give me some idea of what is going wrong.. When I first attempted this I had issues with having too little memory.
Hi Tony
In the current VM I used 256 MB of memory, so I deleted the VM and create another VM and this time I configured to 512 MB and before of reboot I insert the console="vidconsole" line on the loader.conf
After reboot, the kernel messages appeared, but freezes in the line below:
"ad0: 4096MB <VMware Virtual IDE Hard Drive 00000001> at ata0-master UDMA33"
I uplodaed the screenshot of VM, see the link below:
http://img35.imageshack.us/i/olive.jpg/
I searched in google for this issue, but I can't found.
Sorry for my bad english, I'm from Brazil.
Thanks
That is strange. Just a couple questions.. What version of jinstall are you using? and how long did you leave it there? I would reccomend checking out http://juniper.cluepon.net/index.php/Olive#Use_vi... — a friend on Freenode #cisco thinks it may be an issue with it not spawning an interactive tty
i have the same problem as the gy from Brazil it just freezes in the line
ad0: 32768MB <VMware Virtual IDE Hard Drive 00000001> at ata0-master UDMA33
Have you found any solution to this ?
Thanks
I haven't heard back from him yet regarding the questions I asked..
Hi Tony and everybody.
Sorry for my delay to reply your questions.
I used three versions of jinstall: jinstall-7.4R1.7, jinstall-9.3R2.8 and jinstall-9.4R1.8. They all did not work. I suspected that issue could be the scsi because when you create the VM (in 1.0.9 and 2.0.1 versions I tested), previously you are required to select BUS or LSI scsi and only after you can select the IDE disk type and as your tutorial say, scsi don't work.
I will try the Blackbird steps and inform about the tests.
Thanks everybody.
You need to make sure the scsi device is disabled. I had the same issue and it disappeared once I followed the following procedure.
http://www.certbible.org/howto-upgrade-your-vmwar...
Hi there Tony and all,
Thanks for this excellent tutorial on how to build an Olive. It has certainly helped me.
This post is for the benefit of Gil and Temi. I myself had an identical problem to you (it froze at the line:
ad0: 32768MB <VMware Virtual IDE Hard Drive 00000001> at ata0-master UDMA33).
After a lot of experimentation I found that when I edited the *.vmx file associated with the Olive, it contained:
scsi0.present = "TRUE"
so, when I closed the VM first and then replaced the line above with:
scsi0.present = "FALSE"
and then ran the VM, to my surprise it all worked !
Note that after the
ad0: 32768MB <VMware Virtual IDE Hard Drive 00000001> at ata0-master UDMA33)
line appears you will have to wait for a few minutes while the hard disk whirrs away and nothing appears to happen, but eventually it will reboot into the command prompt as described in Tony's article. I didn't need to use the post-install "console" config at all.
Instead of using the Free BSD 4.11 mini ISO, I used the latest version of free BSD 6 (namely 6.4). I downloaded the ISO of this from here: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/6.4/ using the top file in the list which is approx. 28MB. Then after installing, I used the initial FreeBSD config screen to automatically ftp to the FreeBSD server and install the other parts of the kernel (it's called something like 'installation of binaries and documentation for kernel developers'). This downloaded approx 50MB of additional files, before the extraction begun.
The reason I used a 6.4 kernel is because Junos 9.x is based on the 6.1 kernel, and I couldn't find a 6.1 anywhere.
Also the Juniper pages state that a compact flash of 1024MB should be used, so I used 1024MB for the VM memory setting.
I used Junos 9.0R1.10 for the install and it's all loaded and appears to work, though not tested multicast yet.
Good luck!
I had heard that 9.x was based on a newer FreeBSD version, I may attempt to use the this newer release when I finally get my VM Server finished. ( Had attmepted to use ESXi but you can't run IDE disks, nor can you run VMware Server under a VMware ESXi host… )
Thanks for this info Blackbird, I hope it really helps these guys out !!
Hi Tony and all.
I do the Blackbird steps and work it, it's exactly the scsi parameter that he mentioned.
Tony, I suggest you put on your tutorial this detail because others may have the same problem (my friend had the same problem).
Thank you all for your help and Tony congratulations for the excellent tutorial.
Hi all,
I sucefully installed version jinstall-9.6R1.13-export-signed.tgz !
I only configure the ip interface on a em0. I will be testing for know the multicast is working too.
Thanks from Brazil !!!
Hello friends
Where i can get a JunOs image, can you provide to me a link to download it?
No, I do not supply illegal software downloads, please do not ask for them here.
I've got the FreeBSD VM up and running. How do i now add the junos image to the cd /var/tmp directory and ftp it from there? Also i haven't been assigned an address to the em0 interface in my FreeBSD machine. Any help?
Gungajim.wordpress.com
I use scp to copy the JunOS image over… Do you have a DHCP server in your network ? ( how is your VM configured? Shared? Bridged? etc.. )
Cheers for that! I got my first olive up and running :)
Can you help me in trying to run multiple olives now? I've managed to assign the em0 interface, but how do i bridge the two together on mac without using Qemu? Do i still need a Serial interface or can i connect them via Ethernet?
Please help….
Well, the simplest thing to do would be to use Host Only as your network in Fusion. Obviously you could create multiple interfaces, leave one bridged, one Host Only, or whatever…
Thank you for this tutorial, we're planning to use Olive VMs to duplicate our network in a test environment.
We're gettng an error in FreeBSD when we tar zxvf the file. The error is: "gzip: stdin: invalid compressed data — format violated."
We're using jinstall-9.4R1.8-domestic-signed.tgz.
Anybody else having this issue?
Thanks in advance.
Doug
Tony,
Thanks for the tutorial. I followed it and was able to successfully install using jinstall-10.1R1.8-export-signed. My question centres around management access to the install. I cannot seem to ssh or http to the install – though IP connectivity is confirmed. Looks like ssh/webserver isn't installed as part of the FreeBSD. Is there a quick fix for this – or is it a case of reinstalling FreeBSD with missing modules first?
Ta.
I have one question
where do i get the pkgtools.
mkdir pkgtools
cd pkgtools
tar zxvf ../pkgtools.tgz
cd bin
cp /usr/bin/true ./checkpic
cd ..
did you ever find where the pkgtools are?
pkgtools.tgz is inside of the jinstall-9.4R1.8-export.tgz — We need to open each of these archives to replace the checkpic binary.. If you follow the directions all will work out.
Hi there Tony,
This is the best Olive (bring-to-life) setup yet!. I think I hit a brick wall here and my FreeBSD know-how is not up to par. I get this error somewhere
<WARNING: Failed while trying to install bootstrap loaders
Deleting bootstrap installer …
disklabel: bad pack magic number (label is damaged, or pack is unlabeled)>
right after running this last line
<pkg_add -f /var/tmp/jinstall-9.4R1-8-export-olive.tgz>
Please point out instances when this could occur. Do I have to do everything from scratch (FreeBSD install again)?
Thank you!
I have this running under fusion as well and everything seems to be fine under 9.6.
But I have encountered one odd thing. Has anyone noticed firewall filtering not working on the em<x> interfaces?
I can configure, and apply filters on any em interface I create but. It does not actually filter
and the output ends up displaying back "unknown" when you run a show interfaces filter.
It applies fine but does not filter and never actually shows the name on the interface outside of the configuration portion
Anyone seen this?
I have been running Olive for 2+ years now, and I finally got it working on ESXi 4.0.
1. Set the nics to e1000 ( you can have more then 3 in ESXi)
2. Set the HDD to IDE
3. Wait for Junos to reboot 2 times after doing the pkg_add on Freebsd
I use Freebsd 4.10 with junos up to 9.6, then i switch to Freebsd 7.x Enhanced services do work in the 9.6+ code (polices and all).
but you are still limited to the em0 interfaces, so no DHCP and what not.
Sirsquishy.. Have you been able to run any type of multicast protocols such as PIM Sparse with your current setup on esxi
Hi,
Thank you for the tuto, it was very useful !
I have just one issue with my keyboard.. How can I use my "azerty" keyboard on Junos ? I change the keymap value on the rc.conf file but nothing changes.. ANy idea ?
Thanks.
Nicolas, french guy :)
Hey Nicolas,
I hate to say it, but I'm not sure how to set that up exactly.. A good guy to talk to would be either nemith on #cisco.. (irc.freenode.net) he wrote the Olive page on the inetpro.org wiki.. I honestly haven't had too much of a chance to work on my olive lab.
{ 1 trackback }