1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="light dark">
<title>OpenBASED - Setup OpenBSD as a daily driver using only the included, base programs</title>
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1><a href="/"><span class="title"><i>Open</i><b>BASED</b></span></a></h1>
<hr>
<p>Setup OpenBSD as a daily driver using only the included, core programs. Based on OpenBSD 7.6.</p>
<hr />
<div class="TOC">
<ul>
<li><a href="#requirements">Requirements</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#firstboottweaks">First Boot Tweaks</a>
<ul>
<li><a href="#userpermissions">User Permissions</a></li>
<li><a href="#firmware">Firmware</a></li>
<li><a href="#wifi">WiFi</a></li>
<li><a href="#performanceboost">Performance Boost</a></li>
</ul>
</li>
<li><a href="#loginmanager">Login Manager</a></li>
<li><a href="#thefirstreallogin">The First <em>Real</em> Login</a></li>
<li><a href="#playingwithdefaultpackages">Playing with Default Packages</a>
<ul>
<li><a href="#filesystemmanagement">File & System Management</a></li>
<li><a href="#usertools">User Tools</a></li>
<li><a href="#networking">Networking</a></li>
<li><a href="#security">Security</a></li>
</ul>
</li>
<li><a href="#additionalpackages">Additional Packages</a></li>
<li><a href="#supportopenbsd">Support OpenBSD</a></li>
<li><a href="#contributetoopenbased">Contribute to OpenBASED</a></li>
</ul>
</div>
<h2 id="requirements">Requirements</h2>
<ul>
<li>USB device</li>
<li>Ethernet connection (with active internet)</li>
<li>A cup of coffee</li>
</ul>
<p>The real requirements are having patience and a passion for keeping things minimal. It’s important to remeber that this setup isn’t the most user-friendly. There will be no config files to edit or download in this guide. We will be using the <code>xenodm</code> login manager paired with the default stacked window manager <code>fvwm</code>. And that’s it.</p>
<p>You have been warned!</p>
<h2 id="installation">Installation</h2>
<p>Make sure you have the latest OpenBSD image formatted on a USB device (or burned to a CD if that’s your cup of tea!) and that your computer/laptop is set to boot from USB via the BIOS. Also make sure you are connected to the internet via ethernet cable (don’t worry, we’ll setup WiFi in a minute!)</p>
<p>Boot into the device and input the following when guided through the installer:</p>
<ol>
<li>Boot from USB</li>
<li>Choose <code>Install</code></li>
<li>Keyboard layout: <code>us</code></li>
<li>Hostname: <code>x220</code> (or whatever you choose)</li>
<li>Network: <code>em0</code></li>
<li>IPv4: <code>autoconf</code></li>
<li>IPv6: <code>none</code></li>
<li>Network interface: <code>done</code></li>
<li>Password for root</li>
<li>Start sshd by default? <code>yes</code></li>
<li>X Window System start with xenodm? <code>no</code></li>
<li>Setup user? <code>username</code> (follow setup user steps)</li>
<li>Allow root ssh login? <code>no</code></li>
<li>Timezone</li>
<li>Which disk? Use internal (<code>sd0</code> etc.)</li>
<li>Encrypt root disk? <code>no</code></li>
<li>Use <code>WHOLE</code> disk</li>
<li>Use <code>AUTO</code> layout</li>
<li>Which disk to initialize: <code>done</code></li>
<li>Location of sets: <code>http</code></li>
<li>HTTP Proxy URL? <code>none</code></li>
<li>HTTP Server? <code>1</code> (Toronto)</li>
<li>Confirm again</li>
<li>Server directory? <code>pub/OpenBSD/7.6/amd64</code></li>
<li>Set names? <code>done</code></li>
<li>Drink some coffee while it verifies (depends on network speed)</li>
<li>Location of sets? <code>done</code></li>
<li>Congrats!</li>
<li>Reboot and remove USB device</li>
</ol>
<h2 id="firstboottweaks">First Boot Tweaks</h2>
<h3 id="userpermissions">User Permissions</h3>
<p>Before we do anything, we should give our main user full access via <code>doas</code>. Login as <code>root</code> and run the following:</p>
<pre><code>su -
echo "permit nopass :wheel" >> /etc/doas.conf
exit
</code></pre>
<h3 id="firmware">Firmware</h3>
<p>The next steps will help you ensure you have the latest firmware.</p>
<p>Simply run the command: <code>fw_update</code></p>
<h3 id="wifi">WiFi</h3>
<p>To enable wifi on your device, run the following command (filling in the proper details where need be)</p>
<pre><code>ifconfig iwn0 up
ifconfig iwn0 scan
echo "join WIFI-NAME wpakey PASSPHRASE" >> /etc/hostname.iwn0
echo "dhcp" >> /etc/hostname.iwn0
echo "inet6 autoconf" >> /etc/hostname.iwn0
echo "up powersave" >> /etc/hostname.iwn0
dhclient iwn0
</code></pre>
<p>Take note of the <code>iwn0</code>, as this might differ on your machine. (You can check this by running <code>ifconfig</code>)</p>
<p>You might also need to run <code>doas sh /etc/netstart</code> after.</p>
<h3 id="performanceboost">Performance Boost</h3>
<p>This step is optional and targeted towards devices with batteries (laptops, IoT devices etc). Properly setup apmd:</p>
<pre><code>rcctl enable apmd
rcctl set apmd flags -A
rcctl start apmd
</code></pre>
<h2 id="loginmanager">Login Manager</h2>
<p>Remember when we chose <code>No</code> when the installer asked us “X Window System start with xenodm?”. Well, now we want to enable that before our next reboot:</p>
<pre><code>doas rcctl enable xenodm
</code></pre>
<p>Now reboot your device.</p>
<pre><code>doas reboot
</code></pre>
<h2 id="thefirstreallogin">The First <em>Real</em> Login</h2>
<p>Now you will be presented with the glorious <code>xenodm</code> login screen.</p>
<figure>
<img src="./xenodm-stock.png" alt="Default xenodm login screen">
<figcaption>The beautiful, default xenodm login screen. Image taken from <a href="https://www.tumfatig.net/2019/customizing-openbsd-xenodm/">tumfatig.net</a> (who has some wonderful OpenBSD guides you should check out!)</figcaption>
</figure>
<p>Login with your created user details and you should see something like this:</p>
<figure>
<img src="./fvwm.png" alt="Default fvwm view once logged in">
<figcaption>Taken from the main OpenBSD Wikipedia page. (Some applications will not be opened by default)</figcaption>
</figure>
<p>Absolutely glorious. You’ll also notice a 3x3 grid box in the bottom right corner:</p>
<img src="./pager.png" alt="fvwm workspace pager">
<p>This is called the “workspace pager” or “pager”. Each section represents an individual <em>desktop</em> (or workspace if your more familiar with MacOS terminology). You can click on any grid item to instantly move to that desktop.</p>
<p>You can also navigate around using the <kbd>Ctl</kbd> + <kbd>↑</kbd><kbd>→</kbd><kbd>↓</kbd><kbd>←</kbd> keys.</p>
<h2 id="playingwithdefaultpackages">Playing with Default Packages</h2>
<p>This section isn’t going to explain each and every single useful package included with the base install of OpenBSD. Instead, I highly recommend that you read the documentation associated with each program. You can read these manual pages from your terminal by running <code>man <package-name></code>. Teach a man to fish and all that jazz…</p>
<h3 id="filesystemmanagement">File & System Management</h3>
<ul>
<li><code>cp</code>, <code>mv</code>, <code>rm</code>, <code>mkdir</code>, <code>find</code>, <code>xargs</code>, <code>diff</code>, <code>patch</code>, <code>file</code>, <code>tar</code>, <code>gzip</code>, <code>bzip2</code>, <code>xz</code>, <code>mt</code> – typical file manipulation tools.</li>
<li><code>ls</code>, <code>du</code>, <code>df</code>, <code>stat</code> – for listing and inspecting files and disk usage.</li>
<li><code>vi</code>, <code>mg</code> – text editors (both included; <code>mg</code> is like Emacs-lite, <code>vi</code> is the classic).</li>
<li><code>ed</code>, <code>sed</code>, <code>awk</code>, <code>cut</code>, <code>tr</code>, <code>sort</code>, <code>uniq</code>, <code>paste</code>, <code>tee</code> – text processing tools.</li>
<li><code>rcctl</code>, <code>sysctl</code>, <code>top</code>, <code>ps</code>, <code>kill</code>, <code>nice</code>, <code>renice</code> – process and system control.</li>
<li><code>pkg_add</code>, <code>pkg_info</code>, <code>pkg_delete</code>, <code>pkg_check</code> – package management.</li>
</ul>
<h3 id="usertools">User Tools</h3>
<ul>
<li><code>lpr</code>, <code>lpq</code>, <code>lprm</code> – basic printing.</li>
<li><code>xterm</code>, <code>xcalc</code>, <code>xedit</code>, <code>xmessage</code>, <code>xlock</code>, <code>xwd</code> - great “daily driver” tools shipped with <code>xbase</code></li>
<li><code>xset</code>, <code>xrandr</code>, <code>xmodmap</code> – useful for configuring displays and keyboard/mouse.</li>
</ul>
<h3 id="networking">Networking</h3>
<ul>
<li><code>ftp</code> is a full-featured command-line downloader</li>
<li><code>scp</code>, <code>sftp</code>, <code>ssh</code>, <code>telnet</code> – for remote access and file transfers.</li>
<li><code>ifconfig</code>, <code>hostname</code>, <code>route</code>, <code>netstat</code>, <code>tcpdump</code> – network configuration and inspection.</li>
</ul>
<h3 id="security">Security</h3>
<ul>
<li><code>pass</code> – basic password generator.</li>
<li><code>unveil</code>, <code>pledge</code> – available for programs to restrict access and system calls (helpful for programs like Firefox, 3rd party editors).</li>
</ul>
<h2 id="additionalpackages">Additional Packages</h2>
<p>I would suggest the following packages once you feel like installing “additional”, non-base software:</p>
<ul>
<li>aerc (email client)</li>
<li>Firefox (browser)</li>
<li>ffmpeg (media player/converter)</li>
<li>picom (compositor)</li>
</ul>
<p>These can be installed by running <code>doas pkg_add <package></code> in the terminal.</p>
<h2 id="supportopenbsd">Support OpenBSD</h2>
<p>If you’ve found this guide helpful or even sparked an interest in OpenBSD, please consider <a href="https://www.openbsd.org/donations.html">donating directly to the OpenBSD Project</a>. A little goes a long way, and the OpenBSD Project is a volunteer-driven software group funded by donations!</p>
<h2 id="contributetoopenbased">Contribute to OpenBASED</h2>
<p>I’m far from an OpenBSD expert! Please <a href="https://git.sr.ht/~bt/openbased">help improve this project</a>!</p>
<hr>
<footer>
<p>Project created by <a href="https://btxx.org">Bradley Taunt</a><br>
Running (ironically) on <a href="https://www.nearlyfreespeech.net/contribute/btxx.org">NearlyFreeSpeech</a><br>
<a href="https://codeberg.org/btxx/openbased">Source code</a></p>
</footer>
</body>
</html>
|