How To Install Olive 12.1R1.9 With Qemu
Posted by Ahsan Tasneem | 3:37 AM | GNS3, Juniper, juniper olive, junOS, Linux, Qemu | 0 comments » The article describes installation of Junos 12.1R1.9 on emulated x86 hardware. Hardware is emulated by Qemu and Junos installed on it is known as Olive.
As Olive does not have Packet Forwarding Engine PFE attached, packet forwarding is exclusively depending on performance of the host CPU. In addition, they are also configurations known as not working on Olive. Considering these limits, Olive can never substitute real Juniper hardware.
In spite all of that Olive is an excellent tool for testing configurations that can be later deployed on real Juniper hardware. Thanks to GNS3 project that offers lightweight GUI for Qemu, complex labs can be easily deployed without real need of knowing Qemu commands.
My goal was to rewrite these articles for actual Junos 12.1R1.9 version and create a guide that helps you to install Junos. Please use links above if you feel that you need to clarify details or further explanation.
Prerequisites
a host system – any Linux installed on x86 with at least 2GB RAM and 5 GB HDD space dedicated for Qemu disk. Have in mind that you need to dedicate 512MB RAM for each Olive instance.
Qemu emulator installed on Linux
FreeBSD 4.11 installation CD – 4.11-RELEASE-i386-miniinst.iso
a copy of the jinstall 12.1R1.9 package (M/T series install package) – jinstall-12.1R1.9-domestic-signed.tgz
a guest system is FreeBSD distribution
an installation archive is a package jinstall-12.1R1.9-domestic-signed.tgz
Qemu disk or Qemu virtual machine is a file olive-base.img
2. Install FreeBSD
3. Install Junos
4. Install jweb GUI
We need to extract an installation archive and edit files inside archive in order to install Junos successfully. Due to the huge amount of time it would take on the guest, I suggest you to extract archive inside the host system. It is much faster than to do the same in FreeBSD. Then we can pack archive back and copy it to the guest.
{
#re_name=”`/sbin/sysctl -n hw.re.name 2>/dev/null`
re_name=”olive”
if [ -z "$re_name" ]; then
Error “hw.re.name sysctl not supported.”
fi
{
#re_name=”`/sbin/sysctl -n hw.re.name 2>/dev/null`
re_name=”olive”
if [ -z "$re_name" ]; then
Error “hw.re.name sysctl not supported.”
fi
cd ..
rm -rf pkgtools
-serial telnet:0.0.0.0:3000,server
Articles Sources:
http://brezular.wordpress.com
http://juniper.cluepon.net/index.php/Olive
As Olive does not have Packet Forwarding Engine PFE attached, packet forwarding is exclusively depending on performance of the host CPU. In addition, they are also configurations known as not working on Olive. Considering these limits, Olive can never substitute real Juniper hardware.
In spite all of that Olive is an excellent tool for testing configurations that can be later deployed on real Juniper hardware. Thanks to GNS3 project that offers lightweight GUI for Qemu, complex labs can be easily deployed without real need of knowing Qemu commands.
My goal was to rewrite these articles for actual Junos 12.1R1.9 version and create a guide that helps you to install Junos. Please use links above if you feel that you need to clarify details or further explanation.
Prerequisites
a host system – any Linux installed on x86 with at least 2GB RAM and 5 GB HDD space dedicated for Qemu disk. Have in mind that you need to dedicate 512MB RAM for each Olive instance.
Qemu emulator installed on Linux
FreeBSD 4.11 installation CD – 4.11-RELEASE-i386-miniinst.iso
a copy of the jinstall 12.1R1.9 package (M/T series install package) – jinstall-12.1R1.9-domestic-signed.tgz
Legend
a host system is your Linux distro, mine is Fedora Linuxa guest system is FreeBSD distribution
an installation archive is a package jinstall-12.1R1.9-domestic-signed.tgz
Qemu disk or Qemu virtual machine is a file olive-base.img
Installation Steps
1. Create Qemu Disk2. Install FreeBSD
3. Install Junos
4. Install jweb GUI
Create Qemu Disk
/usr/local/bin/qemu-img create -f qcow2 olive-base.img 16GInstall FreeBSD
/usr/local/bin/qemu-system-i386 -m 512 -hda olive-base.img -cdrom ./4.11-RELEASE-i386-miniinst.iso -enable-kvmThe command starts Qemu disk olive-base.img with 512MB RAM with attached FreeBSD image. Omit a parameter -enable-kvm if your hardware does not support hardware virtualization.
Steps:a) Select – Standard Installation
b) Create Disks PartitionsPress a – Use entire disk, q to confirm.
Select install a standard MBR and when you see the FreeBSD Disklabel editor, press c to create the following partitions:ad0s1a / 4096M
ad0s1b swap 4096M
ad0s1e /config 256M
ad0s1f /var rest
Press q to finish. Choose Minimal distribution type and install from a FreeBSD CD/DVD.ad0s1b swap 4096M
ad0s1e /config 256M
ad0s1f /var rest
Once files are copied, the installer program will ask you many questions. Just answer No for each of them. Set password for root account and exit. When FreeBSD start to reboot itself, close the Qemu window.
Install JunosWe need to extract an installation archive and edit files inside archive in order to install Junos successfully. Due to the huge amount of time it would take on the guest, I suggest you to extract archive inside the host system. It is much faster than to do the same in FreeBSD. Then we can pack archive back and copy it to the guest.
Here are the steps:
a) Copy true utility from FreeBSD to the hostCheckpic is binary that is stored in the installation archive. We have to replace this binary with utility /usr/bin/true located in FreeBSD. Start qemu disk and copy utility to the host.
Here is the command we will use:
/usr/local/bin/qemu-system-i386 -m 512 -boot c -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -hda olive-base.img -enable-kvm -net userHere is the command we will use:
The command tells Qemu to start Qemu disk with single network e1000 interface. After boot, configure network settings as following:
dhclient em0The command assigns an IP address 10.0.2.15/24 to the interface em0 and create a static route 0.0.0.0/0 to the default gateway 10.0.2.2. Do not panic if you are not familiar with those strange network settings – in fact, there is NAT connection between the guest and host system. You should be able to transfer file without any difficulties.
Use scp command for secure transfer. Copy true utility to your home directory. Let’s say that mine is /home/brezular/.scp -rv /usr/bin/true brezular@10.0.2.2:/home/brezular/
b) Resolve checkpic binary and hardware checkThis part consists of steps that extract archive file and modify files located inside it. After changes, archive will be repacked. Now, let’s say that a file jinstall-12.1R1.9 is stored in the host system in a directory /home/brezular/.
cd /home/brezular/mkdir ./jinst-signed
cd jinst-signed
tar zxvf ../jinstall-12.1R1.9-domestic-signed.tgz
Once archive is changed, checksum is not valid. Delete following files:cd jinst-signed
tar zxvf ../jinstall-12.1R1.9-domestic-signed.tgz
rm *.sig *.sha1 *.md5
During installation, hw.re.model will be checked. As it is not such a option supported in FreeBSD, we have to prevent to check this parameter. To avoid it, modify the file +INSTALL file and find function check_arch_compatibility(). Comment line starting with word re_name and assign a dummy value to re_name as it is shown below.vi ./+INSTALL
check_arch_compatibility(){
#re_name=”`/sbin/sysctl -n hw.re.name 2>/dev/null`
re_name=”olive”
if [ -z "$re_name" ]; then
Error “hw.re.name sysctl not supported.”
fi
mkdir ./jinst
cd jinst
tar zxvf ../jinstall-12.1R1.9-domestic.tgz
cd jinst
tar zxvf ../jinstall-12.1R1.9-domestic.tgz
Once again, modify +INSTALL file and assign a dummy value to re_name.
vi ./+INSTALLcheck_arch_compatibility()
{
#re_name=”`/sbin/sysctl -n hw.re.name 2>/dev/null`
re_name=”olive”
if [ -z "$re_name" ]; then
Error “hw.re.name sysctl not supported.”
fi
Now modify +REQUIRE file and assign a dummy value to re_name.{
#re_name=”`/sbin/sysctl -n hw.re.name 2>/dev/null`
re_name=”olive”
if [ -z "$re_name" ]; then
Error “hw.re.name sysctl not supported.”
fi
vi ./+REQUIRE
check_arch_compatibility(){
#re_name=”`/sbin/sysctl -n hw.re.name 2>/dev/null`
re_name=”olive”
if [ -z "$re_name" ]; then
Error “hw.re.name sysctl not supported.”
fi
mkdir ./pkgtools
cd pkgtools
tar zxvf ../pkgtools.tgz
cd ./bin
cp /home/brezular/true ./checkpic
cd ..
tar zcvf ../pkgtools.tgz *cd pkgtools
tar zxvf ../pkgtools.tgz
cd ./bin
cp /home/brezular/true ./checkpic
cd ..
cd ..
rm -rf pkgtools
tar zcfv /home/brezular/jinstall-12.1R1.9-domestic-olive.tgz *
At this point we have an installation file – jinstall-12.1R1.9-domestic-olive.tgz ready for installation in a home directory.c) Copy installation file and GUI file to the guest
In case you would like to manage Olive with GUI, copy an installation package jweb-12.1R1.9-signed.tgz to /home/brezular/. Then go back to the guest. Use following commands to copy an installation file and GUI file to the guest.scp -rv brezular@10.0.2.2:/home/brezular/jinstall-12.1R1.9-domestic-olive.tgz /var/tmp/
scp -rv brezular@10.0.2.2:/home/brezular/jweb-12.1R1.9-signed.tgz /var/tmp/d) Install Junos package
pkg_add -f /var/tmp/jinstall-12.1R1.9-domestic-olive.tgzOnce package is installed, halt FreeBSD and close the Qemu window.
haltStart Qemu and continue in installation with following command.
/usr/local/bin/qemu-system-i386 -m 1024M -boot c -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -hda olive-base.img -enable-kvm -net user-serial telnet:0.0.0.0:3000,server
During Junos installation, a temporary partition /tmp is allocated in RAM. If we only start Olive with 512MB RAM, installation hangs up. For this reason increasing RAM is required.
Also notice that like any other router, Juniper does not have VGA output and redirects output to the serial port. Thus we must tell Qemu to redirect a serial port to the telnet port.
Telnet to localhost and check an installation process.Also notice that like any other router, Juniper does not have VGA output and redirects output to the serial port. Thus we must tell Qemu to redirect a serial port to the telnet port.
telnet localhost 3000
When installation is finished, Olive automatically reboots. After boot we will be sitting in login prompt. Login as root without password.Install Jweb GUI
To get to Junos cli, type command cli. Package can be installed with following command.request system software add /var/tmp/jweb-12.1R1.9-signed.tgz
if you want to reduce size of Olive, remove installation files in directory /var/tmp/.rm /var/tmp/jinstall-12.1R1.9-domestic-olive.tgz
rm /var/tmp/jweb-12.1R1.9-signed.tgz
rm /var/tmp/jweb-12.1R1.9-signed.tgz
Articles Sources:
http://brezular.wordpress.com
http://juniper.cluepon.net/index.php/Olive
http://blog.gns3.net/2009/10/olive-juniper/
http://www.packetmischief.ca/2011/03/24/installing-olive-10-4r1-under-vmware/
http://www.packetmischief.ca/2011/03/24/installing-olive-10-4r1-under-vmware/
Subscribe to:
Post Comments (Atom)
0 comments
Post a Comment