This procedure was tested on FreeBSD-CURRENT build from d8819d88af52.
-
Enable linuxulator and install linux userland:
# sysrc linux_enable="YES" # service linux start # pkg install linux_base-c7
Test it:
$ /compat/linux/usr/bin/uname -a Linux monster-1 4.4.0 FreeBSD 14.0-CURRENT #1 main-n254392-d8819d88af52: Wed Apr 6 22 x86_64 x86_64 x86_64 GNU/Linux
For more details on linuxulator setup please refer to handbook.
-
remote-ssh seem to ignore bash config files so we need to change
$PATH
in/etc/login.conf
or send custom env withSetEnv
directive inssh_config
. Choose which fits you better.By default it's class
default
, we need to give priority to linux binaries::path=/compat/linux/usr/sbin /compat/linux/usr/bin /sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\
rebuild CAP database:cap_mkdb /etc/login.conf
Host your-freebsd.box SetEnv PATH="/compat/linux/usr/sbin:/compat/linux/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
-
Set you normal PATH for your every day use in your shell's config file (.bashrc od .zshrc, etc)
-
Connect to your FreeBSD box with VScode's remote SSH extension!
Thanks for the addition! I should have mentioned I've only tried these steps on Linux and (x86-64) macos. I also have this setting in my vscode config:
Maybe you are missing that? Either that or the SSH client on Windows just works differently.
I assume you are running an arm64 FreeBSD image in an VM? That the problematic symlink would be different makes sense. I would look at the error message (if any) that is printed after attempting to run
/compat/debian/bin/bash
and try to figure out the appropriate fix from there. Although it does read as if you are not getting any error at all and in the arm64 version the symlinks are just not broken. Other than that I have no clue, I've never tried to run arm64 FreeBSD.