The bmannconsulting.com website
1---
2tags:
3 - homelab
4---
5I’m going to go over a lot of the yak shaving I did to set up the [[Lenovo M900 Tiny]].
6
7## Different Specs
8
9As noted [[2024-01-19_1306]], I received a different spec. Booting into windows and the overview showed me:
10
11```
12Processor Intel(R) Core(TM) i5-6600T CPU @ 2.70GHz 2.71 GHz
13Installed RAM 8.00 GB (7.89 GB usable)
14```
15
16Looking at the hard drive, it's 1TB.
17
18And my [Amazon order](https://www.amazon.ca/gp/product/B07ZPBDFGD/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&th=1) was supposed to be "Quad-Core i5-6500T, 16 GB DDR4, 480 GB SSD, Intel Graphics, USB, WiFi, Windows 10 pro 64 Bit"
19
20There also isn't any Wifi in the one I received.
21
22So, half the RAM, faster processor, twice the hard drive space, and no Wifi. I will probably just keep it, but feels like less RAM will be a challenge.
23
24## Initial Unboxing
25
26This is going to sit right next to my [[Unifi Dream Machine]] router plugged in via Ethernet, which is right at the front of our apartment. There’s a portable monitor there, but it only has USB-C as video input.
27
28This m900 has two DisplayPort connections and…a VGA connector. Maybe I can use my old projector as a screen? But no, I don’t have a female VGA cable, just male-to-male. Maybe this USB B (projector side) to USB-A will …just work if I plug it in?
29
30What kind of adapters do I have? Should I plug it into the TV temporarily???
31
32I had to take it into my back office (which only has wireless and this only has Ethernet) to plug it into the DisplayPort of my monitor.
33
34I’ll unplug the monitor from the USB-C KVM Switch (because I’m only going to have modern machines that all have USB-C, right), and also get my desktop keyboard and mouse out of the switch and directly into the m900.
35
36I’m booting into Windows and it wants the Internet.
37
38OK, can I plug it into my MacBook Air and bridge into its wifi? My USB-C adapter dongle doesn’t have Ethernet. Does the one I gave to Rachael have Ethernet? It does!
39
40Is this even going to work? (searches for Mac Internet Sharing) Yes this is built into System Preferences -> Sharing. Do I know which interface this Ethernet adapter is? No, just enable them all.
41
42OK, it works!
43
44Now we have various times of ignoring all the Microsoft upsells and ask for information (this is Windows 10 Pro) and we get to a desktop. I have a Microsoft Account with some paid family plan stuff so I’m in.
45
46Updates, turn on Remote Desktop. Let’s see if this works? It does not, because of the Ethernet to Mac sharing wifi, the m900 is double NAT-d.
47
48Read some stuff about dual booting Ubuntu and Windows. Actually I search for it - in Microsoft Edge so I guess this is Bing - and it gives me sort of a ChatGPT interface with the answer. The links go to the most horrendous ad-filled pages but I kind of squint at the info.
49
50I don’t really need Windows on here but let’s keep it around just in case. Shrink the C partition to 200GB, leaving 750GB for Ubuntu. The wording in this dialog is bad. “Shrink by” is asking you how much smaller. “Shrink to” would make more sense to me.
51
52Download a server image and [unetboot](https://unetbootin.github.io/). Apparently Ubuntu recommends [Rufus](https://rufus.ie/en/) for this.
53
54Burn image to USB key. I ordered a new USB key at the same time as the m900, knowing at least I would need a spare or so for this.
55
56Attempt to follow instructions on disabling UEFI secure boot.
57
58## Installing Ubuntu
59
60Researched various Lenovo things. `F12` is what you need to press in order to get into firmware and boot settings.
61
62Selected the USB key to boot from.
63
64Chose the [Ubuntu Server install](https://canonical-subiquity.readthedocs-hosted.com/en/latest/tutorial/screen-by-screen.html)
65
66Got to the storage section and the 750GB unformatted part of the drive wasn't visible. The [server storage guide](https://canonical-subiquity.readthedocs-hosted.com/en/latest/explanation/configure-storage.html#configure-storage) says:
67
68> The installer cannot edit partition tables. You can use existing partitions or reformat a drive entirely, but you cannot, for example, remove a large partition and replace it with two smaller ones.
69
70Went into the help menu and got into the terminal. Thought about it for a bit and looked at some partition formatting links (all of the defaults show a graphical editor), and decided to boot back into Windows.
71
72In Windows, formatted the the 750GB, then booted back into the installer.
73
74Used LVM, made `/` root of 30GB, swap of 20GB, remaining as `/home`
75
76Install was very quick. Named the server `tinyhome`.
77
78There's an option to add SSH keys from Github. Entered my username and it fetched a couple of keys.
79
80Rebooted to Grub menu, then on to commandline login. Can I get it to automatically boot into Ubuntu? It's going to be running headless.
81
82Read some [background on Grub settings](https://ubuntuforums.org/showthread.php?t=1195275). Tried to get it to boot into Ubuntu / last saved OS by default with a short 3 second time out.
83
84`sudoedit /etc/default/grub`
85
86`sudo update-grub`
87
88None of the things I applied and rebooted did anything other than bring me back to a menu with a 30s countdown that defaults to Ubuntu. OK fine!
89
90Moved to living room and rebooted. Had previously set the router to give this device the same IP address.
91
92Logged in with my ssh keys. Success!
93
94Oh oh. Revving, **screaming** fan noises that ramp up and down. Searched a bunch of things, and now...fan noises have gone away.
95
96Need to do more research, because having it screaming in the corner of the living room is not going to be OK.[^livingroom]
97
98[^livingroom]: It's in the living room, because that's where the cable connector for my Internet comes out, and where the router is plugged in.
99
100## Fan Control in Ubuntu
101
102Found page on [controlling fan speed in Ubuntu](https://askubuntu.com/questions/22108/how-to-control-fan-speed).
103
104```
105sensors-detect version 3.6.0
106
107# System: LENOVO 10FLS02D00 [ThinkCentre M900]
108# Board: LENOVO 30D0
109# Kernel: 5.15.0-91-generic x86_64
110# Processor: Intel(R) Core(TM) i5-6600T CPU @ 2.70GHz (6/94/3)
111
112This program will help you determine which kernel modules you need
113to load to use lm_sensors most effectively. It is generally safe
114and recommended to accept the default answers to all questions,
115unless you know what you're doing.
116
117Some south bridges, CPUs or memory controllers contain embedded sensors.
118Do you want to scan for them? This is totally safe. (YES/no):
119
120Driver `coretemp':
121 * Chip `Intel digital thermal sensor' (confidence: 9)
122Driver `nct6683':
123 * ISA bus, address 0xa20, Chip `Nuvoton NCT6683D eSIO' (confidence: 9)
124
125To load everything that is needed, add this to /etc/modules:
126
127#----cut here----
128
129# Chip drivers
130
131coretemp
132nct6683
133
134#----cut here----
135
136If you have some drivers built into your kernel, the list above will
137contain too many modules. Skip the appropriate ones!
138
139Do you want to add these lines automatically to /etc/modules? (yes/NO)
140```
141
142Ran `pwmconfig`:
143
144```
145/usr/sbin/pwmconfig: There are no pwm-capable sensor modules installed
146```
147
148Did some research. Found [this thread](https://github.com/vmatare/thinkfan/discussions/215) with this comment from January 2023:
149
150> On an M900 I had to force the kernel to load the nct6683 driver as stated here: [https://bugs.launchpad.net/ubuntu/+source/lm-sensors/+bug/1858369](https://bugs.launchpad.net/ubuntu/+source/lm-sensors/+bug/1858369)
151
152So apparently I can force a kernel module to load, but getting various permission errors.
153
154```
155echo "options nct6683 force=1" >> /etc/modprobe.d/sensors.conf
156```
157
158OK, you really do need to be `root`, so `sudo su` it is.
159
160### Fan Screaming
161
162The fans are screaming this morning, so trying this again. This is applied after reboot, running `pwmconfig` now gives some output:
163
164```
165Found the following PWM controls:
166
167 hwmon2/pwm2 current value: 243
168
169/usr/sbin/pwmconfig: line 180: hwmon2/pwm2: Permission denied
170
171Giving the fans some time to reach full speed...
172
173Found the following fan sensors:
174
175 hwmon2/fan2_input current speed: 7017 RPM
176```
177
178The fans really are too loud, and 7017 RPM is a lot.
179
180Research links:
181* older ubuntu, very extensive <https://ubuntuforums.org/archive/index.php/t-42737.html>
182* odroid related <https://forum.odroid.com/viewtopic.php?t=41911>
183* archlinux <https://bbs.archlinux.org/viewtopic.php?id=225349>
184
185Running `sensors`:
186
187```
188nct6683-isa-0a20
189
190Adapter: ISA adapter
191
192VIN0: 1.42 V (min = +0.00 V, max = +0.00 V)
193
194VIN1: 1.02 V (min = +0.00 V, max = +0.00 V)
195
196VIN3: 704.00 mV (min = +0.00 V, max = +0.00 V)
197
198VIN0: 1.42 V (min = +0.00 V, max = +0.00 V)
199
200fan2: 6936 RPM (min = 500 RPM)
201
202PECI 0.0: +28.5°C (low = +0.0°C)
203
204 (high = +99.0°C, hyst = +0.0°C)
205
206 (crit = +0.0°C) sensor = Intel PECI
207
208PCH CHIP: +0.0°C (low = +0.0°C)
209
210 (high = +0.0°C, hyst = +0.0°C)
211
212 (crit = +0.0°C)
213
214Diode 0 (curr): +28.5°C (low = +0.0°C)
215
216 (high = +0.0°C, hyst = +0.0°C)
217
218 (crit = +0.0°C) sensor = thermal diode
219
220Diode 1 (curr): +121.5°C (low = +0.0°C)
221
222 (high = +50.0°C, hyst = +0.0°C)
223
224 (crit = +0.0°C) sensor = thermal diode
225
226intrusion0: OK
227
228beep_enable: disabled
229
230
231
232acpitz-acpi-0
233
234Adapter: ACPI interface
235
236temp1: +27.8°C (crit = +119.0°C)
237
238temp2: +29.8°C (crit = +119.0°C)
239
240
241
242coretemp-isa-0000
243
244Adapter: ISA adapter
245
246Package id 0: +29.0°C (high = +84.0°C, crit = +100.0°C)
247
248Core 0: +26.0°C (high = +84.0°C, crit = +100.0°C)
249
250Core 1: +26.0°C (high = +84.0°C, crit = +100.0°C)
251
252Core 2: +24.0°C (high = +84.0°C, crit = +100.0°C)
253
254Core 3: +27.0°C (high = +84.0°C, crit = +100.0°C)
255```
256
257Temperatures aren't high, but fan2 is at 6900-7000+ RPM.
258
259So kernel driver is <https://www.kernel.org/doc/Documentation/hwmon/nct6683>
260
261Maybe I need to flash BIOS? Found something that relates to [M900 BIOS and fan control issues](https://support.lenovo.com/ca/en/solutions/ht500771-fan-control-issue-thinkcentre-thinkstation)
262
263Checking BIOS under Ubuntu with `dmidecode | less`:
264
265```
266BIOS Information
267 Vendor: LENOVO
268 Version: FWKTBFA
269 Release Date: 06/23/2022
270 Address: 0xF0000
271 Runtime Size: 64 kB
272 ROM Size: 16 MB
273
274System Information
275 Manufacturer: LENOVO
276 Product Name: 10FLS02D00
277 Version: ThinkCentre M900
278 Serial Number: XXXXXXX
279```
280
281Looks like [updated BIOS from July 2022 is available](https://pcsupport.lenovo.com/ca/en/products/desktops-and-all-in-ones/thinkcentre-m-series-desktops/thinkcentre-m900/downloads/ds105487), but I need to boot back into Windows to apply.
282
283### Fan BIOS Update
284
285Unplugged everything from the living room and brought it back to plug in monitor and booted into Windows.
286
287Applied the updated BIOS and grabbed a few other drivers from the Lenovo site.
288
289Sitting at around 1000 rpm and not really audible when sitting on top of the desk. Brought it back out to the front of the apartment.
290
291Silent? Can’t hear it? Fingers crossed that fixed it!
292## Server Management Install
293
294Decision point: [[Cloudron]] or something else?
295
296Looking at [[Coolify]] again, it needs Debian as the "admin", and also it is still quite a new system. I would probably try the hosted Coolify at $5/month as the admin controller.
297
298[[Easypanel]] is proprietary, but maybe not that different from [[Cloudron]]?
299
300## Cloudron Install
301
302OK, let's [install Cloudron](https://www.cloudron.io/get.html). It has a [Home Server Installation in the docs](https://docs.cloudron.io/installation/home-server/).
303
304Found my public IP address. Let's see if I can connect to it after a reboot.
305
306Connected via the `home.bmann.ca` "local" DNS setting that I put into the Unifi router settings.
307
308On the Domain Settings screen. Not really sure what to pick here. I guess I can pick either manual or wildcard. Or, I can use Cloudflare API and let it manage parts of `bmann.ca` that are already being managed by [[Commons Computer]] install.
309
310[Cloudron Private DNS settings](https://docs.cloudron.io/networking/#private-dns)
311
312OK, sure, let's go straight to advanced mode and setup some local addresses.
313
314```
315local-zone: bmann.ca." typetransparent
316local-data: "home.bmann.ca. A 192.168.1.67"
317local-data: "my.home.bmann.ca. A 192.168.1.67"
318```
319
320Sure, let's setup Cloudflare and see what happens. Make a new API token with access to `bmann.ca`, setup `home.bmann.ca` as the domain, and `my.home.bmann.ca` would be where the panel ends up.
321
322Get an error: `queryNs ECONNREFUSED bmann.ca`, search for cloudron: <https://forum.cloudron.io/topic/2008/queryns-econnrefused-cloudron-intra-example-org>
323
324Doesn't like NoOp either `Unable to detect IPv4. API server (ipv4.api.cloudron.io) unreachable`
325
326OK, none of this is going to work until I port forward. Let's go look at Unifi Router.
327
328Port forwarding for tcp/80 and tcp/443 setup to the internal IP address of the server. Confirm that I can get to the Cloudron setup page from the public address.
329
330## Cloudron Install Part 2
331
332OK, I turned off that Unifi local DNS of `home.bmann.ca`, and undid all of the private DNS settings. Accessing Cloudron from the public IP address, and it is being forwarded to the server.
333
334Now setting this as the domain, with Cloudflare API key. I'm in, Cloudron installed.
335
336Enabling [Dynamic DNS](https://docs.cloudron.io/networking/#dynamic-dns) under Network settings -- Cloudron will use my Cloudflare API key to update the public address if my home connection IP changes.
337
338Setting up backup. [[Commons Computer]] uses my Digital Ocean account, but I recall that I have a [[Storj]] account, which is decentralized file storage. There is a free tier, and even at the paid tier it has 25GB included for free. I upgraded to a pro paid account by sending some STORJ tokens via Ethereum[^tokens].
339
340[^tokens]: went to [Uniswap](https://app.uniswap.org), swapped some Ethereum for 100 STORJ (about $60USD). Sent 50 STORJ to the receiving address Storj gave me, once it was confirmed they credited me 55 STORJ (10% bonus for paying with tokens).
341
342OK, we're up and running. I don't really have a plan for this machine, other than it's _inside_ my home. Let's setup a `home` group for permissions, which just has my `boris` user in it. I might give some other people accounts on Cloudron, but they shouldn't have access to this home group.
343
344I guess I'll start by just creating a [[Surfer]] app running, for static file serving and WebDAV, right at the base domain <https://home.bmann.ca>.
345## Ampache Install
346
347On [December 28th](https://bmannconsulting.com/journal/2024-12-28-0121/), I did an [[Ampache TinyHome Install]].
348
349This is still a free Cloudron install, limited to 2 apps, so I have a [[Surfer]] install, and now this Ampache setup.
350
351Yes, I'd like to get a [[PDS]] running locally at home, too, and ideally packaged for Cloudron.
352