Thursday, December 3, 2026

Installing Claude Code on FreeBSD with Linuxulator

Running Claude Code on FreeBSD takes a little extra setup. The approach covered here uses the Linux executable through FreeBSD’s Linux compatibility layer, commonly called Linuxulator.

The setup has three parts: enabling Linuxulator, installing Claude Code, and setting two environment variables for its bundled Bun runtime. I also include a CLAUDE.md configuration to help Claude understand that the host is FreeBSD.

These instructions cover the amd64 Linuxulator approach. FreeBSD is not an officially supported Claude Code platform, and compatibility can change between releases.

1. Enable Linuxulator

As root, install the Rocky Linux userland and enable Linux compatibility:

pkg install linux_base-rl9
sysrc linux_enable="YES"
service linux start

The linux_base-rl9 package installs the Linux userland under /compat/linux. The Linux service loads the necessary compatibility modules and mounts the filesystems Linux applications expect. Setting linux_enable enables it at boot.

You do not need a Linux virtual machine for this setup. Linuxulator lets the Linux executable run using FreeBSD’s kernel.

2. Install Claude Code

The FreeBSD Ports Collection includes misc/claude-code. If a binary package is available in your configured repository, install it as root:

pkg install claude-code

Package availability and versions depend on your FreeBSD release and package repository.

3. Configure the Bun runtime

Add these settings to ~/.shrc, or the appropriate startup file for your shell:

# for Claude
export BUN_JSC_useBBQJIT=0
export BUN_JSC_useConcurrentGC=0

For FreeBSD’s interactive sh, load the changes into your current shell:

. ~/.shrc

For Bash, use the startup file your interactive shell reads, typically ~/.bashrc. For Zsh, use ~/.zshrc. Make sure your login-shell configuration loads the relevant file when necessary.

If you use csh or tcsh, the equivalent settings are:

# for Claude
setenv BUN_JSC_useBBQJIT 0
setenv BUN_JSC_useConcurrentGC 0

What do these settings do?

  • BUN_JSC_useBBQJIT=0 disables JavaScriptCore’s BBQ JIT tier. This setting is part of the documented upstream workaround for running Claude Code through Linuxulator.
  • BUN_JSC_useConcurrentGC=0 disables concurrent garbage collection. It has been reported to avoid a deadlock that can freeze Claude Code during a Linuxulator session.

These are internal runtime options, so they may change as Claude Code’s bundled runtime changes. They must be present in the environment before Claude Code starts. Putting them in CLAUDE.md does not configure the runtime.

Exports in your shell configuration also affect other Bun programs launched from that shell. If you want to restrict the settings to Claude Code, you can instead set them in a dedicated launcher.

4. Start Claude Code

As your regular user, check that the executable starts:

claude --version

Then launch it from your project directory:

cd /path/to/project
claude

Follow the authentication prompts. A successful version check confirms startup, but it does not establish that a full session works. Try several prompts and shell commands, then leave the session idle for a few minutes and try another command.

5. Tell Claude that the host is FreeBSD

There is an important distinction here: Claude Code is running as a Linux executable, but the host operating system is FreeBSD. Runtime platform detection can report Linux, which can lead Claude to suggest Linux-specific commands.

To provide explicit guidance, add the following to ~/.claude/CLAUDE.md for user-wide instructions, or to a project’s CLAUDE.md when the guidance should apply only to that project. Merge it with any instructions already in the file.

## Host operating system

This machine runs FreeBSD. Claude Code itself runs as a Linux
binary through FreeBSD's Linuxulator compatibility layer.

A Linux platform reported by Claude Code or its runtime describes
the executable's ABI. It does not mean the host is a Linux system.

### Shell commands and administration

- Target FreeBSD when suggesting or executing host commands.
- Use `freebsd-version` and `/usr/bin/uname -a` to check the host.
- Use `pkg` for host packages and the FreeBSD Ports Collection when
  a suitable binary package is unavailable.
- Use `service` and `sysrc` for services and startup configuration.
- Expect third-party configuration under `/usr/local/etc`.
- Do not assume systemd, systemctl, apt, dnf, or Linux /proc behavior
  is available on the host.
- Assume base utilities use BSD syntax. Check local manual pages
  before using GNU-specific options, especially for sed, date,
  stat, find, and xargs.
- Inspect installed tools and the current shell before choosing
  commands or shell syntax.

### Linuxulator boundary

- `/compat/linux` contains the Linux compatibility userland.
- Keep host administration separate from Linux userland maintenance.
- Do not install Linux packages into the FreeBSD host.
- Do not assume Linux namespaces, cgroups, containers, or sandbox
  features work through Linuxulator.
