Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🏠 SSH, but each user gets their own microVM

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages