• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Rust
  • License
    Mozilla Public Li...
  • Created about 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

VMM userspace for illumos bhyve

Propolis

Propolis is a rust-based userspace for illumos bhyve.

Prerequisites

Given the current tight coupling of the bhyve-api component to the ioctl interface presented by the bhyve kernel component, running on recent illumos bits is required.

Propolis works best (and its CI tests run) on AMD hosts, but it can also be used to run VMs on Intel hosts. Live migration is primarily supported on AMD hosts but may work on Intel hosts as well.

Minimum Supported Rust Version (MSRV)

  • Rust 1.67.0

Building

To build, run:

$ cargo build

propolis crate

The main propolis crate is structured as a library providing the building blocks to create bhyve backed VM instances. It also provides a number of emulated devices that can be exposed to guests (e.g. serial port, virtio devices, NVMe).

propolis-server

Propolis is mostly intended to be used via a REST API to drive all of its functionality. The standard cargo build will produce a propolis-server binary you can run:

Running

# propolis-server run <config_file> <ip:port>

Note that the server must run as root. One way to ensure propolis-server has sufficient privileges is by using pfexec(1), as such:

# pfexec propolis-server run <config_file> <ip:port>

Example Server Configuration

Note: the goal is to move the device config from the toml to instead be configured via REST API calls.

bootrom = "/path/to/bootrom/OVMF_CODE.fd"

[block_dev.alpine_iso]
type = "file"
path = "/path/to/alpine-extended-3.12.0-x86_64.iso"

[dev.block0]
driver = "pci-virtio-block"
block_dev = "alpine_iso"
pci-path = "0.4.0"

[dev.net0]
driver = "pci-virtio-viona"
vnic = "vnic_name"
pci-path = "0.5.0"

propolis-cli

Once you've got propolis-server running you can interact with it via the REST API with any of the usual suspects (e.g. cURL, wget). Alternatively, there's a propolis-cli binary to make things a bit easier:

Running

The following CLI commands will create a VM, start the VM, and then attach to its serial console:

# propolis-cli -s <propolis ip> -p <propolis port> new <VM name>
# propolis-cli -s <propolis ip> -p <propolis port> state <VM name> run
# propolis-cli -s <propolis ip> -p <propolis port> serial <VM name>

propolis-standalone

Server frontend aside, we also provide a standalone binary for quick prototyping, propolis-standalone. It uses a static toml configuration:

Running

# propolis-standalone <config_file>

Example configuration:

[main]
name = "testvm"
cpus = 4
bootrom = "/path/to/bootrom/OVMF_CODE.fd"
memory = 1024

[block_dev.alpine_iso]
type = "file"
path = "/path/to/alpine-extended-3.12.0-x86_64.iso"

[dev.block0]
driver = "pci-virtio-block"
block_dev = "alpine_iso"
pci-path = "0.4.0"

[dev.net0]
driver = "pci-virtio-viona"
vnic = "vnic_name"
pci-path = "0.5.0"

Propolis will not destroy the VM instance on exit. If one exists with the specified name on start-up, it will be destroyed and created fresh.

Propolis will create a unix domain socket, available at "./ttya", which acts as a serial port. One such tool for accessing this serial port is sercons, though others (such as "screen") would also work.

Quickstart to Alpine

In the aforementioned config files, there are three major components that need to be supplied: The guest firmware (bootrom) image, the ISO, and the VNIC.

Since this is a configuration file, you can supply whatever you'd like, but here are some options to get up-and-running quickly:

Guest bootrom

The current recommended and tested guest bootrom is available here.

Other UEFI firmware images built from the Open Virtual Machine Firmware project may also work, but these aren't regularly tested and your mileage may vary.

ISO

Although there are many options for ISOs, an easy option that should work is the Alpine Linux distribution.

These distributions are lightweight, and they have variants custom-built for virtual machines.

A straightforward option to start with is the "virtual" x86_64 image.

The "extended" variant contains more useful tools, but will require a modification of the kernel arguments when booting to see the console on the serial port. From Grub, this can be accomplished by pressing "e" (to edit), adding "console=ttyS0" to the line starting with "/boot/vmlinuz-lts", and pressing "Control + x" to boot with these parameters.

VNIC

To see your current network interfaces, you can use the following:

$ dladm show-link

To create a vnic, you can use one of your physical devices (like "e1000g0", if you have an ethernet connection) as a link for a VNIC. This can be done as follows:

