Visual Studio Code w/ remote-ssh Plugin & FreeBSD
It was just my first try to test Visual Studio Code with the remote-ssh plugin. Unfortunately, I decided to test it on my servers which are running FreeBSD and immediately failed to connect:
Warning: no access to tty (Bad file descriptor).
> Thus no job control in this shell.
This plugin does not work out of the box with BSD based systems but we can make it work by some server- & client changes.
Let us start on the FreeBSD server by using linuxulator:
# Install linux base libs
pkg install linux_base-c7
# Start Linuxlator
/etc/rc.d/linux start
# Enable Linuxlator on start
echo 'linux_enable="YES"'" >> /etc/rc.conf
Next, we need to adjust the client’s ssh config and the Visual Studio Code (vscode) config.
Edit your local ssh config and add the following option block to your host:
RemoteCommand /compat/linux/usr/bin/bash
RequestTTY force
Afterwards adjust the config.json in Visual Studio Code to enable remote commands:
{
"remote.SSH.enableRemoteCommand": true,
}
Afterwards, you are able to connect to your FreeBSD host by using the remote-ssh plugin.