ssh-hypervisor

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: MIT

README

ssh-hypervisor

Like SimCity, but for virtual machines!

ssh-hypervisor is an SSH server that dynamically provisions Linux microVMs with Firecracker. Once set up, you can just SSH into it from anywhere to instantly allocate a fresh VM.

# Dynamically create a microVM, or restore from past state.
ssh yourname@vmcity.ekzhang.com

$ whoami  # You are now SSH'd into the VM!

Just for fun! Not intended to be used in production at this time.

I could see it potentially becoming a useful building block for provisioning lightweight VMs, since many languages have SSH client libraries. Let's discuss if you want to make this happen.

Usage

The ssh-hypervisor binary is statically linked and written in Go.

System requirements:

Development

To build the project:

# Download platform-specific Firecracker binary
go generate ./...

# Build the binary (static linking, no CGO dependencies)
CGO_ENABLED=0 go build ./cmd/ssh-hypervisor

# Grant required CAP_NET_ADMIN to the binary
sudo setcap cap_net_admin+ep ./ssh-hypervisor

To run tests, just use go test directly.

go test -v -exec sudo ./...

Then, you will need to build a rootfs once, and run the server:

# Build a rootfs, requires docker. Produces 'rootfs.ext4' file.
scripts/create-rootfs.sh

./ssh-hypervisor -rootfs rootfs.ext4

Directories

Path Synopsis
cmd
ssh-hypervisor command
vm-start command
vm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL