<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Projects | FreeBSD Foundation</title>
	<atom:link href="https://staging.freebsdfoundation.org/topic/projects/feed/" rel="self" type="application/rss+xml" />
	<link>https://staging.freebsdfoundation.org</link>
	<description>A non-profit organization dedicated to supporting and building the FreeBSD Project</description>
	<lastBuildDate>Thu, 14 Dec 2023 15:21:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://staging.freebsdfoundation.org/wp-content/uploads/2015/12/favicon.png</url>
	<title>Projects | FreeBSD Foundation</title>
	<link>https://staging.freebsdfoundation.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>An Introduction to Packet Filter (PF)</title>
		<link>https://staging.freebsdfoundation.org/resource/an-introduction-to-packet-filter-pf/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Tue, 12 Sep 2023 19:35:40 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=12822</guid>

					<description><![CDATA[<p>Packet Filter, also known as PF or pf, is a BSD-licensed stateful packet filter used to filter TCP/IP traffic and perform Network Address Translation (NAT.) Originally created by OpenBSD, PF has been ported to FreeBSD since 5.3-RELEASE. PF can identify where a packet should be directed or if it should even be allowed through; this [&#8230;]</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/an-introduction-to-packet-filter-pf/">An Introduction to Packet Filter (PF)</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor">
<p>Packet Filter, also known as PF or pf, is a BSD-licensed stateful packet filter used to filter TCP/IP traffic and perform Network Address Translation (NAT.) Originally created by OpenBSD, PF has been ported to FreeBSD since 5.3-RELEASE.</p>
<p>PF can identify where a packet should be directed or if it should even be allowed through; this can be decided based on the source and destination of that individual packet. PF can detect and block traffic you want to keep out of or in the local network. The firewall is highly flexible and even offers bandwidth management and packet priority.</p>
<p><img fetchpriority="high" decoding="async" class="wp-image-12964  aligncenter" src="https://staging.freebsdfoundation.org/wp-content/uploads/2023/09/Untitled-design-43-1024x1024.png" alt="" width="448" height="448" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2023/09/Untitled-design-43-1024x1024.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2023/09/Untitled-design-43-300x300.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2023/09/Untitled-design-43-150x150.png 150w, https://staging.freebsdfoundation.org/wp-content/uploads/2023/09/Untitled-design-43-1536x1536.png 1536w, https://staging.freebsdfoundation.org/wp-content/uploads/2023/09/Untitled-design-43-2048x2048.png 2048w" sizes="(max-width: 448px) 100vw, 448px" /></p>
<h2>1 . Enabling PF</h2>
<p>PF relies on its kernel module, this must be enabled through <code>/etc/rc.conf</code> to start PF:</p>
<p><code># sysrc pf_enable=yes<br />
</code><br />
Additional options can be enabled when PF is started, this can be done by adding the following line to <code>/etc/rc.conf.</code> Required flags can later be specified between the two quotes(&#8220;&#8221;):</p>
<p><code>pf_flags="" # additional flags for pfctl startup</code></p>
<p>To start, PF will need to find its ruleset configuration file. FreeBSD does not ship with a ruleset or /etc/pf.conf. Custom rulesets can be used by specifying the path in <code>/etc/rc.conf</code></p>
<p><code>pf_rules="/path/to/pf.conf"</code><br />
<em><br />
</em>Logging support for PF is provided by <code>pflog(4)</code>. To enable logging support, add <code>pflog_enable=yes</code> to <code>/etc/rc.conf</code>:</p>
<p><code># sysrc pflog_enable=yes</code></p>
<p>The following lines can also be added to change the default location of the log file or to specify any additional flags to pass to pflog(4) when it is started:</p>
<p><code>pflog_logfile="/var/log/pflog" # where pflogd should store the logfile</code><br />
<code>pflog_flags="" # additional flags for pflogd startup</code></p>
<p>The following option will enable NAT if there is a LAN behind the firewall:</p>
<p><code>gateway_enable="YES"</code></p>
<p>PF can now be started with logging support:</p>
<p><code># service pf start</code><br />
<code># service pflog start</code></p>
<p>&nbsp;</p>
<h2>2. Using pfctl</h2>
<p>PF can be controlled using pfctl, refer to pfctl(8) for a description of all available options. Here are some of the more common pfctl options:</p>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr style="height: 24px;">
<td style="width: 50%; height: 24px;"><code>pfctl -e</code></td>
<td style="width: 50%; height: 24px;">Enable PF.</td>
</tr>
<tr style="height: 24px;">
<td style="width: 50%; height: 24px;"><code>pfctl -d</code></td>
<td style="width: 50%; height: 24px;">Disable PF.</td>
</tr>
<tr style="height: 24px;">
<td style="width: 50%; height: 24px;"><code>pfctl -F all -f /etc/pf.conf</code></td>
<td style="width: 50%; height: 24px;">Flush all NAT, filter, state, and table rules and reload <code>/etc/pf.conf.</code></td>
</tr>
<tr style="height: 24px;">
<td style="width: 50%; height: 24px;"><code>pfctl -s [ rules | nat | states ]</code></td>
<td style="width: 50%; height: 24px;">Report on the filter rules, NAT rules, or state table.</td>
</tr>
<tr style="height: 23px;">
<td style="width: 50%; height: 23px;"><code>pfctl -vnf /etc/pf.conf</code></td>
<td style="width: 50%; height: 23px;">Checks <code>/etc/pf.conf</code> for errors, but does not load ruleset.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>3. Creating a Base PF Ruleset</h2>
<p>PF depends on a ruleset, which can be customized to best serve any system. Creating a base ruleset is the first step in customizing your firewall that can be further augmented and specified. Create the ruleset in</p>
<p>Start by creating a simple ruleset that applies to only a single machine, relies on one network, and does not run services:</p>
<div class="literalblock programlisting">
<div class="content">
<p><code>block in all</code></p>
<p><code>pass out all keep state</code></p>
</div>
</div>
<div class="paragraph">
<p>This rule will deny all incoming traffic, while the second rule allows connections created by this system to pass out while retaining state information on those connections. Load this new ruleset with the following:</p>
</div>
<div class="listingblock">
<div class="content">
<p class="rouge highlight"><code data-lang="shell"><span class="c"># pfctl -e ; pfctl -f /etc/pf.conf</span></code></p>
</div>
</div>
<div class="paragraph">
<p>In addition to keeping state, PF provides lists and macros that can be defined when creating rules. Macros can include lists and need to be defined before use. As an example, insert these lines at the very top of the ruleset:</p>
</div>
<div class="literalblock programlisting">
<div class="content">
<p><code>tcp_services = "{ ssh, smtp, domain, www, pop3, auth, pop3s }"</code></p>
<p><code>udp_services = "{ domain }"</code></p>
</div>
</div>
<div class="paragraph">
<p>PF can use port names and numbers if the names are listed in <code><span class="filename">/etc/services</span></code>. In this example, all traffic is blocked except for the connections initiated by this system for the seven specified TCP services and the one specified UDP service:</p>
</div>
<div class="literalblock programlisting">
<pre><code>tcp_services = "{ ssh, smtp, domain, www, pop3, auth, pop3s }"
udp_services = "{ domain }"
block all</code> <code>pass out proto tcp to any port $tcp_services keep state
pass proto udp to any port $udp_services keep state</code></pre>
<p>Next, at the top of your ruleset, create a set skip rule for the loopback device because it does not need to filter traffic and would likely bring your server to a crawl. </p>
<p class="content"><code>set skip on lo0</code></p>
<p class="content">Finally, add a <code>pass out inet</code> rule for the ICMP protocol, which allows you to use the ping(8) utility for troubleshooting</p>
<p class="content"><code>pass out inet proto icmp icmp-type { echoreq }</code></p>
<p class="content">The ruleset should now resemble the following: </p>
<pre><code>set skip on lo0
tcp_services = "{ ssh, smtp, domain, www, pop3, auth, pop3s }"
udp_services = "{ domain }"
block all</code><code>
pass out proto tcp to any port $tcp_services keep state
pass proto udp to any port $udp_services keep state
pass out inet proto icmp icmp-type { echoreq }</code></pre>
</div>
<div class="paragraph">
<p>After each edit, the ruleset needs to be loaded again:</p>
</div>
<div class="listingblock">
<div class="content">
<p class="rouge highlight"><code data-lang="shell"><span class="c"># pfctl -f /etc/pf.conf</span></code></p>
</div>
</div>
<div class="paragraph">
<p><code>pfctl</code> will not output any messages unless there are syntax errors that will need to be fixed. During the rule load, instead of loading the ruleset, a test can be run with:</p>
</div>
<div class="listingblock">
<div class="content">
<p class="rouge highlight"><code data-lang="shell"><span class="c"># pfctl -nf /etc/pf.conf</span></code></p>
<div class="copy-to-clipboard-wrapper">Including <code>-n</code> causes the rules to be interpreted only but not loaded. This provides an opportunity to correct any errors. The last valid ruleset loaded will be enforced until either PF is disabled or a new ruleset is loaded.</div>
</div>
</div>
<p>&nbsp;</p>
<h2>4. Testing Your Base Ruleset</h2>
<p>Testing your ruleset between major edits is crucial to ensure that PF functions properly. </p>
<p>First test for internet connectivity and DNS service:</p>
<p><code># ping -c 3 google.com</code></p>
<p>Check that the <code>pkgs</code> repository can be reached: </p>
<p><code># pkg upgrade</code></p>
<p>And finally, reboot:</p>
<p><code># reboot</code></p>
<p>Give your server a few minutes to reboot. Next, you will expand the ruleset with more advanced features to see some possible applications of the PF ruleset.</p>
<h2>5. Example Rulesets and Their Application</h2>
<p>Now that you have created a base ruleset, the base ruleset can be built upon for more advanced PF functions. While this guide won&#8217;t cover every possible function or customization, these basic rulesets may be helpful for your system, or offer insight into how PF may be used. After each example, make sure to test the base ruleset.</p>
<h3 style="padding-left: 40px;">5.1 Blocking Spoofed Packets</h3>
<p style="padding-left: 40px;">Address spoofing is a method where an outside user forges the source IP of sent packets to conceal the actual address, essentially impersonating another internet node. This opens the door for a network attack that does not disclose where it&#8217;s originating.</p>
<p style="padding-left: 40px;">The antispoof PF keyword can help protect against spoof packets:</p>
<p style="padding-left: 40px;"><code>antispoof [log] [quick] for interface [af]</code></p>
<p style="padding-left: 40px;"><code><strong>log</strong></code>: Specifies that packets matching the criteria should be reported by pflogd (8).<br />
<code><strong>quick</strong></code>: This ensured that if a packet meets this rules, examination of the ruleset will cease.<br />
<code><strong>interface</strong></code>: Specify the specific network where spoofing protection will be activated.<br />
<code><strong>af</strong></code>: Address family (i.e., inet or inet6 for IPv4 and IPv6)</p>
<p style="padding-left: 40px;">The most basic way to weed out spoofed traffic coming in from external sources, as well as any spoofed packets that originate in the local network:</p>
<p style="padding-left: 40px;"><code>antispoof for $ext_if</code><br />
<code>antispoof for $int_if</code></p>
<p style="padding-left: 40px;"> </p>
<h3 style="padding-left: 40px;">5.2 Protecting SSH Ports</h3>
<p style="padding-left: 40px;">A typical exploit is to target SSH ports, which are open to the public. This is often done with brute force attacks and can succeed if the server has weak passwords. PF has built-in features that help deal with brute-force attacks. PF can limit the simultaneous connection attempts a single host allows. Once a host exceeds this number, the connection will be dropped, and they will be banned from the server. PF&#8217;s overload mechanism has a table of banned IP addresses.</p>
<p style="padding-left: 40px;">Modify your previous base ruleset to limit simultaneous connections from a single host:</p>
<p style="padding-left: 40px;"><code>pass in on $vtnet0 proto tcp to port { 22 } \</code></p>
<p style="padding-left: 80px;"><code>keep state (max-src-conn 15, max-src-conn-rate 3/1, \</code></p>
<p style="padding-left: 120px;"><code>overload &lt;bruteforce&gt; flush global)</code></p>
<p style="padding-left: 40px;"><code><strong>keep state</strong></code>: Allows you to define the state criteria for the overload table. <br />
<code><strong>max-src-conn</strong>:</code> Specifies the number of simultaneous connections allowed from a single host per second.<br />
<code><strong>max-src-conn-rate</strong>:</code> Specifies the number of new connections allowed from a single host per second.</p>
<p style="padding-left: 40px;">If any host exceeds the specified limits, the PF overload mechanism will add the source IP to the <code>&lt;bruteforce&gt;</code> table. If a host exceeds these limits, the overload mechanism adds the source IP to the <code>&lt;bruteforce&gt;</code> table, which bans them from the server. The connection will immediately be dropped due to the flush global parameter. </p>
<p style="padding-left: 40px;">Before this ruleset can be loaded, the table you defined needs to be declared in the ruleset: </p>
<p style="padding-left: 40px;">Specify the <code>&lt;bruteforce&gt;</code> table underneath the previous <code>icmp_types</code> macro</p>
<p style="padding-left: 40px;"><code>icmp_types = "{ echoreq }"</code></p>
<p style="padding-left: 80px;"><code>table &lt;bruteforce&gt; persist</code></p>
<p style="padding-left: 40px;">The persist keyword allows an empty table to exist in the ruleset. Without it, PF will complain that there are no IP addresses in the table.</p>
<h3 style="padding-left: 40px;">5.3 Handling Non-Routable Addresses</h3>
<p style="padding-left: 40px;">As much as you can properly configure your system to be precise, some configuration may be needed to compensate for other people&#8217;s misconfigurations. One common mistake is to let traffic with non-routable addresses out to the Internet. Since non-routable addresses can be used in DoS attacks, consider blocking this traffic from entering the network.</p>
<p style="padding-left: 40px;">Define a macro containing non-routable addresses, then use it in blocking rules. Traffic to and from these addresses is dropped on the gateway’s external interface.</p>
<p style="padding-left: 40px;">
<code>external = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, \</code><br />
<code>      10.0.0.0/8, 169.254.0.0/16, 192.0.2.0/24, \</code><br />
<code>      0.0.0.0/8, 240.0.0.0/4 }"</code></p>
<p style="padding-left: 40px;"><code>block drop in quick on $ext_if from $external to any</code><br />
<code>block drop out quick on $ext_if from any to $external</code></p>
<p>
</p>
<h2>6. Viewing PF Logs</h2>
<p>To view PF logs:</p>
<p><code>tcpdump -n -e -ttt -r /var/log/pflog</code></p>
<p>To view logs in real-time from the pflog0 interface, run the following command:</p>
<p><code>tcpdump -n -e -ttt -i pflog0</code></p>
<p>The pftop utility is a tool for quickly viewing firewall activity in real-time; it can be installed and started with:</p>
<p><code>pkg install pftop</code></p>
<p><code>pftop</code></p>
</section><p>The post <a href="https://staging.freebsdfoundation.org/resource/an-introduction-to-packet-filter-pf/">An Introduction to Packet Filter (PF)</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Binary Package Management on FreeBSD</title>
		<link>https://staging.freebsdfoundation.org/resource/binary-package-management-on-freebsd/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Thu, 12 Jan 2023 15:06:56 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11736</guid>

					<description><![CDATA[<p>The simplest way to install and manage applications and system tools on FreeBSD is through the pkg package management tool, which makes dealing with binary packages fast and easy. Binary packages are pre-compiled and require no in-depth understanding of compiling software on FreeBSD, making them the ideal method to install software for new users.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/binary-package-management-on-freebsd/">Binary Package Management on FreeBSD</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor">
<p id="pkgng-intro">The simplest way to install and manage applications and system tools on FreeBSD is through the <code>pkg</code> package management tool, which makes dealing with binary packages fast and easy. Binary packages are pre-compiled and require no in-depth understanding of compiling software on FreeBSD, making them the ideal method to install software for new users.</p>
<p><img decoding="async" class="wp-image-11737 aligncenter" src="https://staging.freebsdfoundation.org/wp-content/uploads/2022/10/Untitled-design-26-1024x577.png" alt="" width="692" height="390" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2022/10/Untitled-design-26-1024x577.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/10/Untitled-design-26-300x169.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/10/Untitled-design-26-1536x865.png 1536w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/10/Untitled-design-26.png 1640w" sizes="(max-width: 692px) 100vw, 692px" /></p>
<div class="sectionbody">
<div class="sect2">
<h2 id="pkgng-initial-setup">1. Getting Started with pkg</h2>
<div class="paragraph">
<p>FreeBSD includes a bootstrap utility which can be used to download and install pkg and its manual pages. This process will require a working Internet connection.</p>
</div>
<div class="admonitionblock note">To bootstrap the system, run:</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># /usr/sbin/pkg</span></code></pre>
<div class="copy-to-clipboard-wrapper">Usage information for pkg is available in the <a href="https://www.freebsd.org/cgi/man.cgi?query=pkg&amp;sektion=8&amp;format=html">pkg(8)</a> manual page or by running <code>pkg</code> without additional arguments. To access the manual page run:</div>
</div>
<pre><code># man pkg</code></pre>
</div>
<div class="paragraph">
<p>Each pkg command argument is documented in a command-specific manual page. To read the manual page for <code>pkg install</code>, for example, run either of these commands:</p>
</div>
<div class="listingblock">
<div class="content">
<pre><code data-lang="shell"><span class="c"># pkg help install</span></code> <code><span class="c"># man pkg-install</span></code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<div class="copy-to-clipboard-wrapper"> </div>
</div>
</div>
<h2 id="pkgng-installing-deinstalling">2. Installing and Removing Packages</h2>
<div class="paragraph">
<p>To install a binary package, use the following command, where <em>packagename</em> is the name of the package to install:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pkg install packagename</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Before the installer proceeds, the system will ask to confirm and approve the changes, this can be done be either typing &#8220;y&#8221; or &#8220;n&#8221; to approve or cancel the process. Once complete, the new package and any additional packages that were installed as dependencies can be seen in the installed packages list:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pkg info</span>
ca_root_nss-3.15.1_1	The root certificate bundle from the Mozilla Project
curl-7.31.0_1	Non-interactive tool to get files from FTP, GOPHER, HTTP<span class="o">(</span>S<span class="o">)</span> servers
pkg-1.1.4_6	New generation package manager</code></pre>
<div class="copy-to-clipboard-wrapper">Packages that are no longer needed can be removed with <code>pkg delete</code>. For example:</div>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pkg delete curl</span>
</code></pre>
</div>
</div>
<h2 id="pkgng-upgrading">3. Upgrading Installed Packages</h2>
<div class="paragraph">
<p>Installed packages can be upgraded to their latest versions by running:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="shell"><span class="c"># pkg upgrade</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>This command will compare the installed versions with those available in the repository catalogue and upgrade them from the repository.</p>
</div>
</div>
</div>
</section><p>The post <a href="https://staging.freebsdfoundation.org/resource/binary-package-management-on-freebsd/">Binary Package Management on FreeBSD</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Video Playback on FreeBSD &#8211; Quick Guide</title>
		<link>https://staging.freebsdfoundation.org/resource/video-playback-on-freebsd-quick-guide/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Thu, 01 Sep 2022 20:26:36 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11665</guid>

					<description><![CDATA[<p>In this guide, we&#8217;ll use the xine video player to set up basic video playback on a fresh FreeBSD install. The xine multimedia player relies on the XWindow system and the XVideo extension to provide a graphical video playback interface. System Requirements: Xorg supports a wide variety of video cards, but not all are supported [&#8230;]</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/video-playback-on-freebsd-quick-guide/">Video Playback on FreeBSD – Quick Guide</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p>In this guide, we&#8217;ll use the xine video player to set up basic video playback on a fresh FreeBSD install. The xine multimedia player relies on the XWindow system and the XVideo extension to provide a graphical video playback interface.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img decoding="async" class="wp-image-11627" src="https://staging.freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-1024x576.png" alt="" width="840" height="472" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-1024x576.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-300x169.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23-1536x864.png 1536w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/08/Untitled-design-23.png 1920w" sizes="(max-width: 840px) 100vw, 840px" /></figure>
<p></section></div>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">System Requirements:</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Xorg supports a wide variety of video cards, but not all are supported or offer good video playback performance.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>It is a good idea to have a short MPEG test file for evaluating various players and options. Since some <code>DVD</code> applications look for <code>DVD</code> media in /dev/dvd by default, or have this device name hardcoded in them, it might be useful to make a symbolic link to the proper device:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># ln -sf /dev/cd0 /dev/dvd</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Due to the nature of <a href="https://www.freebsd.org/cgi/man.cgi?query=devfs&amp;sektion=5&amp;format=html">devfs(5)</a>, manually created links will not persist after a system reboot. In order to recreate the symbolic link automatically when the system boots, add the following line to /etc/devfs.conf:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">link cd0 dvd</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="video-interface">Installing Xorg</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>There are several possible ways to display video under Xorg and what works is largely hardware dependent. This guide will focus on the Xvideo extension which allows video to be directly displayed, even on low-end machines.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start by installing the X Window System:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"># <code>pkg install -y xorg</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once the package has been fully installed, the X Window System can be started with:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"># <code>startx</code></pre>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading" id="video-interface-xvideo">XVideo Support</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To check whether the Xvideo extension is running, use <code>xvinfo</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code>xvinfo</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If XVideo is supported, the result will look similar to the example below and may include screen and video card information.</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>X-Video Extension version 2.2
  screen #0
  Adaptor #0: "Example Engine"
    number of ports: 1
    port base: 43
     
       .   .    .</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>&nbsp;</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>XVideo is likely unsupported by the video card if the result instead look like:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>X-Video Extension version 2.2
screen #0
no adaptors present</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The display may be unable to meet the demands of rendering video playback if XVideo is unsupported (though this is not always the case).</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">The xine Video Player</h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="618" height="235" class="wp-image-11650" src="https://staging.freebsdfoundation.org/wp-content/uploads/2022/09/Screenshot-2022-09-01-154324.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2022/09/Screenshot-2022-09-01-154324.png 618w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/09/Screenshot-2022-09-01-154324-300x114.png 300w" sizes="(max-width: 618px) 100vw, 618px" /></figure>
<p></section></div>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-paragraph"></p>
<p>xine is a free multimedia player. It plays back CDs, DVDs, BluRays and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet. Get started by installing the package:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code># pkg install -y xine</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In practice, xine requires either a fast CPU or support for the XVideo extension. The xine video player performs best on XVideo interfaces. If in the previous step, the Xvideo extension was unsupported, issues may occur.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The xine player starts a graphical user interface (GUI) and the menus can be used to navigate to multimedia files.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code># xine</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Alternatively, xine may be directly invoked from the command line by specifying the name of the file to play:</p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code># xine -g -p mymovie.avi</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You now have a simple way to play a variety of multimedia files on your FreeBSD system! To find out more about the xine player, refer to the <a href="https://sourceforge.net/projects/xine/" target="_blank" rel="noreferrer noopener">SourceForge page</a>.</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/video-playback-on-freebsd-quick-guide/">Video Playback on FreeBSD – Quick Guide</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing a Port on FreeBSD &#8211; Video Guide</title>
		<link>https://staging.freebsdfoundation.org/resource/installing-a-port-on-freebsd-video-guide-2/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 22 Aug 2022 16:53:35 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11539</guid>

					<description><![CDATA[<p>FreeBSD offers two primary methods of downloading applications and system tools: packages and ports. This video guide focuses on using the port collection to install irssi, a powerful and modular text-based Internet Relay Chat (IRC) client.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/installing-a-port-on-freebsd-video-guide-2/">Installing a Port on FreeBSD – Video Guide</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor">
<p><iframe title="YouTube video player" src="//www.youtube.com/embed/lywkQkTXMEY" width="1000" height="550" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
</section><p>The post <a href="https://staging.freebsdfoundation.org/resource/installing-a-port-on-freebsd-video-guide-2/">Installing a Port on FreeBSD – Video Guide</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>InstallFest How-To Guide P2</title>
		<link>https://staging.freebsdfoundation.org/resource/installfest-how-to-guide-p2/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:47:47 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11570</guid>

					<description><![CDATA[<p>The second part of our in depth guide to running your own FreeBSD Installfest, this section covers installing packages, setting up a desktop environment, and using poudriere and jails to further customize your system.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/installfest-how-to-guide-p2/">InstallFest How-To Guide P2</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-heading"></p>
<h3 class="has-text-align-center wp-block-heading"><strong>This Walkthrough is a Continuation of Part 1 of the InstallFest How-To Guide</strong></h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center"><a href="https://staging.freebsdfoundation.org/freebsd-project/resources/installfest-how-to-guide/" target="_blank" rel="noreferrer noopener">Follow the link here for part 1</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Updated: August 14, 2020</strong></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.1: Package Installation</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9495" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/Firefox_Logo_2017-992x1024.png" alt="" width="144" height="148" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Packages can be downloaded in bulk by adding them to the same command line. Try this by installing the GNOME desktop environment, sudo, the vim editor, and Firefox in one line:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y gnome3 vim-console firefox</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The -y flag in the previous command assumes a pre-confirmation to the installation process, so installation will start instantly.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Gnome requires <code>/proc</code> to be mounted, in order to do this, run</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /etc/fstab</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This time we use the vim editor, Vi iMproved, and to begin typing you need to be in “insert mode” and must press ‘<code>i</code>‘ to enter insert mode and begin typing in text. Type in the following one-line configuration:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>proc      /proc      procfs      rw      0      0</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Exit vim by pressing “<code>Esc</code>” on the keyboard, then type <code>ZZ</code> or <code>:wq</code> followed by Enter/Return. At this point the virtual machine desktop can be started with the following command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Change to regular user by holding down “<code>control</code>” and pressing “<code>d</code>” on the keyboard which will log out the current user.  Log in again, this time as the regular user account that was created and type the following commands.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ echo "exec /usr/local/bin/gnome-session" &gt; ~/.xinitrc</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ startx</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.2: Desktop Configuration</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9496" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/download-9.png" alt="" width="160" height="160" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/download-9.png 225w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/download-9-150x150.png 150w" sizes="(max-width: 160px) 100vw, 160px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Here is how to open a local copy of the handbook we installed in the Final Configuration:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Right click on: Desktop &gt; Applications &gt; Firefox Web Browser</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Open Firefox and navigate to the following URL: file:///usr/local/share/doc/freebsd/handbook/index.html</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This is a local copy of the FreeBSD Handbook, and it will always be available as it doesn’t require an active internet connection. That’s all it takes to install FreeBSD. The next recommended step is to choose a firewall and configure it. Also recommend you pick up a copy of the book “BSD Hacks” to get more familiar with the tcsh shell as well as to acquire several new skills.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Navigate back to Applications and open the terminal.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.3: FreeBSD Update and Package</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>In the open terminal, run:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sudo -i</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ env PAGER=cat freebsd-update fetch install</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We’re using <code>env PAGER=cat</code> to modify the value of the <code>PAGER</code> variable which is used by the freebsd-update shell script. If you open up the shell script you will see the default value of <code>PAGER</code> is set to less. You can find the location of the freebsd-update shell script by typing which freebsd-update. By setting the value of <code>PAGER</code> to <code>cat</code>, freebsd-update will not stop to display the list of file to be updated, instead the cat command will only display the list of files and won’t stop to wait for you to read. If you only type freebsd-update fetch install, you’ll need to use the following to get through the prompts</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>‘<code>Page Down</code>‘ &amp; ‘<code>q</code>‘ should get you through the prompts. If the screen shows END press ‘<code>q</code>‘, use ‘<code>Page Down</code>‘ for the other screens. You can also use ‘q’ for every screen.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Now that FreeBSD itself is up to date, we should also update the packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg update</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg upgrade -y</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.4: Setting up Jails</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9497" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/download-10.png" alt="" width="144" height="152" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Set UTF-8 as the locale for this host:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /etc/login.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Change the line with :umask=022: to look like the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>:umask=022:\</code> <code>:charset=UTF-8:\</code> <code>:lang=en_US.UTF-8:</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Save and quit the editor then run the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cap_mkdb /etc/login.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ logout</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Log in as root and type the following to verify UTF-8 locale has been set</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ locale</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Install iocage</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y py37-iocage</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following command assumes your <code>zpool</code> is named <code>zroot</code> adjust as necessary. Type <code>zpool</code> status to see the current name of your <code>zpool.</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage activate zroot</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage list</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We should now see an empty table as the output of <code>iocage</code> list, we’ll do some additional housekeeping below to improve performance of <code>iocage</code>. There are many things you can do to optimize performance of various applications. One way to learn several new tips and tricks is to read the supurb collection of FreeBSD Mastery books available at <a href="https://mwl.io/">https://MWL.io</a> (In fact, the following performance optimization trick was in the book FreeBSD Mastery: Jails)</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mount -t fdescfs null /dev/fd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vi /etc/fstab</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Add the following line to the file and exit when finished. ‘<code>i</code>‘ for insert mode, ‘<code>ESC</code>‘ then ‘<code>ZZ</code>‘ to save and quit the file. Press ‘<code>TAB</code>‘ between each of the fields for the fstab file rather than using spaces to separate fields.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>fdescfs /dev/fd fdescfs rw 0 0</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Download a Release branch of FreeBSD first</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage fetch</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We used [<code>Enter</code>] to fetch the default release <code>iocage</code> wants to provide. Verify the download with the following command</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage list -r</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>View the help documentation</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage --help</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Any sub-commands can also have the –help flag appended</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage create --help</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create a base jail</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage create -T -n JAILNAME ip4_addr="10.0.2.16" -r 12.1-RELEASE</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>List current jails</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage list</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Startup jail-one and jump into the console</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage console JAILNAME</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The console command will start the jail if it isn’t already started. To manually start a jail use this:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage start JAILNAME</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Similarly to stop a jail issue</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage stop JAILNAME</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Verify networking is working</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Say yes to the pkg bootstrap prompt. Exit the jail console with <code>ctrl + d</code>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To delete a jail:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ iocage destroy JAILNAME</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.5: Poudriere</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>The following commands will work on the virtual machine we’ve been using so far, but it will take a long time to compile all the packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>We’re going to use the cloned virtual machine we created earlier to explore Poudriere.</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start up the cloned VM.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Execute the following commands as the root user:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y poudriere vim-console</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mkdir /usr/ports/distfiles</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mkdir /usr/local/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/poudriere.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>poudriere.conf</code> content to modify</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>ZPOOL=zroot</code> <code>FREEBSD_HOST=https://download.freebsd.org</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Continue executing:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere jail -c -j amd64-12-1 -v 12.1-RELEASE</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere jail -l</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere ports -cp head</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere ports -l</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Get together a list of packages to build. I ran <code>pkg query -e '%a=0' %o</code> on my laptop and a large list appeared. <code>pkg query</code> on my VM was much shorter. To learn more about <code>pkg query</code> issue the command <code>pkg help query</code> to see help text for the query subcommand. Most commands support some form of help (-h, –help, or simply reading the man page with <code>man PROGRAM</code>) For this tutorial we will just build a shorter list of packages. The command to export the current packages installed on the system to a file called pkglist is:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg query -e ‘%a=0’ %o | tee pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ editors/vim-console</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ports-mgmt/pkg</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ports-mgmt/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Note</strong>: tee writes output to a file and also to stdout. Also the following two bits of information are optional for this tutorial and are included to show you how to customize packages.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Two ways to configure custom options for packages, manually and with the normal make config screen. FYI: Manually looks like this:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/poudriere.d/amd64-12-1-make.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ DEFAULT_VERSIONS += ssl=libressl</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To customize a package one can use the normal package configuration screens, which will appear when issuing the following command</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere options -j amd64-12-1 -p head -f pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For this tutorial we’ll just actually build the packages with the default options to get the hang of Poudriere by issuing the following:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere bulk -j amd64-12-1 -p head -f pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd /usr/local/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This directory contains logs related to Poudriere builds. There are even a few different website files generated at <code>/data/logs/bulk/.html/</code> with information about the builds. You can open the website in Firefox using the URL <code>file:///data/logs/bulk/.html/index.html</code> to check on the status of a current Poudriere build. You can also press <code>ctrl + t</code> on the command line where you issued the <code>poudriere bulk</code> command to issue a SIGINFO to Poudriere which is configured to print out the current status of the Poudriere build while the command is still processing. This trick works on many other commands as well to show you the status. For instance if you were using <code>scp</code> to download a large file and wanted to see how far along the download was SIGINFO would print out the status on the command line to show you. Another example is if you were decompressing a zip file and wanted to know the status of the extraction process.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once Poudriere has finished, the packages that were built are available at</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ /data/packages/amd64-12-1-head</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create a pkg repository</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mkdir -p /usr/local/etc/pkg/repos</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Disable the main FreeBSD repo by creating a file to override the default settings found in the default FreeBSD repository <code>file /etc/pkg/FreeBSD.conf</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/pkg/repos/FreeBSD.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Type in the following configuration with enabled set to no</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>FreeBSD: {  <br />
        enabled: no  <br />
}</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create a new configuration file for your local Poudriere package repository similar to the FreeBSD.conf file to hold the repository configuration</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/pkg/repos/amd64-12-1.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Add the following configuration</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>amd64-12-1: { <br />
          url: “file:///data/packages/amd64-12-1-head”,  <br />
          enabled: yes,  <br />
}</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To reinstall all packages using the new repo</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg upgrade -fy</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2.6: Updating Poudriere</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>NOTE: A good Systems Administration practice is to add comments to your configs to let the future you know what the config options do and why there were put there in the first place. That way when you revisit a config file after some time, you’ll have some context as to why those options were chosen.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vim /usr/local/etc/poudriere.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p># by default Poudriere builds all packages in the pkglist by default, these two lines tell Poudriere to look at each package individually</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>CHECK_CHANGED_OPTIONS=verbose</code> <code>CHECK_CHANGED_DEPS=yes</code></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere jail -j amd64-12-1 -u</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere ports -p head -u</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ poudriere bulk -j amd64-12-1 -p head -f pkglist</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You can now install the updated packages:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg update</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Some Additional Useful Commands:</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Avoiding Issues</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Terminate current command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ^C (Ctrl-C)</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Clear to start of line:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ^U (Ctrl-U)</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Finding Information:</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Manual page for the “cmd” command, replace with any other command to access its manual page:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ man cmd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Rebooting / Shutting Down</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Power Down:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sudo shutdown –p now</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Reboot:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sudo shutdown –r now</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Log Out:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ exit</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ logout</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Directory Navigation</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Display present work directory:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pwd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>List contents of current directory:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ls</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Files</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Create file if it does not exist:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ touch filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Delete file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ rm filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Rename a file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ mv oldname newname</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Search for a file: (full filename is not needed)</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ locate filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>File editing</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ vi filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ee filename</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Change to your home directory</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd ~</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Change to parent directory</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd ..</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Change to previous directory</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ cd -</code></em></p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading"> </h3>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Additional Resources: </h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Website: <a href="http://www.freebsd.org" target="_blank" rel="noreferrer noopener">www.freebsd.org</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD Foundation: <a href="https://staging.freebsdfoundation.org/" target="_blank" rel="noreferrer noopener">archive.freebsdfoundation.org</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>GitHub: <a href="http://github.com/freebsd" target="_blank" rel="noreferrer noopener">github.com/freebsd </a> </p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Mailing Lists: <a href="https://lists.freebsd.org/mailman/listinfo" target="_blank" rel="noreferrer noopener">https://lists.freebsd.org/mailman/listinfo</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Forums: <a href="https://forums.freebsd.org" target="_blank" rel="noreferrer noopener">https://forums.freebsd.org</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD Handbook:<a href="https://www.freebsd.org/doc/handbook/" target="_blank" rel="noreferrer noopener"> https://www.freebsd.org/doc/handbook/</a></p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/installfest-how-to-guide-p2/">InstallFest How-To Guide P2</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>InstallFest How-To Guide</title>
		<link>https://staging.freebsdfoundation.org/resource/installfest-how-to-guide/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:40:33 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11567</guid>

					<description><![CDATA[<p>The first part of our in depth guide to running your own FreeBSD Installfest, this section covers FreeBSD installation, system configuration, and GUI prep.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/installfest-how-to-guide/">InstallFest How-To Guide</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: June 15, 2022</strong></p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>1.1 Identifying Your Computer:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">macOS:</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Start by opening up the terminal, found under Applications &gt; Utilities &gt; Terminal. Then use the code:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>sysctl -n machdep.cpu.brand_string</code></em></p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-7748" src="https://staging.freebsdfoundation.org/wp-content/uploads/2020/03/save3-1024x102-1.png" alt="" width="547" height="95" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2020/03/save3-1024x102-1.png 583w, https://staging.freebsdfoundation.org/wp-content/uploads/2020/03/save3-1024x102-1-300x52.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>This will return a string identifying the computer’s processor. Running a web search for this processor will take you to the manufacturers website, which should list the processor’s stats as well as whether it is 32-bit or 64-bit.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">Windows:</h4>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-5160" src="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943-1024x606.png" alt="" width="635" height="376" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943-1024x606.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943-300x178.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/windows_system_info-e1584820042943.png 1084w" sizes="(max-width: 635px) 100vw, 635px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Navigate to “Control Panel → System and Security → System” and look for the highlighted information to determine whether your system is 32-bit or 64-bit.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>2 Installing VirtualBox</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Visit the <a href="https://www.virtualbox.org/wiki/Downloads" target="_blank" rel="noreferrer noopener">VirtualBox downloads website</a>, and in the highlighted area, select the <em>platform package binary</em> that applies to your operating system. VirtualBox is available on <strong>Windows, macOS, Linux, and Solaris</strong>.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-5158" src="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/virtual_box_download-e1584821388890.png" alt="" width="567" height="262" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/virtual_box_download-e1584821388890.png 943w, https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/virtual_box_download-e1584821388890-300x139.png 300w" sizes="(max-width: 567px) 100vw, 567px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Opening the downloaded file will start the installation walkthrough. Once it finishes, you’ll be able to launch the application.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>1.3 Getting the latest FreeBSD release:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">   </h4>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Downloading FreeBSD</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Visit the official <a href="https://www.freebsd.org/where.html" target="_blank" rel="noreferrer noopener">FreeBSD releases page</a>. The disk images are listed <em>in order of release date</em>, so the most recent release can be found at the top of the page as highlighted.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>For <strong>32-bit</strong> machines, click on <strong>i386</strong></li>
	<li>For <strong>64-bit</strong> machines, click on <strong>amd64</strong></li>
</ul>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="349" class="wp-image-11385" src="https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316-1024x349.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316-1024x349.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316-300x102.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112316.png 1067w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>After clicking the link, you will be redirected to a file directory containing multiple formats and versions of the FreeBSD installer.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Identifying the Correct Disk Image</h3>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="205" class="wp-image-11386" src="https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-1024x205.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-1024x205.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-300x60.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-1536x308.png 1536w, https://staging.freebsdfoundation.org/wp-content/uploads/2022/06/Screenshot-2022-06-15-112332-2048x411.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>For Virtual Machines, the format you are looking for is the file ending in <strong>-disk.iso</strong> as shown above. Click this file and it will start downloading the installer.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>4 Configuring and Starting FreeBSD on VirtualBox:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once the FreeBSD installer has been downloaded in the last step, run VirtualBox to start hard disk configuration. Select the “New” button on the top left of the window to open the configuration window. </p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Name your operating system as “FreeBSD”, then select FreeBSD from the dropdown menu as well as the version (32 or 64 bit).</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-6892" src="https://staging.freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321-1024x608.png" alt="" width="631" height="374" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321-1024x608.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321-300x178.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/03/Screen-Shot-2019-02-28-at-6.12.28-PM-e1584821693321.png 1323w" sizes="(max-width: 631px) 100vw, 631px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Choose the defaults options for disc setup until you reach the memory allocation section</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Pick 2-4GB memory (as long as the slider does not move into the red)</li>
	<li>Hardware drive Option – Recommend 100GB at least 20GB</li>
	<li>Give the VM some extra processors if your machine can handle it (stay in the green)</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After the hard disk has been configured, boot up the operating system with the “Start” button. VirtualBox will start up a virtual machine and ask for a <em>virtual optical disk file</em>. This will be the <strong>.iso</strong> file that you downloaded through the FreeBSD website. Navigate to this file by clicking the small file symbol next to the drop-down menu. Once selected, the booting process will continue and the FreeBSD installer will start.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>5 Installing FreeBSD:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-5218" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen-e1585249387619.png" alt="" width="679" height="378" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen-e1585249387619.png 722w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen-e1585249387619-300x167.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>The FreeBSD booting system will automatically start once VirtualBox starts the virtual machine. While this how-to will provide a detailed installation guide, the <a href="https://www.freebsd.org/doc/handbook/using-bsdinstall.html">FreeBSD handbook’s installation guide</a> can also be used. <em>When in doubt, use the default options provided</em>, as they can be reconfigured later if necessary.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>After the first boot, users will be directed to the welcome menu. <strong>Arrow </strong>keys can be used to navigate through the options while the <strong>Enter</strong> key will be used to save the selection and move onto the next menu. To begin installation, select the first [ Install ] option.</li>
	<li>This will enter bdsinstall, a program that allows users to install FreeBSD while offering multiple options for customization. For now, default options will be all that’s needed. The options are a great tool for more advanced users wanting a more personalized experience.</li>
	<li>First, the installer will display a menu for keymap selection. Highlight the option to continue with the default keymap and press <strong>Enter</strong> to use the default keyboard layout.</li>
	<li>The installer will then allow the user to set a hostname for the system. Type in a hostname that is unique for your network. Hit <strong>Enter</strong> again to save the new name.</li>
	<li>After a hostname is selected and saved, the installer will prompt the user to select components to install. Stick with the default options and hit <strong>Enter</strong> to continue.</li>
	<li>The installer will guide the user through the process of allocating disk space. This will allow FreeBSD to set up a partition scheme.

<ul>
	<li>Choose the Auto (UFS) Guided Disk Setup.</li>
	<li>Confirm your selection.</li>
	<li>Use the Entire disk (ada0), this will make sure that all allocation disk space will be utilized.</li>
	<li>Select GPT Partitions when prompted for a partition scheme. To navigate, use the <strong>arrow keys</strong> and <strong>Space </strong>to select the GPT option.</li>
</ul>
</li>
	<li>When prompted, complete the setup process and create the disk partition by selecting [ Finish ] and [ Commit ]. Once these changes have been saved and committed, bsdinstall will start the FreeBSD installation process. This may take a few minutes.</li>
</ol>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>6 Post- Installation Setup</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>While the FreeBSD installation process has been completed, there a few more configuration options that need to be set before booting into the newly installed system.</p>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>First, the <em>root </em>password must be set. The <em>root</em> account is a superuser that has access to all files and commands. Characters that are typed during this section will not be displayed on the screen. Type the new root password and then a second time when prompted.</li>
	<li>Next, FreeBSD will need to configure the network interfaces found on the computer. Select <strong>Enter</strong> to continue. The default options should be used.

<ul>
	<li>Select [ Yes ] to configure IPv4</li>
	<li>Select [ Yes ] to use DHCP to configure</li>
	<li>Select [ Yes ] to configure IPv6</li>
	<li>Select [ Yes ] to try SLAAC</li>
	<li>At this point you will be directed to a menu with Resolver Configuration values, hit <strong>Enter</strong> to continue to the next step.</li>
</ul>
</li>
	<li>The next menu is a large list of regions for time zone configuration. Use the arrow keys to navigate to the correct region and hit <strong>Enter</strong>. Next, navigate to the correct country or region. Finally, identify and choose the correct time zone. Select [ Yes] to confirm.</li>
	<li>A menu to set the correct date will be next, while you can navigate through the menu to set date, choose [ Skip ] if the displayed date is already correct. [ Skip ] the next menu as the time zone was set up in the previous configuration menu.</li>
	<li>The next two menus will be to configure what system services will be started when the system boots. All services are optional and for now select [ OK ] in both menus to continue with the default configuration.</li>
	<li>The next step will be to add a user besides <em>root</em>. Because <em>root </em>has no limits and protection, it is recommended to log in to the system using a user account to limit the damage if a mistake is made (even a typo could be catastrophic).</li>
	<li>When prompted to create a user account select [ Yes ]. Bsdinstall will follow with a series of prompts to customize the account. Below is a quick summary of the information to input. For clarity, text in bold notates when the user should input text and not just use the default option:

<ul>
	<li>Username – username used to log in. <strong>Username is case sensitive and should not contain spaces</strong></li>
	<li>Full name – <strong>The user’s full name</strong></li>
	<li>Uid – user ID (leave this blank)</li>
	<li>Login group – The user’s group (leave blank)</li>
	<li>Invite user into other groups? – Additional groups for the user. <strong>Type: <em>wheel operator video  </em></strong><strong>here, which will assign the user to the wheel (admin), operator, and video groups.</strong></li>
	<li>Login Class – (leave blank)</li>
	<li>Shell – (leave blank)</li>
	<li>Home directory – The user’s home directory (leave blank)</li>
	<li>Home directory permissions – Permissions on the user’s home directory (leave blank)</li>
	<li>Use password-based authentication? – Prompts user to input password at logic (leave blank)</li>
	<li>Use an empty password? – Option to use a blank password, though this is insecure (leave blank)</li>
	<li>Use a random password? – Option for a randomized password (leave blank)</li>
	<li>Enter password – The password for this user. <strong>Characters typed will not show on screen.</strong></li>
	<li>Enter password again – <strong>The password must be typed again for verification.</strong></li>
	<li>Lock out the account after creation? – Option to lock out use (leave blank)</li>
	<li>User will be prompted to review the summary. If a mistake was made enter <em>no</em> and try again. If everything is correct, enter <em>yes</em> to finalize and create the new user. The menu will then ask if the user wants to create further user accounts, for now enter <em>no.</em></li>
</ul>
</li>
	<li>Final configuration: Use the arrow keys to navigate to <em>Handbook </em>and press <strong>Enter</strong> to install the FreeBSD Handbook. Select [ Ok ] to begin installation.</li>
	<li>Navigate to <em>Exit </em>and hit <strong>Enter</strong> to finalize changes. Select [ No ] when asked if further manual configuration is required and [ Reboot ] to complete the FreeBSD installation process.</li>
</ol>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>1.7 Saving Your Configuration:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once FreeBSD has been properly configured, a window will appear asking to reboot. Select “yes” and wait until the FreeBSD booting page appears again. Once this happens, manually close the virtual machine window and select “Power off the machine”.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-4091" src="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802-1024x384.png" alt="" width="573" height="214" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802-1024x384.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802-300x113.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-14at1.23.48PM-e1584822254802.png 1280w" sizes="(max-width: 573px) 100vw, 573px" /></figure>
<p></section></div>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>8 Removing the Installation Disk:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>On the main VirtualBox application, click the the section (on the lower right side of the window) that says “Storage”. A new window should appear showing the storage options.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Under the main “Controller: IDE” there will be two options. One will be the hard disk that VirtualBox created for the system (it will have a square blue hard drive icon) and the other is the original FreeBSD download (with a light blue disk icon). Right click the <em>sub-storage</em> with the disk icon and select “Remove” from the drop-down menu.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-4092" src="https://staging.freebsdfoundation.org/wp-content/uploads/2016/06/ScreenShot2016-06-09at10.52.13AM-e1584822334646-1024x299.png" alt="" width="732" height="214" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Once it is removed, the window should resemble the one pictured above.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>9 Cloning a VirtualBox VM</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Use the Snapshots menu in VirtualBox to Clone the VM. Check the box “Reinitialize the MAC address of all network cards”. We could choose either a Full clone or a Linked clone. We’ll use the Full clone option. Later on in the installfest we’ll use this cloned VM.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.<strong>10 Final Configurations:</strong></h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-paragraph"></p>
<p>Click “Start” with the original VM selected, and the FreeBSD virtual machine should now boot in its configured form. In order to download packages you need to be logged into, or emulate the root user. After logging into the previously created user, enter the following command in the terminal:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ su</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Install the VirtualBox guest addition packages, and configure the startup service configuration:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install emulators/virtualbox-ose-additions</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc vboxguest_enable=YES</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc vboxservice_enable=YES</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>sysrc is a pre-packaged command that allows rc.conf (system configuration to be read on boot) to be edited from the command line, without using a text editor.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">1.11 GUI (Desktop) Prep</h2>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img decoding="async" src="https://upload.wikimedia.org/wikipedia/commons/7/77/Xwin.png" alt="" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Before installing a desktop environment, a graphical user interface (GUI) is needed. The X Window System is an open source GUI that supports FreeBSD and offers a ton of customization and user tools.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To install the Xorg binary package and configure the X Window System:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y xorg</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ee /boot/loader.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>ee(1)</code> is the first text editor we will be using, the following line can be added simply by typing it:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>kern.vty=vt</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Escape and then hit Enter twice to save changes and exit the <code>ee(1)</code> editor:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ee /usr/local/etc/X11/xorg.conf.d/driver-vboxvideo.conf</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Use the same method above and add the following content to the new file:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>Section “Device”</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>          Identifier "Card0"</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>          Driver "vboxvideo"</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>EndSection</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Enter the following commands:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc dbus_enable=YES </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ sysrc hald_enable=YES</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ dbus-uuidgen &gt; /etc/machine-id </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ pkg install -y sudo </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ visudo</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>(we will use another text editor, the vi editor, to edit sudo )</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Within the sudo config type <code>/wheel</code> press <code>Enter</code> and uncomment the line below to allow all members of the wheel group to use sudo (in vi you can type the following to accomplish this task: <code>j0xxZZ</code>) ( pressing j moves down, 0 moves to the beginning of a line, x deletes one character, ZZ is saves and quits)</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ reboot</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="has-text-align-center wp-block-heading">The Guide Continues in Part II!</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center"><a href="https://staging.freebsdfoundation.org/freebsd-project/resources/installfest-how-to-guide-p2/" target="_blank" rel="noreferrer noopener">Follow the link here</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center">The next part will include installing a desktop environment, updating FreeBSD, setting up a FreeBSD jail, as well as using Ansible and Poudriere.</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/installfest-how-to-guide/">InstallFest How-To Guide</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Bulk Port Management With Poudriere</title>
		<link>https://staging.freebsdfoundation.org/resource/bulk-port-management-with-poudriere/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 18:14:49 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11553</guid>

					<description><![CDATA[<p>Poudriere offers a unique way to bundle install and manage large collections of ports with minimal input, this how to guide will introduce the application and how to manage your own system.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/bulk-port-management-with-poudriere/">Bulk Port Management With Poudriere</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: September 10, 2021</strong></p>
<p></section>
<section class="block block-core-separator"></p>
<hr class="wp-block-separator has-css-opacity" />
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 1: Using the Ports Collection to Install Poudriere:</strong></h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9501" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/freebsd_ports-e1585249630722.png" alt="" width="401" height="107" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/freebsd_ports-e1585249630722.png 480w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/freebsd_ports-e1585249630722-300x80.png 300w" sizes="(max-width: 401px) 100vw, 401px" /></figure>
<p></section></div>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>All commands in this section should be run as root, using the <code><a href="https://www.freebsd.org/cgi/man.cgi?su(1)">su(1)</a></code> command will work. You&#8217;ll need to start by installing <code>git</code>:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code><em># pkg install git</em></code></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Then, use <code>git </code>to clone the ports collection into <code>/usr/ports</code>:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># git clone https://git.freebsd.org/ports.git /usr/ports</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Next, build and install Poudriere from the ports collection using:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cd /usr/ports/ports-mgmt/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># make install clean</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Prompts will appear throughout the installation process, stick with the default settings and install the port.</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 2: Configuring Poudriere</strong></h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9504" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/b849d57a.png" alt="" width="255" height="255" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/b849d57a.png 512w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/b849d57a-300x300.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/b849d57a-150x150.png 150w" sizes="(max-width: 255px) 100vw, 255px" /></figure>
<p></section></div>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Poudriere is an extremely powerful tool designed for package production, but can also be used to bulk manage ports. In order to do so, a few small tweaks will need to be made to the configuration before moving forward.</li>
	<li>First, copy and move the configuration file to the correct location with:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cd /usr/local/etc</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cp poudriere.conf.sample poudriere.conf</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Then use the <a href="https://www.freebsd.org/cgi/man.cgi?query=ee&amp;sektion=1"><code>ee(1)</code></a> text editor to edit the copied configuration file:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># ee poudriere.conf</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Arrow keys can be used to navigate down to the line:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>FREEBSD_HOST=_PROTO_://_CHANGE_THIS_</em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Edit the above line, so it instead looks like this: (backspace to delete text)</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>FREEBSD_HOST=ftp://ftp.freebsd.org</code></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Type <code>ESCAPE</code> and then <code>ENTER</code> twice to exit and save changes to the configuration file.</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 3: Set Up a Poudriere Jail</strong></h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9497" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/download-10.png" alt="" width="175" height="185" /></figure>
<p></section></div>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Before continuing, Poudriere will need to fetch and extract its own version of the FreeBSD ports collection. In order to do this, run:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># rehash</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># poudriere ports -c</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>A FreeBSD jail will need to be set up for Poudriere to perform bulk functions. This can be done with the commands:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># mkdir /usr/local/poudriere</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># poudriere jail -c -j 91x64 -v 12.1-RELEASE -a amd64</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>In the above command, <code>91x64</code> identifies the jail, while <code>12.1-RELEASE</code> identifies the FreeBSD version to use. These can be tweaked if a different name or FreeBSD version is required. Just remember to also replace them in the rest of this guide.</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 4: Creating a Bulk List of Ports</strong></h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9840" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/08/Screenshot-2021-08-06-125131.png" alt="" width="389" height="87" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2021/08/Screenshot-2021-08-06-125131.png 922w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/08/Screenshot-2021-08-06-125131-300x67.png 300w" sizes="(max-width: 389px) 100vw, 389px" /></figure>
<p></section></div>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Before continuing, run the following:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cd poudriere.d </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># echo WITH_PKGNG=YES &gt;&gt; 91x64-make.conf</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>The next step will be to create a list of ports for poudriere to compile and maintain, a wide range of ports are available in the FreeBSD ports collection, and poudriere can be used to manage them all. Start with:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cd /usr/local/etc </code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># ee poudriere-list</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>As before, use the <a href="https://www.freebsd.org/cgi/man.cgi?query=ee&amp;sektion=1"><code>ee(1)</code></a> text editor to edit the file, adding a list of ports for poudriere to manage. Above is an example image including Firefox, the i3 windows manager, irssi, and tmux. Ports can be added to the list by using the port origin (category/name).</li>
	<li>Type <code>ESCAPE</code> and then <code>ENTER</code> twice to exit and save changes to the configuration file.</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 5: Configuring Poudriere Installation Options</strong></h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p class="has-text-align-center"><em><code>This step is optional unless manual configuration is needed.</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>While poudriere can be used to automate bulk port management, it still allows users to manually configure each port. However, this step can be done before installation instead of having to be present for the entirety of the process. If, for instance, the user wants to edit <code><a href="https://www.freebsd.org/cgi/man.cgi?query=tmux&amp;sektion=1&amp;apropos=0&amp;manpath=FreeBSD+9.0-RELEASE+and+Ports">tmux(1)</a></code>, use the command:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># poudriere options  -c sysutils/tmux</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Then, using the installation prompts (arrows keys to navigate, space to select) the port can be manually edited. This process can be done for each port that poudriere manages.</li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading"><strong>Step 6: Using Poudriere to Manage Ports</strong></h2>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-9842" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/08/Screenshot-2021-08-06-125500.png" alt="" width="520" height="229" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2021/08/Screenshot-2021-08-06-125500.png 798w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/08/Screenshot-2021-08-06-125500-300x132.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></figure>
<p></section></div>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>With configuration complete, installing the entire list of ports can be done with just one command:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># poudriere bulk -j 91x64 -f poudriere-list</code></em></p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>Poudriere will take some time to complete the bulk process,  but unlike manually building and installing ports, it can do all the work without needing user inputs. Poudriere also offers a text-based visual display of the installation process. It will allow users to have greater control over their ports without sacrificing automation.</li>
	<li>If an update is needed to the port list, poudriere can update the port collection with the commands:</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cd /usr/local/etc</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># poudriere bulk -j 91x64 -f poudriere-list</code></em></p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/bulk-port-management-with-poudriere/">Bulk Port Management With Poudriere</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Test NVDIMM functionality on FreeBSD with QEMU</title>
		<link>https://staging.freebsdfoundation.org/resource/test-nvdimm-functionality-on-freebsd-with-qemu/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 15:53:09 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11552</guid>

					<description><![CDATA[<p>We are actively iterating on adding NVDIMM support to FreeBSD. To test the program without actual NVDIMM hardware, we use the newest version of QEMU which has support of virtual NVDIMM and is not yet available in ports.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/test-nvdimm-functionality-on-freebsd-with-qemu/">Test NVDIMM functionality on FreeBSD with QEMU</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Introduction</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We are actively iterating on adding NVDIMM support to FreeBSD. To test the program without actual NVDIMM hardware, we use the newest version of QEMU which has support of virtual NVDIMM and is not yet available in ports.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Steps</h3>
<p></section>
<section class="block block-core-list"></p>
<ol class="wp-block-list">
	<li>
<ol>
	<li>Install build dependencies<br />
<code>pkg install git python pkgconf bison gmake</code></li>
	<li>Clone source code and update dtc module<br />
<code>git clone https://github.com/qemu/qemu cd qemu git submodule update --init dtc</code></li>
	<li>Build and install<br />
<code>mkdir build cd build ../configure gmake gmake check gmake install</code><br />
The source code (including build) folder can then be deleted after the installation.</li>
	<li>Prepare an image<br />
You can get a FreeBSD snapshot build of 12-CURRENT <a href="https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/12.0/">here</a>, or build your own ones.</li>
	<li>Start QEMU and test the functionality<br />
<code>qemu-system-x86_64 -hda freebsd.img -boot d -machine pc,nvdimm -m 32G,maxmem=100G,slots=10 -object memory-backend-ram,id=mem2,size=10G -device nvdimm,memdev=mem2,id=nv2,label-size=128k</code><br />
(In QEMU:)<br />
<code>acpidump -t | less</code></li>
</ol>
</li>
</ol>
<p></section>
<section class="block block-core-paragraph"></p>
<p> &#8211; Contributed by Guangyuan (Charlie) Yang</p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/test-nvdimm-functionality-on-freebsd-with-qemu/">Test NVDIMM functionality on FreeBSD with QEMU</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Building a Physical FreeBSD Build Status Dashboard</title>
		<link>https://staging.freebsdfoundation.org/resource/building-a-physical-freebsd-build-status-dashboard/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 15:51:46 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11551</guid>

					<description><![CDATA[<p>FreeBSD now has a number of continuous integration jobs on Jenkins CI to build and test FreeBSD on various architectures, and the newly implemented Tinderbox View presents a high-level, simple dashboard to the real-time FreeBSD CI build status.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/building-a-physical-freebsd-build-status-dashboard/">Building a Physical FreeBSD Build Status Dashboard</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Introduction</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD now has a number of continuous integration jobs on Jenkins CI to build and test FreeBSD on various architectures, and the newly implemented <a href="https://ci.freebsd.org/tinderbox/">Tinderbox View</a> presents a high-level, simple dashboard to the real-time <a href="https://ci.freebsd.org/">FreeBSD CI</a> build status.</p>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="953" height="758" class="wp-image-5320" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/tinderbox.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/tinderbox.jpg 953w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/tinderbox-300x239.jpg 300w" sizes="(max-width: 953px) 100vw, 953px" /></figure>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This display is so useful that we wanted a physical version in our office to monitor the build status more easily. What started as a side project during my first few weeks of interning at The FreeBSD Foundation, has become a useful LED display of the current <a href="https://ci.freebsd.org/">FreeBSD CI</a> (continuous integration) build status, and is running 24/7 in the Foundation Kitchener office, proudly running FreeBSD on a BeagleBone Green.</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Prerequisites</h2>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>A working installation of FreeBSD</li>
	<li>BeagleBone Green with a 4GB micro-SD card, a serial cable and Internet connection</li>
	<li>An addressable LED RGB strip. This project uses an APA102 LED strip from <a href="https://www.sparkfun.com/products/14015">Sparkfun</a></li>
</ul>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Steps</h2>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Install FreeBSD on the micro-SD card</h3>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1. Build or download a FreeBSD image</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To get started, you can download an image from the <a href="https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/">FreeBSD Snapshot</a> site with filename labeled as BeagleBone. In this case, we download:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">FreeBSD-12.0-CURRENT-arm-armv6-BEAGLEBONE-20170519-r318502.img.xz
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>then extract it:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">$ unxz FreeBSD-12.0-CURRENT-arm-armv6-BEAGLEBONE-20170519-r318502.img.xz
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>to get the <code>.img</code> image.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You can always choose to build FreeBSD from source code if you want to experience the latest changes for the support of BeagleBone and are comfortable with the process. <a href="https://github.com/freebsd/crochet">Crochet</a> is the tool to use, and you can find a detailed guide on GitHub.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2. Install the image</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The <a href="https://www.freebsd.org/cgi/man.cgi?query=dd&amp;sektion=1">dd(1)</a> utility is used for raw data copying such as, initializing a disk from a raw image.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><code>dd</code> requires specifying <code>if</code> (input file), <code>of</code> (output file) and <code>bs</code> (copy block size). These arguments should be changed to match the actual file and device name.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">$ dd if=FreeBSD-BeagleBone.img of=/dev/da0 bs=8m
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>Specifying a block size is not necessary, but the default setting will result in very slow operation.</em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If you are not sure of which device it is, simply run:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">$ tail /var/log/messages
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>right after inserting the micro-SD, or:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">$ sudo camcontrol devlist</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>to see the corresponding device name.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After the operation finishes, you can insert the micro-SD card into the BeagleBone.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Boot the BeagleBone Green</h3>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1. Connect the serial cable</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A serial cable might not be necessary as you can wait until it boots and try to <code>ssh</code> to it (the system configuration might prevent you from logging in as root with <code>ssh</code> though). However, since BeagleBone Green doesn&#8217;t have an HDMI output, you can see what is going on through the whole booting process with a serial cable, making it much easier to diagnose if something goes wrong.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The serial console of BeagleBone Green is exposed on a 6-pin header.</p>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="533" class="wp-image-5319" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/serial_header.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/serial_header.jpg 800w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/serial_header-300x200.jpg 300w" sizes="(max-width: 800px) 100vw, 800px" /></figure>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="533" class="wp-image-5318" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/serial_connected.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/serial_connected.jpg 800w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/serial_connected-300x200.jpg 300w" sizes="(max-width: 800px) 100vw, 800px" /></figure>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The built-in <a href="https://www.freebsd.org/cgi/man.cgi?query=cu&amp;sektion=1">cu(1)</a> utility can be used for serial communications. <code>cu</code> can only access the <code>/var/spool/lock</code> directory via user <code>uucp</code> and group <code>dialer</code>. Use the <code>dialer</code> group to control who has access to the modem or remote systems by adding user accounts to <code>dialer</code> using <a href="https://www.freebsd.org/cgi/man.cgi?query=pw&amp;sektion=8">pw(8)</a>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">$ sudo pw groupmod dialer -m guangyuan # Use your own username
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Then log out and log in again to make the above change live.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Connect the USB to TTL cable to BeagleBone and computer, then run the <code>cu</code> utility and specify the line speed of 115200 baud.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">$ cu -s 115200 -l /dev/cuaU0 # Or appropriate device
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You won&#8217;t see any output yet.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>Note: Using <code>sudo</code> to use <code>cu</code> is not a good practice, instead you should add the user to the <code>dialer</code> group as above stated, or grant everyone&#8217;s access as an alternative by running:</em></p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><em>$ </em>chmod<em> 4511 /</em>usr<em>/bin/</em>cu</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>For more info about serial communications, see <a href="https://www.freebsd.org/doc/faq/serial.html">FreeBSD Serial Communications</a>.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2. Boot up and log in</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The BeagleBone Black can boot from either the onboard eMMC or a micro-SD card. By default it boots from eMMC. To boot from micro-SD, first hold down the boot switch, then apply power. Don&#8217;t release the button until you see it starts booting FreeBSD (or count to 5).</p>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="700" height="321" class="wp-image-5310" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/bbg_layout.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/bbg_layout.jpg 700w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/bbg_layout-300x138.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /></figure>
<p></section>
<section class="block block-core-paragraph"></p>
<p><small>(image from <a href="http://wiki.seeed.cc/BeagleBone_Green/">http://wiki.seeed.cc/BeagleBone_Green/</a>)</small></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The boot switch is just above the micro-SD slot.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After booting, log in as root (the default password is &#8220;root&#8221; as well).</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>Tip: Making a BeagleBone Black Always Boot From the Micro-SD</em><br />
<em>The AM335x chip on board actually boots from the first partition that has the active flag set. After using the &#8220;holding the boot button&#8221; method described above to boot FreeBSD and log in as root, you will be able to turn off the bootable flag of the onboard eMMC to make it always boot from the micro-SD:</em></p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> <em>$ gpart unset -a active -i 1 mmcsd1
</em></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>To restore this change and make the eMMC available again do:</em></p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><em> $ gpart set -a active -i 1 mmcsd1</em></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>Alternatively, you can copy the FreeBSD image to eMMC so no pressing the button is needed.</em></p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3. Sync system clock</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The system may refuse to proceed on some commands if the system clock is wrong.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>In FreeBSD, it is recommended to use both <code>ntpdate</code> and <code>ntpd</code>. <code>ntpdate</code> will set the clock when you first boot so it&#8217;s close enough that <code>ntpd</code> will work with it. Add the following to <code>/etc/rc.conf</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> ntpd_enable="YES"
 ntpdate_enable="YES"
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Then read through <code>/etc/ntp.conf</code>. It&#8217;s pretty well documented so it should be obvious what to set.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">4. Enable root login via ssh</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Open <code>/etc/ssh/sshd_config</code> and change this line:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> #PermitRootLogin no
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>to:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> PermitRootLogin yes
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>then, restart the <code>ssh</code> daemon:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> $ /etc/rc.d/sshd restart</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>and you will be able to login as root via <code>ssh</code>.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Test the GPIO on board</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Let us start from mastering the control of an external LED.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1. GPIO wiring</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>First let&#8217;s take a look at Beaglebone Green&#8217;s pin map:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><img loading="lazy" decoding="async" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/bbg_pinmap.jpg" alt="" width="800" height="605" /><br />
<small>(image from <a href="http://wiki.seeed.cc/BeagleBone_Green/">http://wiki.seeed.cc/BeagleBone_Green/</a>)</small></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Now we connect a LED and a 200Ω resistor using jumper wires.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><img loading="lazy" decoding="async" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/led_wiring-1024x673.jpg" alt="" width="1024" height="673" /><br />
<small>(image from <a href="https://learn.adafruit.com/blinking-an-led-with-beaglebone-black/wiring">https://learn.adafruit.com/blinking-an-led-with-beaglebone-black/wiring</a>)</small></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The top two connections on the BeagleBone expansion header are both GND. The other lead is connected to a pin of your choice.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2. Send test signals</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>No programming is required at this moment, as FreeBSD provides us with the <a href="https://www.freebsd.org/cgi/man.cgi?query=gpioctl&amp;sektion=8">gpioctl(8)</a> utility which could be used to list available pins and manage GPIO pins from userland.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Let&#8217;s list all the available pins defined by device <code>/dev/gpioc0</code>:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> $ gpioctl -f /dev/gpioc0 -l
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>By default, all the IO pins are set to be inputs. This does not work for our LED. Instead, we need the pin it is connected to be an output, so we configure that:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> $ gpioctl -f /dev/gpioc0 -c 3 OUT # Assuming pin 3 is the one used
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The pin should be output mode now, but the LED should still be off. To turn it on, type:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> $ gpioctl -f /dev/gpioc0 3 1 # Assuming pin 3 is the one used</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Now we have set the logical value of pin 3 to be 1, and the LED is on! To turn it off again, type:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> $ gpioctl -f /dev/gpioc0 3 0 # Assuming pin 3 is the one used
</pre>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="850" height="566" class="wp-image-5316" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/led_up.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/led_up.jpg 850w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/led_up-300x200.jpg 300w" sizes="(max-width: 850px) 100vw, 850px" /></figure>
<p></section>
<section class="block block-core-paragraph"></p>
<p>You can try blinking the LED by writing a bash script with a simple loop.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">SPI bit banging</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Awesome! GPIO is working well with BeagleBone, it&#8217;s time to start using the addressible LED strip.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The LED RGB strip we used is packed with 60 APA102s and can be controlled with a standard SPI interface. However, at this moment, FreeBSD has no userland support for SPI devices. We used <a href="https://en.wikipedia.org/wiki/Bit_banging">Bit banging</a> to simulate the <a href="https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI Protocol</a> as a workaround.</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1. Wire LED strip to the BeagleBone</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p><img loading="lazy" decoding="async" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/apa102_layout.jpg" alt="" width="600" height="600" /><br />
<small>(image from <a href="https://www.sparkfun.com/products/14015">https://www.sparkfun.com/products/14015</a>)</small></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Using the pin map, we connected:<br />
VCC -&gt; SYS_5V<br />
CI -&gt; GPIO of your choice<br />
DI -&gt; GPIO of your choice<br />
GND -&gt; DGND</p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2. Install Python development environment</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We used Python and the <code>fbsd_gpio</code> python bindings for the code. Install Python and <code>pip</code> first, and then <code>cffi</code> and <code>fbsd_gpio</code> libraries via PyPI.</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> $ pkg install python py27-pip
 $ pip install --user cffi fbsd_gpio</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>Note: You may encounter an error when using `pip` which will give an error like:</em></p>
<p></section>
<section class="block block-core-code"></p>
<pre class="wp-block-code"><code>unable to execute '/nxb-bin/usr/bin/cc': No such file or directory</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>This is because FreeBSD uses some cross-compile tools on some embedded platforms (mips, arm, aarch64, etc.) which aren’t used in this setup and will cause build errors. The bug has not been fixed yet (<a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208282">Bug 208282</a>), but in the meantime, we could just change all references in <code>/usr/local/lib/python2.7/_sysconfigdata.py</code> as a workaround:</em></p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><em> $ sed -i '' 's/\/nxb-bin\/usr\/bin\/cc/\/usr\/bin\/cc/g' /usr/local/lib/python2.7/_sysconfigdata.py</em></pre>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3. Write SPI bit banging functions</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>There is a SPI bit banging abstraction in the <code>fbsd_gpio</code> package used below but has not been documented yet. You can use that abstraction and skip this step, or you can still choose to follow it as a good learning practice.</em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Import the library and create a controller:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> from fbsd_gpio import GpioController
 gpioc = GpioController(0) # Using gpio controller unit 0 (/dev/gpioc0)
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Set which pins we are using:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> SCLK = 2 # CI (Blue)
 MOSI = 3 # DI (Green)</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>Note:</em><br />
<em>SCLK: Serial Clock (output from master)</em><br />
<em>MOSI: Master Output Slave Input (data output from master), or DI from LED</em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Provide SPI init and write functions (it&#8217;s better to use bitwise operators when working with bits):</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> def spi_init():
     gpioc.pin_output(SCLK)
     gpioc.pin_output(MOSI)
     gpioc.pin_set(SCLK, 0)
     gpioc.pin_set(MOSI, 0)


 def spi_write_byte(b):
     for i in xrange(7, -1, -1):
         gpioc.pin_set(SCLK, 0)
         gpioc.pin_set(MOSI, (b &gt;&gt; i) &amp; 1)
         gpioc.pin_set(SCLK, 1)


 def spi_write(buf):
     for i in buf:
         spi_write_byte(i)
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>A complete description of <code>fbsd_gpio</code> can be found in the <a href="https://pypi.python.org/pypi/fbsd_gpio/0.4.0">fbsd_gpio documentation</a> on PyPI.</em></p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">4. Work with APA102 LEDs</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once we set up the SPI functions, we were ready to send SPI data, but first we needed to figure out what to send in order to light up the LEDs we want. Follow the <a href="https://cdn-shop.adafruit.com/datasheets/APA102.pdf">APA102 Manual</a> to find out the data format:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><img loading="lazy" decoding="async" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/apa102_format.jpg" alt="" width="860" height="421" /><br />
<small>(image from <a href="https://cdn-shop.adafruit.com/datasheets/APA102.pdf">https://cdn-shop.adafruit.com/datasheets/APA102.pdf</a>)</small></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Each update consists of a start frame of 32 zeroes, 32 bits for every LED, and an end frame of 32 ones. So our send function will most likely to work as follows:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> # Start Frame
 spi_write([0b00000000, 0b00000000, 0b00000000, 0b00000000])

 # LED Frames
 spi_write([0b11111111, 0b00000001, 0b00000000, 0b00000000]) # First LED, brightness full, blue
 ...

 # End Frame
 spi_write([0b11111111, 0b11111111, 0b11111111, 0b11111111])</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Read this article if you want to <a href="https://cpldcpu.com/2014/11/30/understanding-the-apa102-superled/">Understand the APA102 “Superled”</a> better.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Display the status</h3>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">1. Get data from Jenkins</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Many objects of Jenkins provide remote access APIs. We used the provided Python one to get status of all jobs:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> import ast
 import urllib
 JENKINS_URL = "https://ci.freebsd.org/api/python?tree=jobs[name,color]"
 data = ast.literal_eval(urllib.urlopen(JENKINS_URL).read())["jobs"]
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This is how the data will look like:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> {
   "_class" : "hudson.model.Hudson",
   "jobs" : [
     {
       "_class" : "hudson.model.FreeStyleProject",
       "name" : "FreeBSD-doc-head",
       "color" : "blue"
     },
     {
       "_class" : "hudson.model.FreeStyleProject",
       "name" : "FreeBSD-doc-head-igor",
       "color" : "blue_anime"
     },
     ...
   ]
 }
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>And the latest status could be extracted from <code>color</code> attribute in <code>data["jobs"]</code> and stored in a dictionary called <code>status</code>.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em>The Jenkins API manual can be found in the <a href="https://ci.freebsd.org/api/">Jenkins CI API reference</a>.</em></p>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">2. Light up the LEDs</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Recalling the APA102 data format, we wrote some predefined data frames:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> # Variables
 BRT = 224 + 16 # Brightness, 0~31 decimal

 # Predefined data frames
 START_FRAME = [0, 0, 0, 0]
 END_FRAME = [255, 255, 255, 255]
 BLUE_LED_FRAME = [BRT, 1, 0, 0]
 GREEN_LED_FRAME = [BRT, 0, 1, 0]
 RED_LED_FRAME = [BRT, 0, 0, 1]
 YELLOW_LED_FRAME = [BRT, 0, 1, 1]
 OFF_LED_FRAME = [224, 0, 0, 0]
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>and some send functions:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"><code>def led_send_start():</code> <code> 
spi_write(START_FRAME)


</code><code>def led_send_end():</code> <code> 
spi_write(END_FRAME)</code> <code> 


def led_send(status):</code> <code> 
    if status in ["blue", "blue_anime"]:</code> <code> 
        spi_write(GREEN_LED_FRAME)</code> <code> 
    elif status in ["red", "red_anime"]:</code> <code> 
        spi_write(RED_LED_FRAME)</code> <code> 
    elif status in ["dne"]:</code> <code> 
        spi_write(OFF_LED_FRAME)</code> <code> 
    else:</code> <code> 
        spi_write(YELLOW_LED_FRAME)</code> <code> 


def led_send_all(jobs):</code> <code> 
    led_send_start()</code> <code> 
    for job in jobs:</code> <code> 
        led_send(job["status"])</code> <code> 
        led_send_end()</code></pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>so that once we updated the <code>status</code> dictionary, we were able to use <code>led_send(status)</code> to update the display:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> if __name__ == "__main__":
     spi_init()
     while True:
         status = ... # Fetch the data
         led_send_all(status) # Update
         time.sleep(10) # or any other interval
</pre>
<p></section>
<section class="block block-core-heading"></p>
<h4 class="wp-block-heading">3. Let them blink!</h4>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Now the display works really well with the static states of the job. However, we noticed that the <code>blue_anime</code> and <code>red_anime</code> colours in Jenkins, which indicate a project is in the process of building (and should be blinking), were treated as static status in the code.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>How can we make the LEDs blink while keeping their current status? We added a <code>blink_flag</code> boolean inside the loop, reversed it each time, and decided if we should turn the lights off based on that.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Add the flag to the LED updating loop:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> blink_flag = False
 while True:
     status = ... # Fetch the data
     blink_flag = not blink_flag
     led_send_all(status, blink_flag) # Update
     time.sleep(10) # or any other interval
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>and reflect changes in the send function:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted"> def led_send_all(jobs, blink_flag):
     led_send_start()
     for job in jobs:
         if "anime" in job["status"]:
             if blink_flag:
                 led_send(job["status"])
             else:
                 led_send("dne")
          else:
              led_send(job["status"])
     led_send_end()</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We considered splitting the data fetching and the LED updating process, since blinking requires updating the LEDs every 0.5s, but fetching data should be every 20s or even longer. This could be achieved by simply adding a nested loop (for example, 40 led updates, 1 data updates, loop), but I chose to use threading so both jobs will not affect each other if one gets stuck.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Move the LED updating process into a controller class and run it separately:</p>
<p></section>
<section class="block block-core-preformatted"></p>
<pre class="wp-block-preformatted">import threading
class Led_controller(threading.Thread):
    def run(self):
        blink_flag = False
        while True:
            blink_flag = not blink_flag
            led_send_all(status, blink_flag)
            time.sleep(0.5)

if __name__ == "__main__":
    spi_init()
    led_controller = Led_controller()
    led_controller.start()

while True:
    status = ... # Fetch the data
    time.sleep(10) # or any other interval
</pre>
<p></section>
<section class="block block-core-paragraph"></p>
<p>And the LEDs should be able to blink at an interval of 0.5s.</p>
<p></section>
<section class="block block-core-heading"></p>
<h3 class="wp-block-heading">Add some final touches</h3>
<p></section>
<section class="block block-core-paragraph"></p>
<p>We cut the strip to parts and stuck them inside a picture frame.</p>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1200" height="800" class="wp-image-5313" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_1.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_1.jpg 1200w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_1-300x200.jpg 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_1-1024x683.jpg 1024w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1200" height="800" class="wp-image-5314" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_2.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_2.jpg 1200w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_2-300x200.jpg 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_2-1024x683.jpg 1024w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1200" height="800" class="wp-image-5315" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_3.jpg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_3.jpg 1200w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_3-300x200.jpg 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish_3-1024x683.jpg 1024w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>
<p></section>
<section class="block block-core-image"></p>
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="533" class="wp-image-5312" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/finish.gif" alt="" /></figure>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Looking good!</p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Further reading</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>My implementation of this project: <a href="https://github.com/yzgyyang/freebsd-ci-ledstrip">yzgyyang/freebsd-ci-ledstrip</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>FreeBSD&#8217;s support for BeagleBone: <a href="https://wiki.freebsd.org/FreeBSD/arm/BeagleBoneBlack">FreeBSD/arm/BeagleBoneBlack</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>A guide of building, installing and updating FreeBSD on a BeagleBone:<br />
<a href="https://staging.freebsdfoundation.org/wp-content/uploads/2015/12/vol1_no1_beaglebone_dkr.pdf">Getting Started with FreeBSD on BeagleBone Black</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Official BeagleBone Green Document: <a href="http://wiki.seeed.cc/BeagleBone_Green/">BeagleBone Green</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><a href="https://cdn-shop.adafruit.com/datasheets/APA102.pdf">APA102 Manual</a></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><a href="https://cpldcpu.com/2014/11/30/understanding-the-apa102-superled/">Understanding the APA102 “Superled”</a></p>
<p></section>
<section class="block block-core-heading"></p>
<h2 class="wp-block-heading">Thanks</h2>
<p></section>
<section class="block block-core-paragraph"></p>
<p>I would like to thank my supervisor <a href="https://twitter.com/ed_maste">Ed Maste</a> for his guidance and support on my work. I would also like to thank <a href="https://github.com/sivamahadevan">Siva Mahadevan</a>, my colleague and friend, for the help and useful suggestions.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>– Contributed by <a href="http://charlieyang.me/">Guangyuan (Charlie) Yang</a></p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/building-a-physical-freebsd-build-status-dashboard/">Building a Physical FreeBSD Build Status Dashboard</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Easy Minecraft Server on FreeBSD</title>
		<link>https://staging.freebsdfoundation.org/resource/easy-minecraft-server-on-freebsd/</link>
		
		<dc:creator><![CDATA[Anne Dickison]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 15:50:40 +0000</pubDate>
				<guid isPermaLink="false">https://freebsdfoundation.org/?post_type=resource&#038;p=11550</guid>

					<description><![CDATA[<p>A how-to guide for setting up and running a basic Minecraft server on FreeBSD.</p>
<p>The post <a href="https://staging.freebsdfoundation.org/resource/easy-minecraft-server-on-freebsd/">Easy Minecraft Server on FreeBSD</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></description>
										<content:encoded><![CDATA[<section class="block block-classic-editor"><p></section><section class="block block-core-paragraph"></p>
<p><strong>Updated: December 1, 2019</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This page will serve as a guide to setting up a basic Minecraft server on FreeBSD. </p>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Step 1: Choosing the Device</h1>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img decoding="async" class="wp-image-5218" src="https://staging.freebsdfoundation.org/wp-content/uploads/2017/05/freebsd_bootscreen.png" alt="" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Before setting up the server, choose between setting up a dedicated device or a virtual machine running FreeBSD.</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li>A dedicated server will be much more dependable but requires a device completely dedicated to running the server. This option is great if looking for a server with full-time dependability.</li>
	<li>Running the server on a virtual machine will allow the user to run a server without a dedicated device as well as giving the user more control over when the server is running.</li>
</ul>
<p></section>
<section class="block block-core-paragraph"></p>
<p>If the device or virtual machine is already running FreeBSD, continue to the next step. Otherwise, consider one of the Foundation&#8217;s guides to get set up with FreeBSD</p>
<p></section>
<section class="block block-core-list"></p>
<ul class="wp-block-list">
	<li><a href="https://staging.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-with-virtualbox/">Installing FreeBSD with VirtualBox</a></li>
	<li><a href="https://staging.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-as-a-primary-operating-system/">FreeBSD As a Primary Operating System</a></li>
	<li><a href="https://staging.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-for-raspberry-pi/">Installing FreeBSD for Raspberry Pi</a></li>
</ul>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Step 2: Using the Ports Collection</h1>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="480" height="128" class="wp-image-9501" src="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/freebsd_ports-e1585249630722.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/freebsd_ports-e1585249630722.png 480w, https://staging.freebsdfoundation.org/wp-content/uploads/2021/06/freebsd_ports-e1585249630722-300x80.png 300w" sizes="(max-width: 480px) 100vw, 480px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>All commands in this section should be run as root, using the &#8220;su&#8221; command will also work. To download a compressed snapshot of the Ports Collection into /var/db/portsnap:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># portsnap fetch</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>When running Portsnap for the first time, extract the snapshot into /usr/ports:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># portsnap extract</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>After the first use of Portsnap has been completed, as shown above, /usr/ports can be updated as needed by running:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># portsnap fetch update</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Step 3: The minecraft-server Port</h1>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The FreeBSD ports collection has a wide variety of gaming ports available, including a great option for running a basic Minecraft server: the <a href="https://www.freshports.org/games/minecraft-server/">minecraft-server port.</a></p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="476" class="wp-image-7270" src="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-08-at-12.55.02-PM-e1570553879327-1024x476.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-08-at-12.55.02-PM-e1570553879327-1024x476.png 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-08-at-12.55.02-PM-e1570553879327-300x139.png 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/Screen-Shot-2019-10-08-at-12.55.02-PM-e1570553879327.png 1718w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>The first step will be to install the port, now that the ports collection has been added, this can be done simply with the command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># cd /usr/ports/games/minecraft-server/ &amp;&amp; make install clean</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To populate the necessary files, the user will need to execute the program with the command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># minecraft-server</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Next, the user will need to agree to the Minecraft <a href="https://account.mojang.com/documents/minecraft_eula">End User License Agreement (EULA)</a>. This can be done by using the <a href="https://www.freebsd.org/cgi/man.cgi?query=vi&amp;sektion=1">vi command</a>. The following command will bring up the vi text editor:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># vi /usr/local/etc/minecraft-server/eula.txt</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Using the editor (<a href="https://www.freebsd.org/cgi/man.cgi?query=vi&amp;sektion=1">use the manual page if unfamiliar with the edito</a>r) change the 4th line to read:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>eula=true</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The server can then be run with the command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># minecraft-server</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To stop the server:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># stop</code></em></p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Step 4: Identify The External IP Address</h1>
<p></section>
<section class="block block-core-paragraph"></p>
<p>To connect to the Minecraft server over the internet, the user will need the external IP of the device as well as configure the router&#8217;s port forwarding. This process will be different for every single type of router so this guide provides a few links to make this easier.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>First, identify the external IP of the device. A super easy way of doing this is using the <code>wget(1)</code> command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># pkg install wget</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>proceed through the installation, typing &#8216;y&#8217; when prompted. Next, use  <code>wget(1)</code> to pull the IP address from a website that will identify the device&#8217;s external IP.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># wget -qO - http://wtfismyip.com/text</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>This should return an IP that looks similar to &#8220;65.214.224.57&#8221;, however, each set of numbers will be different. This is the external IP address. Other devices will need this string to connect to the Minecraft server.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Step 5: Port Forwarding</h1>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="516" class="wp-image-7293" src="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/1_taIkKo9sDBnhAEZhxqySbQ-1024x516.jpeg" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/1_taIkKo9sDBnhAEZhxqySbQ-1024x516.jpeg 1024w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/1_taIkKo9sDBnhAEZhxqySbQ-300x151.jpeg 300w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/1_taIkKo9sDBnhAEZhxqySbQ.jpeg 1104w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>The next step is to make sure that the router connected to the device is properly forwarding all Minecraft traffic to the device. Even if there are no other computers on the network, this is a required step. Minecraft uses port 25565, so the router needs to be set up to send any traffic on port 25565 to the computer that has the Minecraft server. Router set-up will have to be done in a separate computer with a desktop environment set up.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>Only do this step if on a virtual machine: </strong>Many virtual machines will have the same IP adress as the host computer but will receive none of the incoming traffic. To remedy this, a bridged network adapter will need to be used. This can be changed by opening the virtual machine&#8217;s network settings and switching the network adapter from NAT to bridged. This will give the virtual machine it&#8217;s own unique IP address that can be used to forward traffic. It is important to use this and not the host computer&#8217;s IP address in the next few steps, as traffic will not be correctly forwarded to the Minecraft server.</p>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img loading="lazy" decoding="async" width="641" height="284" class="wp-image-7309" src="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/image319.png.pagespeed.ce_.IFd7Wjcmo4-e1571174652858.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/image319.png.pagespeed.ce_.IFd7Wjcmo4-e1571174652858.png 641w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/image319.png.pagespeed.ce_.IFd7Wjcmo4-e1571174652858-300x133.png 300w" sizes="(max-width: 641px) 100vw, 641px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>During setup, the router will have to identify the correct device to forward traffic to, while many routers will list the devices and the internal IP (different than the one found in step 4), this may not be the case. This IP should resemble  192.168.1.176 and is the number assigned to the device by the router. The command to identify this IP on the device is:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code>$ ifconfig</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Each router will have a unique set-up process for port forwarding. Visit <a href="https://portforward.com/router.htm">portforward.com</a> and select the router model (usually listed on the back of the router). If an ad appears , click CLOSE, the application being advertised is not needed. </p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The next page will have a guide to set-up port forwarding on that model of router, while each router is different, the important ports to forward to the device are listed below:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><strong>TCP: 25565</strong><br />
<strong>UDP: 19132-19133,25565</strong></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>The external and local IP addresses may change when the device is shut down or the modem is reset. Each time the server is restarted, check that these have not changed and update the settings as required.</p>
<p></section>
<section class="block block-core-spacer"></p>
<div class="wp-block-spacer" aria-hidden="true"> </div>
<p></section>
<section class="block block-core-heading"></p>
<h1 class="wp-block-heading">Step 6: Connecting to the Server</h1>
<p></section>
<div class="wp-block-image"><section class="block block-core-image"></p>
<figure class="aligncenter"><img loading="lazy" decoding="async" width="568" height="453" class="wp-image-7302" src="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/minecraft-homeserver-1.png" alt="" srcset="https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/minecraft-homeserver-1.png 568w, https://staging.freebsdfoundation.org/wp-content/uploads/2019/10/minecraft-homeserver-1-300x239.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></figure>
<p></section></div>
<section class="block block-core-paragraph"></p>
<p>Now that the server has been set up, any Minecraft client should be able to connect with the external IP address found in step 4. First, ensure that the server is running on the host device or VM with the command:</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p><em><code># minecraft-server</code></em></p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Next, boot up the Minecraft client on the computer that will be connecting to the server, click <strong>Multiplayer </strong>and then <strong>Direct Connect</strong>, the client will then ask for the server address. This is the external IP found on step 4 of this guide. Clicking <strong>Join Server</strong> will then start the game session.</p>
<p></section>
<section class="block block-core-paragraph"></p>
<p>Once you have started playing on the server you can play around with <a href="https://www.g-portal.us/wiki/Minecraft_server_commands_at_a_glance">server commands</a>, these will be entered in the terminal on the device running the server and can be used to manipulate the game world, game rules, and players allowed on the server. </p>
<p></section><section class="block block-classic-editor"></p></section><p>The post <a href="https://staging.freebsdfoundation.org/resource/easy-minecraft-server-on-freebsd/">Easy Minecraft Server on FreeBSD</a> first appeared on <a href="https://staging.freebsdfoundation.org">FreeBSD Foundation</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
