<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://jindaxz.github.io/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jindaxz.github.io/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-10-23T16:52:37-07:00</updated><id>https://jindaxz.github.io/blog/feed.xml</id><title type="html">Jinda Zhang</title><subtitle>Research, engineering, and practical notes by Jinda Zhang.</subtitle><author><name>Jinda Zhang</name></author><entry><title type="html">A 2017 MacBook Air as a Linux workstation for automated work</title><link href="https://jindaxz.github.io/blog/macbook-air-linux-workstation/" rel="alternate" type="text/html" title="A 2017 MacBook Air as a Linux workstation for automated work" /><published>2026-10-22T12:00:00-07:00</published><updated>2026-10-23T17:00:00-07:00</updated><id>https://jindaxz.github.io/blog/macbook-air-linux-workstation</id><content type="html" xml:base="https://jindaxz.github.io/blog/macbook-air-linux-workstation/"><![CDATA[<p>I’m using a 2017 MacBook Air as a Linux workstation for automated work, with remote access through AnyDesk. For that setup, I want the machine to stay reachable and remain usable with the lid closed. Two issues needed attention: Wi-Fi that could stay disconnected after a drop, and remote desktop lag when the display powered off.</p>

<p>These are my setup and troubleshooting notes from October 22–23, 2026. The changes are in place; long-running reliability still needs observation.</p>

<h2 id="the-workstation">The workstation</h2>

<p>The machine is a <code class="language-plaintext highlighter-rouge">MacBookAir7,2</code>, running Linux Mint 22.1 XFCE on X11 with kernel <code class="language-plaintext highlighter-rouge">6.8.0-51</code>. It has a Broadcom <code class="language-plaintext highlighter-rouge">BCM4360</code> Wi-Fi adapter using the proprietary <code class="language-plaintext highlighter-rouge">wl</code> driver, and Intel HD Graphics 6000. The lid action is set to do nothing so closing it does not suspend the workstation.</p>

<h2 id="wi-fi-recovery">Wi-Fi recovery</h2>

<p>The goal was to reduce long Wi-Fi outages and recover automatically when the connection gets stuck.</p>

<h3 id="what-the-logs-showed">What the logs showed</h3>

<p>On October 13, NetworkManager recorded a link timeout and “ssid-not-found.” The computer stayed disconnected until the saved network was manually reconnected. That indicates the access point became unavailable to the adapter, but does not by itself prove whether the router, radio conditions, or driver caused it.</p>

<p>On October 19, the log entries were marked “user-requested” and came from the desktop Wi-Fi applet. By the time the machine was inspected, it had reconnected and NetworkManager reported full connectivity. That means the original failure was no longer present in the logs, so its exact cause could not be confirmed. No hardware failure was established.</p>

<h3 id="keep-wi-fi-power-saving-disabled">Keep Wi-Fi power saving disabled</h3>

<p>NetworkManager already had Wi-Fi power saving disabled globally. I also set it explicitly on the saved home-network profile, so the profile continues to use the disabled setting.</p>

<h3 id="update-and-reload-the-broadcom-driver">Update and reload the Broadcom driver</h3>

<p>The installed Broadcom package was behind the available Ubuntu update. I upgraded <code class="language-plaintext highlighter-rouge">bcmwl-kernel-source</code> and <code class="language-plaintext highlighter-rouge">broadcom-sta-dkms</code> to version <code class="language-plaintext highlighter-rouge">6.30.223.271+bdcom-23ubuntu1.3</code>, rebuilt the module for the installed kernel, and reloaded <code class="language-plaintext highlighter-rouge">wl</code>. The update includes a fix for an array-bounds warning that had appeared when the older driver loaded.</p>

<h3 id="allow-either-wi-fi-band">Allow either Wi-Fi band</h3>

<p>I tested band-specific settings, then removed the 5 GHz-only restriction. The saved profile can now use either 2.4 GHz or 5 GHz, so it is not stranded if one band disappears. Automatic connection remains enabled, with unlimited retries.</p>

<h3 id="add-automatic-recovery">Add automatic recovery</h3>

<p>A systemd timer checks connectivity every two minutes. After three consecutive failed checks, it reconnects the saved Wi-Fi profile. If NetworkManager cannot reconnect, it reloads the Broadcom driver and tries again. It waits at least 15 minutes between recovery attempts and does nothing when Wi-Fi has been switched off.</p>

<p>The timer is <code class="language-plaintext highlighter-rouge">wifi-autorecover.timer</code>; its script is <code class="language-plaintext highlighter-rouge">/usr/local/sbin/wifi-autorecover</code>. To inspect it:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl status wifi-autorecover.timer
journalctl -t wifi-autorecover
</code></pre></div></div>