NIC_NAME="vnic_prop0"
NIC_MAC="02:08:20:ac:e9:16"
NIC_LINK="e1000g0"

if ! dladm show-vnic $NIC_NAME 2> /dev/null; then
  dladm create-vnic -t -l $NIC_LINK -m $NIC_MAC $NIC_NAME
fi

Running a VM

After you've got the bootrom, an ISO, a VNIC, and a configuration file that points to them, you're ready to create and run your VM. To do so, make sure you've done the following:

  • build propolis
  • run the propolis-server
  • create your VM, run it, and hop on the serial console using propolis-cli
  • login to the VM as root (no password)
  • optionally, run setup-alpine to configure the VM (including setting a root password)

License

Unless otherwise noted, all components are licensed under the Mozilla Public License Version 2.0.

More Repositories

1

hubris

A lightweight, memory-protected, message-passing kernel for deeply embedded systems.
Rust
2,912
star
2

dropshot

expose REST APIs from a Rust program
Rust
855
star
3

progenitor

An OpenAPI client generator
Rust
522
star
4

humility

Debugger for Hubris
Rust
452
star
5

typify

compiler from JSON Schema into idiomatic Rust types
Rust
425
star
6

helios

Helios: Or, a Vision in a Dream. A Fragment.
Rust
367
star
7

oxide-and-friends

Show notes from Oxide and Friends recordings
Rust
308
star
8

omicron

Omicron: Oxide control plane
Rust
251
star
9

cio

Rust libraries for APIs needed by our automated CIO.
Rust
247
star
10

crucible

A storage service.
Rust
170
star
11

console

Oxide Web Console
TypeScript
133
star
12

p4

A P4 compiler
Rust
105
star
13

design-site

We are looking for designers who code to help build a new user experience for computing!
CSS
99
star
14

cobalt

A collection of common Bluespec interfaces/modules.
Bluespec
96
star
15

third-party-api-clients

A place for keeping all our generated third party API clients.
Rust
89
star
16

usdt

Dust your Rust with USDT probes
Rust
84
star
17

steno

distributed sagas
Rust
75
star
18

phbl

Pico Host Boot Loader
Rust
69
star
19

tockilator

Deducing Tock execution flows from Ibex Verilator traces
Rust
68
star
20

serde_tokenstream

serde::Deserializer for proc_macro/proc_macro2::TokenStream
Rust
63
star
21

buildomat

a software build labour-saving device
Rust
55
star
22

oxide.rs

The Oxide Rust SDK and CLI
Rust
38
star
23

opte

packets go in, packets go out, you can't explain that
Rust
36
star
24

fable

TOML deck generator with custom templates and schema validation
CSS
34
star
25

cancel-safe-futures

Alternative future adapters that provide cancel safety.
Rust
33
star
26

helios-engvm

Tools for creating and using Helios images on i86pc (classic PC) physical and virtual machines
Rust
30
star
27

pki-playground

Tool for generating non-trivial X.509 certificate chains
Rust
28
star
28

expectorate

I'm especially good at expectorating
Rust
27
star
29

maghemite

A routing stack written in Rust.
Rust
26
star
30

oxide.ts

TypeScript client for the Oxide API
TypeScript
24
star
31

aws-wire-lengths

simple command line for various AWS management tasks
Rust
23
star
32

fs3-rs

Extended utilities for working with files and filesystems in Rust.
Rust
22
star
33

lpc-link2-re

Reverse engineering the LPC-Link2 USB interface
Rust
22
star
34

lethe

A basic log-structured flash datastore
Rust
20
star
35

terraform-provider-oxide

Oxide Terraform provider
Go
18
star
36

poptrie

A poptrie implementation
Rust
17
star
37

oxide.go

The Go SDK for Oxide.
Go
17
star
38

cli-old

The command line tool for Oxide.
Rust
16
star
39

design-system

Home of reusable design assets and tokens for oxide internal sites
TypeScript
15
star
40

rfsx

A XMODEM sender using libftdi
Rust
15
star
41

amd-apcb

AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library
Rust
14
star
42

rustfmt-wrapper

A simple wrapper around rustfmt to use it as a library for use when generating code
Rust
14
star
43

rfb

Rust
13
star
44

async-bb8-diesel

Safe asynchronous access to Diesel and the bb8 connection manager
Rust
12
star
45

xfr

An atomic ring for processing memory-mapped frames.
Rust
11
star
46

idolatry

