Olive reloaded or how to emulate Juniper routers

October 29th, 2009 by Jeremy Grossmann Leave a reply »

« »

FreeBSD installation

Now that we have qemu installed, we can create the image for installing FreeBSD. Run this command to create it and allocate 4 GB:

qemu-img create -f qcow2 olive-base.img 4G

Launch Qemu to install FreeBSD on the image:

qemu -m 256 -hda olive-base.img -cdrom 4.11-RELEASE-i386-miniinst.iso \
-boot d -localtime

Qemu window will pop up (remember, by default press CTRL + ALT to release the cursor in Qemu):

freebsd_install_1

Skip Kernel configuration:

freebsd_install_2

Once Qemu has booted the FreeBSD installation image, you can select standard installation:

freebsd_install_3

When you see the FDISK Partition Editor, press A to allocate the entire disk for FreeBSD and then Q to confirm:

freebsd_install_4

Select “install a standard MBR” and when you see the FreeBSD Disklabel editor, press C to create the following partitions:

 ad0s1a /               1024M
 ad0s1b	swap            1024M
 ad0s1e	/config         12M
 ad0s1f	/var            rest

freebsd_install_5

Choose “User” distribution type and answer no for the question “Would you like to install the FreeBSD ports collection?”. Exit the menu and install from a FreeBSD CD/DVD:

freebsd_install_7

Wait until all the files are installed in your image:

freebsd_install_8

Once the files are copied, the installer program will ask you many user confirmation questions (Ethernet/SLIP config, gateway, inetd, FTP, NFS, security, console, linux compatibility, set time, etc). Just answer no for each of them. You will also be asked to enter a root password, just do and remember it. Now you should see the starting menu of the FreeBSD installer, exit by choosing X Exit Install. While FreeBSD CD is rebooting, quit Qemu by by pressing Ctrl-Alt-2, then type: quit.

133 comments

  1. HakimK says:

    I’ve followed all the instruction but after “qemu -m 256 -hda olive-base.img -boot c -localtime -nographic -serial stdio”, nothing happen. No qemu window appear and I only can see “stderr” and “stdout” files in the Qemu folder.

    stderr notepad shows:
    qemu: could not open serial device ‘mon:stdio’

    stdout notepad shows:
    Unable to open driver: stdio

    I’m trying to install olive in WinXP SP3 with qemu-0.11.0.patched.win32.

    did anyone have the same problem as me?

  2. Philip says:

    Hi,

    I always encounter this error (ELF Binary Type ’0′ Not Known). Do I missed something?

    Thanks

  3. Brad says:

    Everything went smoothly following the directions exactly a written, till I actually got to pkg_add.

    The VM complained about not enough space, saying I needed to change PKG_TMPDIR to a location that had at least 905682568 bytes. I cleaned out files I don’t need any more and made sure PKG_TMPDIR was pointing to /var/tmp. After clening out the files I had 1060060 K bytes free. So that should be enough. But kept getting same error.

  4. juber says:

    O tried to run scp [email protected]:~/Desktop/jinstall-8.5R1.14-domestic-signed.tgz /var/tmp command but request gets timed out.

    I put my PCs hostname instead of user, even i tried with the user i logged in with in my pc but still the request is getting timed out “ssh: connect to host 10.0.2.2 port 22: Operation time out”

    I wasted my 3 days to resolved this don’t know y its not working.

    I had put only “qemu -m 256 -hda olive-base.img -boot c -localtime ” command when booting olive image cause when i put “qemu -m 256 -hda olive-base.img -boot c -localtime \
    -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user” the qemu does’n start….

    Please help guys

  5. arvind says:

    hi while trying to upload Junos iam getting following error.

    scp [email protected]:xxxxx\jinstall \var\tmp
    ssh: connect to host 10.0.2.2 port 22: Operation timed out.

    I thought my antivirus firewall might be blocking the udp and tcp packets so disabled that and tried .. then also i was unsuccessful pl help here.

  6. Carlos M says:

    FTR, the pcap check in the patch is wrong.
    Compiler barfs at not caster int return and also,
    the $TMPC should be abefore the $LIBPCAP for the test compile to work.

  7. Max says:

    Does anyone running this on a MAC OS X 10.6 know the replacement option for “-cdrom” in the QEMU command:

    qemu -m 256 -hda olive-base.img -cdrom 4.11-RELEASE-i386-miniinst.iso \ -boot d -localtime

    /Volumes doesn’t work. Using the mount point doesn’t work. I had this working on 10.5, but remember -cdrom didn’t work.

    Any help is appreciated!

    Thanks!

  8. Aamir Maqbool says:

    Hi, I’ve installed the olive by following the above procedure. However I’m facing currently two problems.
    1. I configure the Juniper Router in GNS3 and commit changes bye using commit command. But it does not take effect. until unless I reload all the routers.
    2. I’m unable to find serial interfaces, ATM interfaces & Sonet interfaces.

    Can Anyone provide me the help regarding this.

  9. Cristian Vnd says:

    Resolved JUNOS image upload problem :
    My settings
    - tap-interface with DHCP : ip taken 10.0.2.16
    - Core FTP (mini-sftp-server) to upload your junos image (username=user,password=user)
    then
    sfttp [email protected]:jinstall-8.5R1.14-domestic-signed.tgz /var/tmp
    from your freebsd VM

  10. Ryan says:

    I’m not able to proceed with the following command:

    qemu R1.img -m 96 -nographic -daemonize -serial telnet::2001,server,nowait \
    -localtime -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user
    telnet localhost 2001

    It produces a stderr.txt file containing:

    qemu: invalid option — `-daemonize`

    If I remove this option, it produces another error:

    qemu: could not open monitor device `stdio`

    Anyone else having this same issue?

  11. neor says:

    Where do I put this command
    “qemu-img create -f qcow2 olive-base.img 4G”

  12. jomih says:

    Hi to all,
    I’ve tried to emulate JUNOS in GNS3 without success.
    When I use the command “qemu -m 256 -hda olive-base.img -boot c -localtime \ -net nic -net tap,ifname=tap0 -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user” (in Ubuntu 10.04) and after creating the tap interface with tunctl, I get the following message:
    can’t add tap0 to bridge wlan0: operation not supported
    I’ve tried to do it using the eth0 interface instead of wlan0, but I got the same results.
    can anyone tell me what’s wrong??
    Thanks!!

  13. josem says:

    hi,

    once olive is loaded, I configure an ip address for the en0 interface and do a commit but the check-out fails with this message:

    vci/vpi/allow-any-vci is required

    how is this possible if my interface is en0?

Leave a Reply