{"id":681,"date":"2022-11-13T02:47:26","date_gmt":"2022-11-13T02:47:26","guid":{"rendered":"http:\/\/blog.ignoranthack.me\/?p=681"},"modified":"2022-11-13T02:47:27","modified_gmt":"2022-11-13T02:47:27","slug":"stashing-linux-away-for-the-day-you-need-it","status":"publish","type":"post","link":"http:\/\/blog.ignoranthack.me\/?p=681","title":{"rendered":"Stashing linux away for the day you need it."},"content":{"rendered":"\n<p>I need a Linux VM on my FreeBSD machine for a bunch of FPGA dev work.  Thanks to a bunch of folks on the Internet, we have a pretty quick and dirty way of getting Linux setup via bhyve.<\/p>\n\n\n\n<p>Because I was trying to do things via wireless networking, I couldn&#8217;t use the most common and easy method for networking to just use dhcp and a bridge(4) with tap(4) on my laptop.  I asked a few people in the FreeBSD Discord, trolled FuzzyKaren&#8217;s great Kubernetes blog (https:\/\/productionwithscissors.run\/) and browsed a few FreeBSD forums to come up with something so simple.<\/p>\n\n\n\n<p>Use the UEFI install method for your linux VM, I used the FreeBSD Handbook and a ZFS zvol for it storage.  https:\/\/www.cyberciti.biz\/faq\/how-to-install-linux-vm-on-freebsd-using-bhyve-and-zfs\/<\/p>\n\n\n\n<p>I reconfigured the networking in the Ubuntu VM to be statically assigned to 10.0.0.2\/24 with a gateway of 10.0.0.1 (and using my home dns server at 192.168.1.1).  I setup the tap0 interface being used with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gateway_enable=\"YES\"\n# tap interfaces for ubuntu VM\ncloned_interfaces=\"tap0\"\nifconfig_tap0=\"inet 10.0.0.1 netmask 255.255.255.0\"<\/code><\/pre>\n\n\n\n<p>This bit will let your laptop and your Bhyve VM see each other, but you&#8217;ll need a small amount of PF to get to the Internet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wlan_if=\"wlan0\"\n\n# create all VM interfaces in this subnet\nvm_net=\"10.0.0.0\/24\"\nvm_ubuntu=\"10.0.0.2\"\n\nnat on $wlan_if from $vm_ubuntu to !$vm_net -> $wlan_if\n\npass out all\npass in all<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I need a Linux VM on my FreeBSD machine for a bunch of FPGA dev work. Thanks to a bunch of folks on the Internet, we have a pretty quick and dirty way of getting Linux setup via bhyve. Because I was trying to do things via wireless networking, I couldn&#8217;t use the most common [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_share_on_mastodon":"1"},"categories":[1],"tags":[],"share_on_mastodon":{"url":"https:\/\/infosec.exchange\/@seanwbruno\/109334210028970996","error":""},"_links":{"self":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/681"}],"collection":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=681"}],"version-history":[{"count":1,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/681\/revisions"}],"predecessor-version":[{"id":683,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/681\/revisions\/683"}],"wp:attachment":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=681"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}