<h3 id="result-and-limits">Result and limits</h3>

<p>At the latest check on October 22, the recovery timer was active and NetworkManager reported the Wi-Fi connection as connected with full connectivity.</p>

<p>This setup is meant to shorten a stuck outage and avoid a manual reconnect. It cannot repair an ISP or router outage, and it has not yet been observed through another long-running failure. The logs do not currently establish that the MacBook’s Wi-Fi hardware is defective.</p>

<p>If it drops again, capturing logs before toggling Wi-Fi will help identify the cause:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli device status
nmcli networking connectivity
journalctl -b -u NetworkManager --since "15 minutes ago" --no-pager
journalctl -k -b --since "15 minutes ago" --no-pager | grep -Ei 'wl|broadcom|wifi|wlan|deauth|timeout|firmware'
</code></pre></div></div>

<h2 id="remote-access-with-the-lid-closed">Remote access with the lid closed</h2>

<p>AnyDesk became laggy when I closed this 2017 MacBook Air’s lid, but felt normal with the lid open. The laptop runs Linux Mint 22.1 XFCE on X11, with an Intel HD Graphics 6000 display adapter.</p>

<h3 id="what-was-happening">What was happening</h3>

<p>The laptop was not suspending. XFCE’s lid action was already set to do nothing, and systemd-logind was configured to ignore the lid switch. The log recorded the lid closing without a suspend event.</p>

<p>The display power state explained the lag. With the lid closed and the machine idle, X reported no active monitors and DPMS had switched the display off. AnyDesk’s log then said it could not find a primary monitor and was falling back to capturing the desktop root.</p>

<h3 id="display-settings">Display settings</h3>

<p>I disabled XFCE display blanking and DPMS on both AC and battery, then restored the internal panel as the primary monitor in the current session:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>xfconf-query <span class="nt">-c</span> xfce4-power-manager <span class="se">\</span>
  <span class="nt">-p</span> /xfce4-power-manager/dpms-enabled <span class="nt">--create</span> <span class="nt">-t</span> bool <span class="nt">-s</span> <span class="nb">false

</span><span class="k">for </span>key <span class="k">in </span>blank-on-ac blank-on-battery <span class="se">\</span>
  dpms-on-ac-sleep dpms-on-ac-off <span class="se">\</span>
  dpms-on-battery-sleep dpms-on-battery-off<span class="p">;</span> <span class="k">do
  </span>xfconf-query <span class="nt">-c</span> xfce4-power-manager <span class="se">\</span>
    <span class="nt">-p</span> <span class="s2">"/xfce4-power-manager/</span><span class="nv">$key</span><span class="s2">"</span> <span class="nt">--create</span> <span class="nt">-t</span> int <span class="nt">-s</span> 0
<span class="k">done

</span>xrandr <span class="nt">--output</span> eDP-1 <span class="nt">--mode</span> 1440x900 <span class="nt">--primary</span>
</code></pre></div></div>

<p>The XFCE settings are saved in the user’s configuration. The <code class="language-plaintext highlighter-rouge">xrandr</code> command reactivated the internal display as the primary 1440×900 output in the running session. The lid remains set to do nothing, and the display brightness is at its lowest setting.</p>

<h3 id="result-and-limits-1">Result and limits</h3>

<p>After the change, the closed-lid session reported one active monitor, <code class="language-plaintext highlighter-rouge">eDP-1</code>, marked primary. I have not yet confirmed performance through another long AnyDesk session or after a reboot, so that still needs observation. If an existing AnyDesk connection continues to look stale, reconnecting should make it detect the active display again.</p>

<h2 id="where-the-setup-stands">Where the setup stands</h2>

<p>The Wi-Fi recovery timer is active, and the latest network check reported full connectivity. After the display changes, the closed-lid session also reported an active primary monitor. Together, these changes address the two problems I encountered while preparing this MacBook Air for unattended work.</p>

<p>The next check is how it behaves through a reboot and an extended period of automated work and remote access. The recovery timer can help with a stuck Wi-Fi connection, but it cannot resolve an ISP or router outage. The display fix also needs a longer AnyDesk session to confirm that the lag stays resolved.</p>]]></content><author><name>Jinda Zhang</name></author><category term="Linux" /><category term="Automation" /><category term="Networking" /><category term="Troubleshooting" /><summary type="html"><![CDATA[Repurposing a MacBook Air with Linux Mint: automatic Wi-Fi recovery and a display power fix for remote access with the lid closed.]]></summary></entry></feed>