Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Using Oxide Propolis (standalone) to manage local vms on Helios. Yes, this is super niche.

qdzlug/malaprops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Malaprops - Propolis VM Management for Helios

A simple project for running VMs using propolis-standalone on older Helios systems that don't support newer CPU instructions (post-2012). This project facilitates VM management using ZFS volumes, cloud-init, and Propolis virtualization.

Features

  • 🚀 Interactive VM Configuration - Complete TOML + cloud-init generation
  • 🌤️ NoCloud Support - Built-in cloud-init with user creation, SSH keys, packages
  • 💾 ZFS Integration - Efficient storage with snapshots and cloning
  • 🔗 Network Management - Automatic VNIC creation and management
  • 📱 Console Access - Integrated serial console with sercons
  • Fast Deployment - ZFS cloning for instant VM provisioning

Quick Start

Prerequisites

Required on Helios:

  • Propolis Standalone binary in bin/
  • Sercons for console access
  • OVMF bootrom file in images/
  • Ubuntu cloud image (converted to raw format)

Required on Linux (for image conversion):

  • qemu-img for format conversion
  • Docker (alternative for Helios users)

Basic Setup

  1. Get the required binaries:

    # Build propolis-standalone and place in bin/
    # Download OVMF_CODE.fd and place in images/
    # Download Ubuntu cloud image
  2. Convert image to raw format (on Linux or Docker):

    # On Linux
    qemu-img convert -f qcow2 -O raw ubuntu-24.04.img ubuntu-24.04.raw
    
    # Or using Docker on Helios
    docker run --rm -v "$PWD:/work" kwart/qemu-img \
      qemu-img convert -f qcow2 -O raw /work/ubuntu-24.04.img /work/ubuntu-24.04.raw
  3. Configure and deploy VMs:

    # Single VM with interactive configuration
    ./scripts/configure-vm.sh
    
    # Multiple VMs with shared settings
    ./scripts/configure-multiple-vms.sh
  4. Start and access VMs:

    ./scripts/start-vm.sh vm-name
    ./scripts/vm-manager.sh console vm-name

Project Structure

├── bin/                    # Binaries (propolis-standalone)
├── images/                 # VM images and bootrom files
├── scripts/               # Management scripts
│   ├── configure-vm.sh           # Interactive single VM setup
│   ├── configure-multiple-vms.sh # Batch VM configuration
│   ├── start-vm.sh              # Start VM with isolated console
│   ├── vm-manager.sh            # VM management utilities
│   ├── import-raw-img.sh        # Import images to ZFS
│   └── vm-helpers.sh            # Helper functions
├── CLAUDE.md              # AI assistant guidance
├── CHEAT_SHEET.md         # Quick reference commands
└── example-vm-config.yaml # Legacy YAML configuration example

VM Configuration Workflows

Recommended: Interactive Configuration

Single VM:

./scripts/configure-vm.sh

This script guides you through:

  • VM specifications (CPU, memory)
  • Network configuration (VNIC creation)
  • Storage options (import image or clone existing)
  • Cloud-init setup (users, SSH keys, packages)
  • Generates complete TOML configuration

Multiple VMs:

./scripts/configure-multiple-vms.sh

Configure shared settings once, then specify VM names. Uses ZFS cloning for fast deployment.

Legacy: YAML Configuration

# 1. Edit configuration file
cp example-vm-config.yaml my-vms.yaml
# Edit with your VM specifications

# 2. Deploy VMs
./scripts/vm-manager.sh deploy my-vms.yaml

Cloud-Init Integration

Malaprops uses Propolis's native NoCloud support for cloud-init configuration:

Features:

  • User creation with hashed passwords or SSH-only access
  • Passwordless sudo setup
  • Package installation and system updates
  • SSH key configuration
  • Custom hostname and timezone
  • Automatic service enablement

Example Configuration:

[cloudinit]
user-data = '''#cloud-config
users:
  - name: ubuntu
    ssh_authorized_keys:
      - ssh-ed25519 AAAA...
    sudo: 'ALL=(ALL) NOPASSWD:ALL'
    shell: /bin/bash

packages:
  - curl
  - wget
  - vim
  - htop

package_update: true
'''

ZFS Integration

VMs use ZFS volumes for storage, providing:

  • Snapshots for easy backup and restore
  • Cloning for fast VM provisioning
  • Compression for space efficiency
  • Performance optimized for virtualization

Images are stored as: /dev/zvol/rdsk/rpool/instances/img/<vm-name>

Network Configuration

Each VM gets its own VNIC for network isolation:

  • Automatic VNIC creation: vm-name-vnic
  • Bridges to physical interface (e.g., e1000g0)
  • DHCP networking by default
  • Custom network configuration via cloud-init

Console Access

VMs run with isolated console sockets:

  • Each VM: vm-instances/<vm-name>/ttya
  • Access via: ./scripts/vm-manager.sh console <vm-name>
  • Uses sercons for proper terminal handling

Management Commands

# VM lifecycle
./scripts/configure-vm.sh          # Create new VM
./scripts/start-vm.sh vm-name      # Start VM
./scripts/vm-manager.sh console vm-name  # Connect to console
./scripts/vm-manager.sh cleanup vm-name  # Remove VM

# Status and information
./scripts/vm-manager.sh list       # List configured VMs
./scripts/vm-manager.sh status     # Show VM and network status

# Storage management
./scripts/import-raw-img.sh image.raw vm-name  # Import disk image

Troubleshooting

Common Issues:

  1. VNIC creation fails: Check physical interface name with dladm show-phys
  2. VM won't start: Verify OVMF bootrom path and ZFS volume exists
  3. Console connection fails: Ensure sercons is installed and VM is running
  4. Cloud-init not working: Check user-data syntax and SSH key format

Debug Commands:

# Check ZFS volumes
zfs list -t volume | grep instances

# Check VNICs
dladm show-vnic

# Check running VMs
ps -ef | grep propolis-standalone

Contributing

This project is designed for Helios systems with older CPUs. Contributions welcome for:

  • Enhanced cloud-init templates
  • Additional OS support
  • Performance optimizations
  • Documentation improvements

License

Open source - see individual component licenses for Propolis, Sercons, etc.

References

About

Using Oxide Propolis (standalone) to manage local vms on Helios. Yes, this is super niche.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages