Connecting VS Code directly to Photon OS 4

This is just a quick update to my setting up Photon OS as a docker host post. I use VS Code to both (try to) write code and edit configuration files, such as YAML files for Docker Compose. So to make configuring containers faster and easier, I’d like to be able to edit the files directly on the Photon VM using VS Code with the Remote Development pack on my desktop.

To do this, VS Code wants to deploy a small component on the destination server, and that doesn’t run entirely smoothly on Photon OS minimal out of the box due to its small footprint. So here’s what I need to adjust.

First, it needs tar to untar the addon, so

tdnf -y install tar

Next, the sshd demon needs to allow TCP forwarding, which it doesn’t out of the box.

sed -i "s/AllowTcpForwarding no/AllowTcpForwarding yes/g" /etc/ssh/sshd_config

Then restart the sshd, and we’re good to go!

systemctl restart sshd

And then VS Code is ready to connect straight to the Photon OS VM! If you remembered to install the extensions, obviously…

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.