Vnx-rootfsolive
How to create a KVM Olive (Juniper router) root-file-system for VNX
The procedure described here is mainly based on the excellent information provided in the following GNS3 blog entry: Olive reloaded or how to emulate Juniper routers. It has been tested over an Ubuntu 10.04.1 LTS machine.
Steps:
- Create the base root filesystem image (use 7G instead of 4G):
qemu-img create -f qcow2 vnx_rootfs_olive.qcow2 7G
wget ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/ISO-IMAGES/4.11/4.11-RELEASE-i386-miniinst.iso
kvm -m 256 -hda vnx_rootfs_olive.qcow2 -cdrom 4.11-RELEASE-i386-miniinst.iso -boot d -localtime
and make the FreeBSD installation following the exact steps described in GNS3 blog.
kvm -m 1024 -hda vnx_rootfs_olive.qcow2 -boot c -localtime -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user
dhclient em0
wget ... jinstall-9.5R1.8-domestic-signed.tgz
scp 10.0.2.2:/path-to/jinstall-9.5R1.8-domestic-signed.tgz /var/tmp
cd /var/tmp mkdir jinst-signed cd jinst-signed/ tar zxvf ../jinstall-9.5R1.8-domestic-signed.tgz mkdir jinst cd jinst tar zfvx ../jinstall-9.5R1.8-domestic.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.5R1.8-domestic-olive.tgz * cd /var/tmp rm -rf jinstall-9.5R1.8-domestic-signed.tgz jinst-signed
Note: you don't need to sign the package before rebuilding it as described in Olive's blogs.
pkg_add -f jinstall-9.5R1.8-domestic-olive.tgz
kvm -bios bios-0.10.6.bin -m 1024 -hda vnx_rootfs_olive.qcow2 -boot c -localtime -nodefaults -nographic -serial stdio
Note: as stated in a comment to "Olive reloaded" blog entry mentioned above, Olive virtual machines do not work with the latest BIOS distributed with qemu-kvm package. To make it work, you have to download the BIOS from qemu 0.10.6 version and copy it to /usr/share/qemu/ directory:
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz tar xfvz qemu-kvm-0.10.6.tar.gz cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin
- Start the virtual machine with:
kvm -bios bios-0.10.6.bin -m 1024 -hda vnx_rootfs_olive.qcow2 -boot c -localtime -nodefaults -nographic -serial stdio -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user
ifconfig em0 inet 10.0.2.10/24 ping 10.0.2.2
scp 10.0.2.2:/usr/share/vnx/aced/vnx-aced-olive-0.1b.tgz /var/tmp
cd /var/tmp tar xfvz vnx-aced-olive-0.1b.tgz cd vnx-ace-olive-0.1b sh install-vnxolived
rm -rf /var/tmp/*
cli config set system root-authentication plain-text-password commit
Updating ACE daemon
To update the autoconfiguration and command execution daemon (ACED):
- Start the virtual machine with:
virsh create rootfs_olive.xml
References
- Olive reloaded or how to emulate Juniper routers. http://blog.gns3.net/2009/10/olive-juniper/2/
- Virtualizing JunOS on VMware. http://pauldotcom.com/2011/05/virtualizing-junos-on-vmware.html
- Preparing VirtualBox and FreeBSD for Juniper Olive. http://sleepyrich.blogspot.com/2010/03/preparing-virtualbox-and-freebsd-for.html