- Install Terraform
- Make Digital Ocean API token available to Terraform
export DIGITALOCEAN_TOKEN=insertokenhere
- [OPTIONAL] Capture more verbose Terraform logging:
export TF_LOG=TRACE export TF_LOG_PATH=$PWD/terraform.log
- Modify variables in
terraform.tfvars
file - Initialize Terraform (e.g., download necessary plugins)
terraform init
- Output what will happen when you run
terraform apply
terraform plan
- Deploy Droplet (execute plan)
terraform apply
- Run SSH port forward command (
connect_cmd
fromterraform output
) - Download TightVNC and only select TightVNC Viewer (VNC client)
- Connect to
localhost:5901
using TightVNC Viewer and randomly generated VNC password (vnc_pass
fromterraform output
) - If, for some reason, the VNC session is not working as expected, simply restart the
runvnc
service on the Droplet:# SSH into Droplet using generated private key and IP address: # ssh -i <private_key> root@<droplet_ip> systemctl stop runvnc systemctl start runvnc
For those who need a template for running software like ghidra on anything that's not your machine.
Through the magic of Terraform and VPS providers (in this case, Digital Ocean)
For some reason, provisioning the original bootstrap shell script via Terraform doesn't properly initialize and configure the VNC session. Connecting to it results in an unusable desktop session (gray screen). Manually SCP'ing and executing the bootstrap script directly on the Droplet works just fine. I've attempted to resolve this by:
- Provisioning an
expect
script; and - Providing the bootstrap script as userdata (commands to execute during Droplet initialization)
Unfortunately, both of these approaches failed. To account for this, I've automated the creation of a systemd
service to facilitate management of vncserver
.
Ctrl+Alt+Shift+F
to enter/exit full-screen mode in TightVNC Viewer
- Automatically determining the user's current resolution and providing that value to the
resolution
variable. - Add support for KDE and "generic" VNC sessions