- For FreeBSD software development, use the host's native compiler,
  headers, libraries, and build tools unless the project explicitly
  targets Linux.

### Claude Code runtime settings

Launch Claude Code with these environment variables already set:

BUN_JSC_useBBQJIT=0
BUN_JSC_useConcurrentGC=0

Documenting them here does not set them in the running process.
They belong in the shell configuration or launcher.

This gives Claude useful context for choosing commands. It does not change the executable’s platform detection or guarantee that every suggested command will be appropriate.

Troubleshooting

Claude starts but freezes during a session

Confirm that both runtime variables are exported in the shell launching Claude:

env | grep '^BUN_JSC_'

You should see:

BUN_JSC_useBBQJIT=0
BUN_JSC_useConcurrentGC=0

Exit any existing Claude session and restart it after setting the variables. An already-running process will not pick up changes made to your shell environment.

The executable fails to start

Check that Linux compatibility is loaded and the Linux userland is installed:

kldstat
pkg info linux_base-rl9
ls /compat/linux

If needed, start the Linux service as root:

service linux start

Claude suggests Linux commands

Confirm that your FreeBSD instructions are in the appropriate CLAUDE.md file. Ask Claude to check the host with freebsd-version before making operating-system-specific changes.

Record your working versions

When troubleshooting or sharing results, capture the FreeBSD release, architecture, and installed package versions:

freebsd-version -ku
uname -m
pkg info claude-code linux_base-rl9
claude --version

A working configuration is tied to both the FreeBSD environment and the Claude Code runtime. Recording those versions makes future compatibility problems easier to compare.

References

Sunday, August 3, 2025

What’s in My Electronics Travel Bag (2025 Edition)

Whether I’m bouncing between Baltic capitals or off the grid in East Africa, staying connected, charged, and organized is critical. I’ve refined my tech travel kit over years of trial and error, and this post breaks down exactly what I carry and why. Below is a look inside my electronics bag — thoughtfully curated for performance, versatility, and airline compliance.

🔌 The Bag That Holds It All

BAGSMART Electronics Organizer Travel Case
This zippered pouch keeps the small pieces in place while the elastic holders keep all my cables, chargers, and adapters neatly arranged and accessible. It’s compact enough to slip into my backpack but holds more than you'd think. A must-have for every tech-forward traveler.



⚙️ Adapters & Cables

QianLink USB-C Female to USB Male Adapters (2-pack)
Perfect for connecting newer USB-C cables to older USB-A ports. Small, reliable, and invaluable in hotels or airports with legacy outlets.

Apple USB-C to USB Adapter
Apple’s version — pricier, but always dependable when I need stable performance with my MacBook Air.

⚡ Charging Essentials

4-Port USB Wall Charger
I use a compact international-compatible charger that powers multiple devices at once.

Apple Watch Magnetic Fast Charger (USB-C)
Small, durable, and essential for my Apple Watch Series 8. Charges fast via USB-C.

Anker 325 Power Bank (PowerCore 20K)
Massive 20,000mAh capacity keeps my phone, iPad, or even GoPro juiced up for days.
💡 Note: Be aware of airline restrictions — most allow under 100Wh, and this one clocks in just under.

SanDisk MobileMate USB 3.0 microSD Card Reader
Transfers GoPro footage to my MacBook quickly, no software needed.

Apple 30W USB-C Power Adapter
Lightweight and powerful — charges MacBook Air with ease.

AINOPE USB-C Cable
Fast-charging, braided for durability, and long enough to reach those awkward hotel outlets.

Other cables I always pack:

  • USB-A to microUSB
  • USB-A to USB-C
  • USB-A to Lightning
  • USB-C to Lightning

📱 Electronics I Travel With

iPhone 14 Pro
Excellent camera, long battery life, and MagSafe compatibility — my essential daily device.

M1 MacBook Air
Light, powerful, and silent. Perfect for editing photos, writing code, or booking last-minute flights.

Laptop Sleeve Case
Protects the MacBook from TSA bins and turbulent transit.

iPad 7th Gen
Used mainly for reading, journaling, or inflight entertainment. Still going strong.

GoPro HERO10 Black
My adventure cam — great for water, action, and compact vlogging.

AirPods Pro 2
Great noise cancellation and transparency mode. Perfect for both plane rides and walking tours.

Sony WH-1000XM4
Still the gold standard in over-ear noise cancelling. Incredible for long-haul flights.