An experimental IPC interface definition language for Hubris.
Rust
11
star
47

bootleby

Rust
11
star
48

openapi-lint

Validate an OpenAPI schema against some rules
Rust
11
star
49

dropkick

punt your dropshot service into the cloud
Rust
10
star
50

zone

Rust
10
star
51

hif

HIF: The Hubris/Humility Interchange Format
Rust
10
star
52

bhyve-api

Rust library interface to Bhyve ioctl API
Rust
9
star
53

overwatch

A P4-powered packet tracer.
Rust
9
star
54

offline-keystore

yubihsm-setup replacing the yubico cruft with our own cruft!
Rust
9
star
55

react-asciidoc

A React renderer for AsciiDoc. Built on top of Asciidoctor.js.
JavaScript
9
star
56

eos

A build tool for illumos.
Rust
8
star
57

ch-oxidase

A port of Cloud Hypervisor to run on Illumos and the Bhyve kernel space
Rust
8
star
58

softnpu

Software Network Processing Unit
Rust
8
star
59

sprockets

Now's the time on sprockets when we dance
Rust
7
star
60

wfm-to-pcap

.wfm to .pcap decoder
Rust
7
star
61

transceiver-control

Crate for controlling optical transceivers over the network
Rust
7
star
62

lpc55_support

Support tooling for flashing the LPC55
Rust
7
star
63

reqwest-conditional-middleware

A middleware wrapper that enables (or disables) a wrapped Reqwest middleware on a per-request basis
Rust
7
star
64

lpc55s69_rompatch_sample

A sample showing issues with the LPC55 mystery rom patch
C
6
star
65

diesel-dtrace

A diesel connection with DTrace probes for connections and queries
Rust
6
star
66

miniz

toy in-memory implementation of Zanzibar data model
Rust
6
star
67

dice-util

utilities for cert template generation and manufacturing / certifying DeviceIds
Rust
6
star
68

sshauth

A library for SSH key based (agents or static files) authentication tokens
Rust
6
star
69

garbage-compactor

terrible build scripts
Shell
6
star
70

slog-dtrace

A slog drain for emitting logging messages to DTrace
Rust
5
star
71

falcon

Fast Assessment Laboratory for Computers On Networks
Rust
5
star
72

smf

Rust
5
star
73

p9fs

A Plan 9 file system crate
Rust
5
star
74

ispf

An Internet packet format Serde implementation
Rust
5
star
75

nixie-tubes

Oxide's collection of assorted NixOS thingamajigs
Nix
5
star
76

tlvc

TLV-C encoding support.
Rust
5
star
77

thouart

Some helpful code for implementing CLI tools for connecting to simulated remote terminals
Rust
5
star
78

clock

wall clock software for the Oxide office
Rust
5
star
79

qemu-systick-bug

Program demonstrating bug in QEMU's SysTick emulation
Rust
4
star
80

tsc-simulator

Rust tool to calculate and simulate the TSC and other time-related values for live migration
Rust
4
star
81

pmbus

A no_std crate for PMBus manipulation
Rust
4
star
82

qorb

Rust
4
star
83

identicon

TypeScript
4
star
84

helios-omicron-brand

A zone brand for Omicron components running under Helios
Rust
4
star
85

cockroach

CockroachDB 22.1.x long-term maintenance branch
Go
3
star
86

serde_human_bytes

Serialize [u8; N] as bytes or as human-readable strings, depending on the format.
Rust
3
star
87

oxide.rs-old

The Rust API client for Oxide.
Rust
3
star
88

sb2_poc

Proof of concept for SB2 exploits
C
3
star
89

dhcpv6

dhpcv6 encoding/decoding
Rust
3
star
90

netadm-sys

A network administration library and CLI for illumos
Rust
3
star
91

tofino

tofino support stuff
Rust
3
star
92

omicron-package

Tools to create Omicron-branded Zones
Rust
3
star
93

partial-struct

Rust
3
star
94

slog-error-chain

Logging Rust errors with context
Rust
3
star
95

renovate-config

Oxide's shared renovate configuration
3
star
96

ordered-toml

toml-rs except preserves table ordering
Rust
3
star
97

management-gateway-service

Crates shared between MGS in omicron and its agent task in hubris
Rust
3
star
98

kstat-rs

Rust interface to illumos libkstat
Rust
3
star
99

tree-sitter-p4

P4 grammar for tree-sitter
JavaScript
3
star
100

helios-omnios-build

Shell
3
star