Stuck on making Junos on qemu

sendalotsendalot Member Posts: 328
I'm stuck on making junos on qemu.

I have tried two approached but failed with both.

If I take (1) approach listed in GNS3 • View topic - How to create a Junos Image for use in GNS3 , after the step on entering "pkg_add -f /cdrom/jinstall-9.6R1.13-domestic-olive.tgz" the junos setup doesn't successfully finish. Error says something about the platform not being compatible.


If I take (2) approach listed in Making qemu JunOS router installing JunOS 10.1 OLIVE package inside of qemu FreeBSD under Win 7 64bit | NIL - Network Information Library , on step "sftp 10.0.2.2" I get error "connection closed by remote host: unsupported request 24"

Anyone got either approach to work?

Comments

  • DoubleNNsDoubleNNs Member Posts: 2,015 ■■■■■□□□□□
    I couldn't get Junos to work on qemu either. I DID get it to work on Virtualbox however.
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    Try these:

    For setting up an Olive:
    http://www.techexams.net/forums/juniper-certifications/81264-interested-setting-up-juniper-lab.html

    For setting up an Olive (briefly) and hooking it up to GNS3:
    http://www.techexams.net/forums/juniper-certifications/48873-junos-router-emulation-gns3-2.html

    I *might* be able to help you fix it doesn't work.
    (been a while)
  • sendalotsendalot Member Posts: 328
    ccnxjr wrote: »
    Try these:

    For setting up an Olive:
    http://www.techexams.net/forums/juniper-certifications/81264-interested-setting-up-juniper-lab.html

    For setting up an Olive (briefly) and hooking it up to GNS3:
    http://www.techexams.net/forums/juniper-certifications/48873-junos-router-emulation-gns3-2.html

    I *might* be able to help you fix it doesn't work.
    (been a while)

    Thank you so, I basically got upto setting up qemu FreeBSD machine.
    I also have support contract with Juniper, so I have latest images. But how do you make them into forms qemu accepts?
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    I've then stuck this image into an ISO called junos_12-1.iso, which is how I pass this along to the qemu image.
    Use something like PowerISO, to do it, you cant just change the extension from ".tgz" to ".iso"
    :
    qemu -m 1024 -net nic,model=e1000 -hda olive-12a.img -cdrom junos_12-1.iso -net user
    

    the "-cdrom junos_12-1.iso" tells qemu to make an imaginary CDROM with "junos_12-1.iso" inside.

    Once FreeBSD starts, you'll have to "mount" the CDROM using this command:
    mount /cdrom
    

    I've outlined the rest here:

    http://www.techexams.net/forums/juniper-certifications/81264-interested-setting-up-juniper-lab.html

    It really is a lot of reading, however I'll try to clarify the steps if your stuck.
  • sendalotsendalot Member Posts: 328
    No i mean how do you convert the tgz file into iso that qemu accepts as a cdrom mount? From the original downloaded junos file. The one you wrote looks similar to what ive been trying.Thank you again!
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    Oh, you'll need some software like PowerISO (if your using Windows)

    Create ISO File
  • pevangelpevangel Member Posts: 342
    Why not vSRX? I use Olives on GNS3 and they take a million years to fully boot up.
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    I had no idea this existed!
    How to run Juniper Firefly Perimeter vSRX on GNS3 | Brezular's Blog

    Is it truly free? !
    ie. no license key required?
  • sendalotsendalot Member Posts: 328
    Will try later. But for the junos for qemu, is there a version limitation? As in, do newest junos versions have less chance to work on qemu?
    Or is the latest FreeBSD more compatible with latest Junos?
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    I haven't gotten it to work on FreeBSD 9, so stick with 7 if you can.
    Some issue with the partition labels or something along those lines.

    My last attempt was with JunOS 12, since then I've just cloned from a master qemu image.
  • pevangelpevangel Member Posts: 342
    I have junos version 10.x and it works fine on qemu. My coworkers were able to get 12.x running but they couldn't pass traffic.
  • sendalotsendalot Member Posts: 328
    I'm trying from scratch with FreeBSD 7.4 How do you do specific mount points or tag at step

    Or a Standard install
    At the boot partition screen, allocate the entire disc.
    Use the Standard boot loader.
    At the boot label editor create the following
    1024 M File System ----> mount point /
    1024 M Swap
    16 M File System ----> mount point /dummy
    1024 M File System ----> mount point /config
    everything else File System ----> mount point /var
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    When you're in the initial FDisk screen, press "a" to allocate the entire disk to a partition, then "q" to finish.



    After that part you'll be prompted to select a boot manager, choose "Standard", as opposed to the default "BootMgr"



    The following screen you will then be in the label editor menu.
    Press "C" to create a label.
    You will then be prompted for size, type(FS or Swap) and mount point.




    Here's what the end result should look like:

  • sendalotsendalot Member Posts: 328
    Thank you for your time in these screenshots. After doing those portioning and install, qemu is still asking to be booted from a bootable disc. How do you write into the hdd?

    Did you do all this within Windows?
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    Yes, it's all within Windows (Windows XP specifically)
    Ahh, the tricky part!
    and I haven't figured out a graceful way of doing this...
    There's probably some command flag to say "try the HDD first and if nothing's there then check the CDROM".

    However, if you used this command to start the qemu image
    [COLOR=#174169]qemu -m 1024 -hda olive-12a.img -cdrom FreeBSD-7.4-RELEASE-i386-dvd1.iso -boot d -localtime[/COLOR]
    

    Then it still thinks that the FreeBSD install disk is in the image.
    If you forcefully shut it down and omit the
    [COLOR=#174169]-cdrom FreeBSD-7.4-RELEASE-i386-dvd1.iso [/COLOR]
    
    part on the next startup, you've "removed" the CDROM entirely

    I "hard" kill the qemu image then use this line to start it up again:
    [COLOR=#174169]qemu -m 1024 -hda olive-12a.img  -boot d -localtime[/COLOR]
    

    Now, pay attention,
    [COLOR=#174169]-cdrom FreeBSD-7.4-RELEASE-i386-dvd1.iso [/COLOR]
    
    is a command line option to start qemu
    the "-cdrom " part tells it , there is a cdrom, the "FreeBSD-7.4-RELEASE-i386-dvd1.iso " part, is what's in the CDROM.
    Knowing this, you can potentially then swap the "
    FreeBSD-7.4-RELEASE-i386-dvd1.iso " for some other ISO you want to pass to the virtual machine.

    Makes sense?

  • sendalotsendalot Member Posts: 328
    So after the install, reboot and shut it down? Then boot without the FreeBSD iso?
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    That is correct.
    After the install boot without the FreeBSD iso.
  • sendalotsendalot Member Posts: 328
    Half way, getting "Error mounting /mnt/dv/X on /mnt/var: No such file or directory"
    wow this is a pain.
    I'm about to just let go of running Junos on qemu.
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    This is during the FreeBSD startup or during the install of JunOS?
  • sendalotsendalot Member Posts: 328
    During FreeBSD startup/installation. (I sent you a message by the way).
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    PM-ed you my contact.
    It really is a bit of a challenge.
    Took me an entire weekend to hack through it.
    And it is finiky.

    I'd suggest take a day or two to get familiar with qemu itself before diving in.
    Maybe try building an Olive inside a Virtual box instance first, just to get familiar with the steps.

    Once you get FreeBSD installed editing the JunOS image is a delicate process, using "vi" inside a qemu window is almost like performing surgery!
  • DoubleNNsDoubleNNs Member Posts: 2,015 ■■■■■□□□□□
    ccnxjr wrote: »
    Maybe try building an Olive inside a Virtual box instance first, just to get familiar with the steps.

    What are the benefits of using qemu instead of Virtualbox for the Olive?
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    Personally, I have my Olive's inside a headless server, and I'm already familiar with using Virsh to manage my VM's.
    And qemu images work natively with Virsh.

    So to the VirtualBox point, I'd say it's more about using a Virtual Machine manager that you're comfortable with, more than anything else.
    Navigating the layers of directories and finding the right file to edit is tricky enough, compounded trying to figure out a new virtual machine manager could cause lots of frustration.
    So, yeah if you're new to building an Olive, just know that you can use whatever virtual machine manager you like.
    VirtualBox/Qemu, whatevers.
Sign In or Register to comment.