Apple AirTags
One lives in my backpack, one in my carry-on, and another in my checked bag (if I'm checking). Lifesavers for any travel anxiety.

Apple Watch Series 8
Great for fitness tracking, contactless payments, and staying hands-free on the move.

🧠 Final Thoughts

This kit has kept me powered and productive across continents. It’s lean but complete — and most of it fits in one organizer pouch. If you’re building your own tech travel setup, hopefully this gives you a helpful starting point.

Got questions or want to share what’s in your bag? Drop a comment below.

Happy travels and smooth charging!

Wednesday, December 15, 2021

Perfect Finishing Touch on KDE

My favorite finishing touch to get KDE "Just Right" is to set the Application Launcher icon to match the icon of the operating system that is running (which of course is FreeBSD).  The first thing to do is obtain the image we want to use.  A nice set of icons to use can be found at: https://store.kde.org/p/1120013/

Double click the downloaded file to open with Ark or from the command line, expand with something like:

# gzcat 112422-freebsd_kde4menu.tar.gz | tar -xvf -

Next, simply right click on the Application Launcher and choose Configure Application Launcher...




From the Application Launcher Settings screen, click the icon and select Choose... 



Browse to the location where you extracted the icons.  On a 1920x1080 screen, the 42x42 icon is about the right size.  


Select Apply and OK and there we have it!



Saturday, December 11, 2021

Installing OpenBSD in bhyve on TrueNAS Core

Installing the BSDs

The bhyve functionality in TrueNAS Core provides a simple interface for creating virtual machines.  FreeBSD works very smoothly (as may be expected since bhyve was originally written for FreeBSD).  Creating virtual machines for the other members of the BSD family is slightly less straightforward.  There exist good resources for getting NetBSD installed (9.x here, and you can make that work with 8.x by following this).

OpenBSD

There are a couple of older resources to get OpenBSD installed on a TrueNAS Core virtual machine.  But they seem either out of date or somewhat more complicated than I found necessary.

Preparing the Disk

We can't install the OpenBSD operating directly on a virtual disk created by the VM Wizard.  So, we need to manually create a zvol to use.  In the TrueNAS interface, go to Storage > Pools and browse to the location where the rest of your virtual machine zvols are.  Click the three-dot menu on the right of the filesystem and select Add Zvol.  Give the new zvol a name and a size.  Defaults are fine choices for everything else.

Add Zvol

The next thing we need to do is dd the minirootXY.img file to the newly created zvol.  These are readily available for download for each release from the OpenBSD website here.  You can download manually, or simply use fetch:

# fetch https://cdn.openbsd.org/pub/OpenBSD/7.0/amd64/miniroot70.img

Next, we use dd to write that to the zvol we created above:

# dd if=/mnt/tank/files-local/OS_Images/OpenBSD/amd64/7.0/miniroot70.img of=/dev/zvol/tank/virtual-machines/openbsd7dot0test1 bs=1m 


Creating the Virtual Machine

Now that we have manually created the disk, the rest of the installation process is fairly standard (although, console-based).

You can create a virtual machine using the Wizard.  Most default options are fine.  On Step 1 Operating System, we can unselect Enable VNC since we need to do a text-based install from the console.  On Step 3 Disks, we need to choose Use existing disk image and set Select Disk Type to VirtIO.  Now, under Select Existing zvol, we choose the zvol we created above.


Set Adapter Type on Network Interfaces to VirtIO as well.  Leave the Installation Media blank since we already have in place what we need to boot (the result from dd above).  And then on Confirm Options, click Submit.

Booting the Installation

Now, we can start the virtual machine.  Expand the details and click Start.  Once the button is available, click on Serial.  From here, we need to get the output on our serial connection.  At the boot> prompt, issue the command: set tty com0

We should be back to the boot> prompt now.  Simply issue the command: boot


Installation

From here, we can do a pretty standard installation of OpenBSD.  After selecting the root disk, we do need to manually edit the bootable partition.  We use (E)dit and then edit 3 to edit the bootable partition.


Leave the defaults until we get to partition size.  By default, we get a pretty small partition.  The size you choose here depends on the size of the zvol you created earlier.  It's easy enough to just use the max size here.


Once that's set, we type quit and then use the auto layout (or custom if you so desire).  From here, all the defaults are fine.  Since the filesets didn't come with the img we downloaded, we'll need to specify the HTTP Server to get them from.  If it's not pre-populated, you can use cdn.openbsd.org

Once all filesets have been installed, we can then reboot.

Validating

At this point, we should have a functioning OpenBSD installation that we can access via ssh!



Installing Claude Code on FreeBSD with Linuxulator

Running Claude Code on FreeBSD takes a little extra setup. The approach covered here uses the Linux executable through FreeBSD’s Linux compa...