Networking

Running JunOS Under VMWare (Updated – Again!)

Building a JunOS Olive in VMware. Install FreeBSD 4.11, swap out the checkpic binary so jinstall completes, and get past the VMware Server hang on SCSI disks.

Tony Mattke · 2009.10.04 · 5 min read

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.

text
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..

    Screen shot 2009-10-03 at 8.42.35 PM

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.

bash
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.

bash
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.

Screen shot 2009-10-03 at 8.47.23 PM

 

Update – 11/8/2009

VMware Server Users have had some issues with the secondary install (1st reboot after jinstall) hanging on the following line.
ad0: 32768MB <vmware Virtual IDE Hard Drive 00000001> at ata0-master UDMA33
The simple fix for this is to edit the appropriate VMware configuration file ( whatever.vmx ) and change the line that reads.

text
scsi0.present = "TRUE"

to

text
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….

text
console="comconsole"

to

text
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.

Related Posts

Networking · 1 min read

JunOS Olive Demonstration

2009.10.04

As a follow up to my JunOS Olive tutorial, I made a demonstration video that shows Multicast functioning via OSPF to another Olive and an ImageStream VM.

Comments

55 archived comments from Disqus 2009–2013
MrPaul
This is the most informative demonstration for Olive I’ve seen yet. Rock on!
shef
As I remember, multicast didn’t work properly in vmware -> no ldp/ospf/etc.
Tony
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…
Nacho

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.

Gil

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

Tony
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.
Gil

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

Ignacio
Actually the installation worked fine, that is what you should see after installing junos, you need to connect to the serial port and manage your router over the serial connection
Tony
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
Temi

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

Tony
I haven’t heard back from him yet regarding the questions I asked..
Gil

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.

Blackbird

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/F… 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!

Tony

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 !!

Gil

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.

BR-Juniper

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 !!!

Ricky
I use the exactly JunOS version as you, but freezes at “BTX Loader 1.0, BTX Version is 1.02” and have no clue about it, could you please provide a bit more details about your success story? Thx.
Jhon

Hello friends

Where i can get a JunOs image, can you provide to me a link to download it?

Tony
No, I do not supply illegal software downloads, please do not ask for them here.
GungaJim

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

Tony
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.. )
GungaJim

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….

Tony
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…
Doug

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

josele

same happened to me, piece of cake: that error is after the ftp/tftp transfer because you didnt use the ‘binary’ format so if you are using tftp:
1/ tftp server_IP 2/ binary 3/ get file_name

that’s it!

Matt

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.

Jay

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 ..

Fred
did you ever find where the pkgtools are?
Tony
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.
3double8

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!

steve

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?

sirsquishy

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.

gmonk
Sirsquishy.. Have you been able to run any type of multicast protocols such as PIM Sparse with your current setup on esxi
Nicolas

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 :)

Tony

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.

wmassgolfer

After trying to install Olive with a few different solutions this one worked like a charm the first time…and it was easy!

Thanks.

unkmonk
Excellent guide. Thanks. I found that you can let Junos boot for the first time and hang at “waiting for scsi devices to settle”. Make the change to the vmx file, and save. Then reset the VM.
Arun
This forum helped me a lot…at last after getting some tips here to disable scsi, I was able to get olive working :) Thanks a lot
j@y
Works like a charm - Junos 9.6 on FreeBSD 7.4 (Virtual Box). I am preparing for my JNCIA-JUNOS. This is my entry into Networking and I am thankful for this post that explains everything/
Jay
hey tony. i got 11.2R2.4 to run in both esx and vmware fusion. send me a DM on twitter for the completed tgz.
@bobmccouch
These instructions worked great for me too. I discovered after some frustration that Parallels VMs don’t seem to work with Junos, it never gets through the second install stage. But within Fusion, it worked right away using a Junos 10.1R1.8 Olive installer that I’d come across. Thanks!
gaurav sood

Hi ,

I was able to run JUNOS on VMware player.

The only problem is on JUNOS, i am not able to see any em0 interface, however, it was accessible when running BSD.

under .vmx file i have these following options

ethernet0.present = “TRUE”
ethernet0.connectionType = “bridged”
ethernet0.virtualDev = “e1000”
ethernet0.wakeOnPcktRcv = “FALSE”
ethernet0.addressType = “generated”

Any ideas?

Thanks, Gaurav Sood.

jahangir

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.

i am using junOS …jinstall-10.4R3.4-export-signed.tgz

bharat
VM “freezes” on “BTX loader 1.00 BTX version is 1.02”
routermaniac1

I was wondering if anyone can actually help me out with this. My laptop does not have a Intel Ethernet NIC card. Instead I have an onboard -
Realtek PCIe GBE Family Controller series card. I have tried reading several forums over and over to make sure, but each one recommends/states an INtel NIC card as a prerequisite. Is there any work around for this. Any help is deeply appreciated.

Thanks,

devinderk

My name is dev and i am facing following problem. :

=================== Bootstrap installer starting ===================
Initialized the environment
Routing engine model is Olive
No harddrive device found!
ERROR: recognize_model: Unable to discover hard drive
You are now in a debugging subshell (you may not see a prompt) …

Ls

anim dev mnt tmp
bin etc packagemnt usr
boot instrootmnt sbin var Please help me out. Thanks,

Nicolas
Worked flawlessly! Many thanks! Will try to emulate SRX with this now :)
Ernesto

Hi everyone! Please I could use your help, everything looks ok, even I dont get error messages when adding the pkg but..

After I reboot I get this:

ad3: 32768MB <VMware Virtual IDE Hard Drive 00000001> at ata1-slave UDMA33 Trying to mount root from cd9660:dev/md0

I already changed the
scsi0.present = “FALSE”

Any ideas?? Thnx

saphsaph
Thank you for this tutorial.
i ’ve installed the junos and updated it and everything works fine with me. but can you tell me the steps of how can i go to the internet through my juons ? when i setup the freebsd i create one ethernet adapter and give it an ip in the same LAN i use bridged adapter. it’s not working with me. it doesnt even see a gateway
Sujal
I am stuck at the ad3: 32768MB <VMware Virtual IDE Hard Drive 00000001> at ata1-slave UDMA33 problem. The vmx file does not contain the scsi0.present = “TRUE” line.. my config line is as follows : <?xml version=“1.0”?> <Foundry> <VM> <VMId type=“string”>52 ed 4a ad d4 69 51 f8-cd fc 03 cd 52 02 98 f0</VMId> <ClientMetaData> <clientMetaDataAttributes/> <HistoryEventList/></ClientMetaData> <vmxPathName type=“string”>Olive.vmx</vmxPathName></VM><tools-install-info><installError>5</installError><updateCounter>1</updateCounter></tools-install-info></Foundry>
James
Oh, you are a champion. That SCSI issue wasted probably 8 hours of my life. Thank you so much for that.
Eoghan
Cheers, this worked for me using jinstall-10.1R1.8-domestic-olive.tgz in virtualbox 4.2
Ronjue
I am not getting any em0/em1 interface in my freeBSD. what is the solution?
casperionx
While getting Junos working in VMware (using EM interfaces does have some draw backs, but for the most part it works), the harder part is actually getting it to work in GNS3. I put together a blog article detailing how to get them to talk together and have console support for the junos image as well.