Running Jekyll in a virtual machine

I have installed Jekyll in a Ubuntu 20.04 Server virtual machine using Oracle VirtualBox 6.12 and hosted on a Ubuntu 20.04 Desktop machine. When I bring up the Jekyll server, it binds to 127.0.0.1, localhost, and thus is inaccessible to any other computer. Is it possible to make Jekyll accessible to other computers, and if so, how? BTW my networking knowledge is very low. I have no problems accessing Jekyll on the VM using a command-line browser, Lynx on localhost but I want to access it with a full-function browser from the host computer.

You’ll probably want to run Jekyll serve with host 0.0.0.0, so it is open to external connections:

bundle exec jekyll serve --host 0.0.0.0

In addition you’ll need to setup VirtualBox to allow connections from Host to Guest. I gather the options are to use either NAT+Port-Forwarding or Bridge mode. Here’s a thread from the VirtualBox forums on how that is setup:

2 Likes

The host keyword is the key. I already have bridged networking for the VM.