News from the Machineroom


Sublime Text 3 on FreeBSD

Published:

Besides vim, I occasionally use Sublime Text 3. But for a long time, I wasn’t able to get it working on FreeBSD, although a port using the Linuxulator exists. A few days ago, I finally got around to search for a solution, which I found on the forum.

I recap the process here for future reference.

When starting out, running sublime didn’t produce any output and nothing happened. To get a bit more, “wait mode” can be used with sublime -w, which makes the command block until the file is closed so it can be used as $EDITOR with git. The result was

Unable to init shm

Sublime Text 3 needs /dev/shm, which doesn’t normally exist on FreeBSD, although it can be emulated. To achieve this, I added the following line to /etc/fstab:

tmpfs   /tmp tmpfs   rw,mode=1777 0   0

Mounting something over /tmp while X11 is running doesn’t seem like a good idea, so I didn’t do it immediately. I proceeded with editing the devfs configuration /etc/devfs.conf:

link    /tmp    shm

The forum suggested to restart devfs, I opted to reboot instead, since ssh-agent and X11 have their sockets located in /tmp. And now, Sublime Text works again! This post was still written in vim, though.