Remote Development

MS Visual Studio Code is nice for writing Markdown with built-in preview. In my homelab, I wish to run VS Code on my Macbook, but maintain the source on an AlmaLinux host.

Visual Studio Code Remote Development makes this quite trivial: install the Microsoft Remote Development extension, add an SSH host (press F1, “Remote-SSH: Add New SSH Host…”)

In my case, I entered “ssh ed@devhost -A -L 4000:localhost:4000” as the SSH Host.

So, how does this all work?

  • I start VS Code on my macOS laptop
  • VS Code opens an SSH connection to my development host, forwarding port 4000/tcp on my laptop to port 4000/tcp on the development host
  • On the development host, I have a Jekyll container running
  • By default, that container serves the development version of my website on port 4000/tcp
  • On my macOS laptop, I open http://localhost:4000/ in Safari to preview my website

Updated: