{"id":2103,"date":"2013-08-10T15:23:08","date_gmt":"2013-08-10T19:23:08","guid":{"rendered":"http:\/\/www.braindeadprojects.com\/blog\/?p=2103"},"modified":"2013-08-10T21:07:09","modified_gmt":"2013-08-11T01:07:09","slug":"growing-an-olive-router-in-a-virtualbox-environment","status":"publish","type":"post","link":"http:\/\/www.braindeadprojects.com\/blog\/what\/growing-an-olive-router-in-a-virtualbox-environment\/","title":{"rendered":"Growing An Olive Router in a VirtualBox Environment"},"content":{"rendered":"<p>In the last few days, I&#8217;ve been working to build up my home networking lab. I&#8217;m using a fairly typical setup nowadays &#8212; <a title=\"Layer 3 Switch Lab\" href=\"http:\/\/www.braindeadprojects.com\/img\/Switch%20Lab\/switch-rack.png\" target=\"_blank\">real Layer 3 switches<\/a> connected to a host machine that runs <a title=\"GNS3\" href=\"http:\/\/www.gns3.net\/\" target=\"_blank\">GNS3<\/a> as well as <a title=\"VirtualBox\" href=\"https:\/\/www.virtualbox.org\/\" target=\"_blank\">VirtualBox<\/a>. Having recently installed <a title=\"Vyatta\" href=\"http:\/\/www.vyatta.org\/\" target=\"_blank\">Vyatta<\/a> and <a title=\"Mikrotik\" href=\"http:\/\/www.mikrotik.com\/\" target=\"_blank\">Mikrotik RouterOS <\/a>VM guests, I decided that I would play with something I&#8217;ve never touched before &#8212; <a title=\"Jupiter Networks\" href=\"http:\/\/www.juniper.net\/us\/en\/\" target=\"_blank\">Juniper&#8217;s JunOS<\/a>.<\/p>\n<p><a href=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/juniper-networks-blue-png.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2116\" alt=\"JuniperNetworks\" src=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/juniper-networks-blue-png-300x100.png\" width=\"300\" height=\"100\" srcset=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/juniper-networks-blue-png-300x100.png 300w, http:\/\/www.braindeadprojects.com\/blog\/wp-content\/juniper-networks-blue-png-1024x341.png 1024w, http:\/\/www.braindeadprojects.com\/blog\/wp-content\/juniper-networks-blue-png.png 1800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The documentation for how to install JunOS into a Qemu environment is constantly replicated across the web, so I have no intention of doing so here. (Have a look <a title=\"Juniper installation on GNS3\" href=\"http:\/\/blog.gns3.net\/2009\/10\/olive-juniper\/\" target=\"_blank\">here<\/a> to get yourself started). In my first few attempts to create a VM guest, I followed the instructions thoroughly, but eventually I opted to move the full creation into VirtualBox. That&#8217;s when I learned a lot about the nuances between installing on either platform.<\/p>\n<p>One of the first problems I encountered when trying to install into a VirtualBox container was an odd out-of-space message when installing my modified version of JunOS 8.5R1.14 :<\/p>\n<blockquote><p>WARNING: The \/tmp filesystem that is created by the next stage of<br \/>\nWARNING: the installer does not have sufficient space. This package<br \/>\nWARNING: requires 159804k free (2k for configuration<br \/>\nWARNING: files and 159802k for the new software), but there is<br \/>\nWARNING: only -12140k available.<\/p><\/blockquote>\n<p>What makes this message odd is that I have plenty of disk space. It&#8217;s also odd that I only encountered this in my VirtualBox\/vdi installations, not on Qemu\/qcow2 installations. Before I dug any further, I rebuilt the VM using 10G of storage instead of the recommended 4G, and adjusted each of the individual partitions accordingly. This proved to be ineffective as I was once again greeted with this message.<\/p>\n<p>The warning message is generated by the function &#8220;tmp_storage()&#8221; in the +REQUEST file inside\u00a0jinstall-8.5R1.14-domestic.tgz. One of the expr calls is failing, but I never bothered to dig into why and instead removed it with a quick <a title=\"Patch to tmp_storage\" href=\"http:\/\/www.braindeadprojects.com\/src\/VirtualBox.jinstall-8.5R1.14-domestic.tgz.tmp_storage.patch\" target=\"_blank\">patch<\/a>. The bootstrap installation now appears to be good and will prompt you to reboot.<\/p>\n<p>At this point, ensure that you have serial port 1 redirected to a host pipe. If you don&#8217;t, shut down the VM and add one &#8212; you will need it to see what&#8217;s going on.<\/p>\n<figure id=\"attachment_2124\" aria-describedby=\"caption-attachment-2124\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/VBox_serial.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2124\" alt=\"Serial Port\" src=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/VBox_serial-300x229.png\" width=\"300\" height=\"229\" srcset=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/VBox_serial-300x229.png 300w, http:\/\/www.braindeadprojects.com\/blog\/wp-content\/VBox_serial.png 657w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2124\" class=\"wp-caption-text\">No need for a fancy schmancy DB9 connector<\/figcaption><\/figure>\n<p>You can attach to the host pipe a few different ways, I prefer to have <a title=\"Swiss Army Knife of Networking\" href=\"http:\/\/www.dest-unreach.org\/socat\/\" target=\"_blank\">socat<\/a> connect to it and create a \/tmp\/juniper0 PTY that I can hook into from minicom. Do keep in mind that socat doesn&#8217;t respawn automatically, so if you disconnect from the PTY link you may have to restart socat.<\/p>\n<blockquote><p>socat UNIX-CONNECT:\/tmp\/juniper_serial PTY,link=\/tmp\/juniper0,raw,echo=0,waitslave<\/p><\/blockquote>\n<p>Upon reboot,\u00a0 the system would now install up to a point and then hang. After a few moments it was obvious <span style=\"text-decoration: underline;\"><em><strong>something<\/strong><\/em><\/span> didn&#8217;t give.<\/p>\n<p>A few reboots later I realized that this was going nowhere. Since my test build in Qemu alone\u00a0<em><strong><span style=\"text-decoration: underline;\">did<\/span><\/strong><\/em> install, I opted to simply convert the qcow2 file to something I could <a title=\"Importing tricks\" href=\"http:\/\/en.wikibooks.org\/wiki\/QEMU\/Images \" target=\"_blank\">import into VirtualBox<\/a>.<\/p>\n<blockquote><p>qemu-img convert -O raw ~\/GNS3\/QEMU\/olive-base.img JuniperBase.raw<\/p>\n<p>VBoxManage convertdd JuniperBase.raw JuniperBase.vdi<\/p>\n<p>VBoxManage modifyvdi JuniperBase.vdi compact<\/p><\/blockquote>\n<p>However this caused an interesting bug: Prior to installing JunOS, packet captures on the guest indicated that OSPF all-router multicast messages were entering the guest VM. After installation, that was no longer the case. I tried numerous times to resolve this, but with no luck.<\/p>\n<p>Finally I opted to build a 4.11 FreeBSD instance and install Junos 9.6R1.13. My first attempt failed with the following message:<\/p>\n<blockquote><p>ELF binary type &#8220;0&#8221; not known<\/p><\/blockquote>\n<p>If you see this message, make sure that you&#8217;ve <a title=\"Elf warning message\" href=\"http:\/\/juniper.cluepon.net\/index.php\/Olive#Issues_with_JunOS_post_release_7.4\" target=\"_blank\">properly replaced checkpic with \/usr\/bin\/true. <\/a>In my case, I had accidentally just copied true to the directory and didn&#8217;t replace checkpic. After fixing my mistake, the bootstrap installation succeeded and prompted me for a reboot.<\/p>\n<p>After reboot the full install commences. I was quite surprised when it completed without any problems. I was skeptical that this was going to fix the multicast problem, but lo and behold, post reboot multicast actually functions.<\/p>\n<figure id=\"attachment_2114\" aria-describedby=\"caption-attachment-2114\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_WORKING.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2114\" alt=\"OSPF Image\" src=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_WORKING-300x236.png\" width=\"300\" height=\"236\" srcset=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_WORKING-300x236.png 300w, http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_WORKING-1024x805.png 1024w, http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_WORKING.png 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2114\" class=\"wp-caption-text\">Low and behold &#8211; it works!<\/figcaption><\/figure>\n<p>So in the end, my working VirtualBox JunOS instance consisted of FreeBSD 4.11, JunOS 9.6R1.13 and VirtualBox 4.2.12 r84980.<\/p>\n<figure id=\"attachment_2133\" aria-describedby=\"caption-attachment-2133\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_Neighbor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2133\" alt=\"Olive Pudding\" src=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_Neighbor-300x194.png\" width=\"300\" height=\"194\" srcset=\"http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_Neighbor-300x194.png 300w, http:\/\/www.braindeadprojects.com\/blog\/wp-content\/OSPF_Neighbor.png 722w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2133\" class=\"wp-caption-text\">Proof is in the Olive pudding.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In the last few days, I&#8217;ve been working to build up my home networking lab. I&#8217;m using a fairly typical setup nowadays &#8212; real Layer 3 switches connected to a host machine that runs GNS3 as well as VirtualBox. Having recently installed Vyatta and Mikrotik RouterOS VM guests, I decided that I would play with &hellip; <a href=\"http:\/\/www.braindeadprojects.com\/blog\/what\/growing-an-olive-router-in-a-virtualbox-environment\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Growing An Olive Router in a VirtualBox Environment<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,39,28,1],"tags":[],"class_list":["post-2103","post","type-post","status-publish","format-standard","hentry","category-gns3","category-juniper","category-virtualization","category-what"],"_links":{"self":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/2103"}],"collection":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/comments?post=2103"}],"version-history":[{"count":24,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/2103\/revisions"}],"predecessor-version":[{"id":2134,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/2103\/revisions\/2134"}],"wp:attachment":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/media?parent=2103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/categories?post=2103"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/tags?post=2103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}