Introduction to bhyve John Baldwin May 7, 2014 Overview What is - - PowerPoint PPT Presentation

introduction to bhyve
SMART_READER_LITE
LIVE PREVIEW

Introduction to bhyve John Baldwin May 7, 2014 Overview What is - - PowerPoint PPT Presentation

Introduction to bhyve John Baldwin May 7, 2014 Overview What is bhyve? Requirements and Supported Guests Running a Guest Networking <Demo> A Different Kind of Hypervisor Depends on Hardware Acceleration Varied


slide-1
SLIDE 1

Introduction to bhyve

John Baldwin May 7, 2014

slide-2
SLIDE 2

Overview

  • What is bhyve?
  • Requirements and Supported Guests
  • Running a Guest
  • Networking
  • <Demo>
slide-3
SLIDE 3

A Different Kind of Hypervisor

  • Depends on Hardware Acceleration
  • Varied Reasons

– Expediency (x2APIC and MSI) – Sanity (EPT)

  • No Firmware

– BIOS (*sigh*) – UEFI / CSM

  • Few Virtual Devices (VirtIO / AHCI)
slide-4
SLIDE 4

Requirements

  • Host CPU Support

– Intel VT-x with EPT

  • “Unrestricted Guest” for SMP and i386

– AMD SVM (AMD-V) with NPT in a Project Branch

  • http://mirrors.nycbug.org/pub/bhyve/
  • Guest Support

– VirtIO Drivers (or AHCI for Disk) (MSI) – Serial Console – Userspace Loader

slide-5
SLIDE 5

Known Working Guests

  • FreeBSD/amd64 8.x+
  • FreeBSD/i386 8.x+
  • OpenBSD/amd64 5.5 (not bsd.rd)
  • NetBSD/amd64 (with some bhyve patches)
  • Linux/x86-64 (various flavors)
  • Illumos (with some hackish BIOS patches)
slide-6
SLIDE 6

Components

  • In-kernel Driver (vmm.ko)
  • Userland Binary (bhyve(8))
  • OS Loader

– bhyveload(8) (FreeBSD) – sysutils/grub2-bhyve (everything else)

  • bhyvectl(8)
slide-7
SLIDE 7

Guest Lifecycle

Three Steps:

  • 1. bhyvectl –destroy
  • 2. loader
  • 3. bhyve <many args>
slide-8
SLIDE 8

vmrun.sh

  • /usr/share/example/bhyve/vmrun.sh
  • Boots a FreeBSD guest using bhyveload(8)

with a single VirtIO NIC and VirtIO disk

– Second optional disk for installing – Various options

  • ACPI soft-off breaks out of loop (SIGTERM)
  • Decent template for your own scripts
slide-9
SLIDE 9

Detached Operation

  • Serial console on COM1 uses stdio by default
  • Option 1: tmux or screen
  • Option 2: Attach console to nmdm(4) device
  • SIGTERM for soft-off
slide-10
SLIDE 10

Network Setup

  • Allowing guests to get … somewhere
  • Two sample setups

– Bridged to a host-attached LAN – Use an internal LAN on the host

  • Both setups use a bridge (if_bridge(4))
  • Guest interfaces appear as tap(4) on the host
slide-11
SLIDE 11

Bridged to Host-Attached LAN

bridge

bridge0 tap0 em0 vtnet0

Host Guest

slide-12
SLIDE 12

Bridged to Host-Attached LAN

# ifconfig bridge0 create # ifconfig bridge0 addm em0 # ifconfig bridge0 addm tap0 # ifconfig bridge0 up cloned_interfaces=”bridge0 tap0” ifconfig_bridge0=”up” autobridge_interfaces=”bridge0” autobridge_bridge0=”em0 tap0”

slide-13
SLIDE 13

Internal LAN Bridged to Host

bridge

bridge0 tap0 vtnet0

Host Guests

tap1 vtnet0 tap2 vtnet0

slide-14
SLIDE 14

Internal LAN Bridged to Host

cloned_interfaces=”bridge0 tap0 tap1 tap2” ifconfig_bridge0=”inet 192.168.1.1/24” autobridge_interfaces=”bridge0” autobridge_bridge0=”tap*” gateway_enable=YES

slide-15
SLIDE 15

Internal LAN Bridged to Host

  • NAT for outside access

– Configure as if bridge0 was an interface to an

internal LAN

  • sysutils/dnsmasq makes life simpler

– DHCP server for guests – DNS aliases for guests and host

slide-16
SLIDE 16

Conclusion

  • Demo
  • Questions?

http://people.freebsd.org/~jhb/papers/bhyve/