Skip to content

About

🏠 SSH, but each user gets their own microVM

Topics

Resources

Stars

118 stars

Watchers

2 watching

Forks

Latest commit

 

History

42 Commits

Folders and files

Repository files navigation

ssh-hypervisor

Like SimCity, but for virtual machines!

Screen recording of using ssh-hypervisor

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

Your user must be able to access /dev/kvm, e.g., by being in the kvm group. VMs may not have Internet access by default unless you pass -allow-internet.

About

🏠 SSH, but each user gets their own microVM

Topics

Resources

Stars

118 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages