Q&A: Enabling automatic X11 forwarding

Last updated: June 25, 2026

Question

I'm testing something in our Coder that is launching a native UI. I can manually ssh -X from my local machine to turn on X11 forwarding and that works. I was wondering if there was a config option somewhere so that just opening VSCode to my Coder enables that?

Answer

There are two settings that are enabled for automatic X11 forwarding.

  • ForwardX11 yes
  • ForwardX11Trusted yes

If you add these values to the plugin's coder.sshConfig setting, they will be added to the generated config. The plugin rewrites the configuration each time you connect, so any manual edits would be undone.

You can use the coder config-ssh with the --ssh-option or -o flag to add these values to the SSH configuration that Coder generates for you. For example:

coder config-ssh --yes \
  --ssh-option ForwardX11=yes \
  --ssh-option ForwardX11Trusted=yes