Skip to content

nsyntych/xhyve-manager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xhyve-manager

https://asciinema.org/a/45565

Is this superfluous? Probably.

But do I care? No.

Why? I need to practice my C-fu, dagnabbit.

What’s working

  • default virtual machine directory at /usr/local/Library/xhyve/machines.
  • prints virtual machine info: xhyve-manager info CentOS.
  • starts virtual machine: sudo xhyve-manager start FreeBSD
  • edits virtual machine config: xhyve-manager edit Ubuntu

Planned Features

  • Manage lifecycle of virtual machines (inspired by bhyvectl on FreeBSD)
  • Build and package virtual machines
  • Native, OS X GUI (inspired by virt-manager on Linux)

Challenges

Linux guests

  • have to extract kernel and initrd from installation ISO before booting into the live environment
  • have to extract kernel and initrd from new installation before rebooting

Storage

  • need to create virtual disk with dd

Graphical Session

  • need to connect with a VNC viewer

Roadmap

Commandline options

  • [ ] list list virtual machines
  • [ ] create <name> create a new virtual machine
  • [X] edit<name> edit virtual machine configuration with external editor (for now).
  • [ ] delete <name> delete virtual machine
  • [ ] info <name> show info about the virtual machine
  • [X] start <name> start virtual machine.

parse a $HOME/xhyve VMs/<name>.xhyvm directory. This is where we’ll store everything but the storage options.

Read config.ini that specify:

  • [X] memory size
  • [X] number of cpus
  • [X] networking options
  • [X] storage: internal or external, and mount latter depending on whether ISO is specified
  • [X] type: linux or bsd so we know which initialization to load
  • [X] acpi: enabled or not

Storage: specify with edit

  • [X] CD: specify where this is on disk. Automatically extract the kernel and initrd (Put this in <name>.xhyvm) or just have user specify it.
  • [X] HDD: specify where this is on disk; create if it doesn’t exist or just have user specify it.

Create a new virtual machine.

Collect these basic values:

machine_name eg. “Ubuntu 16.04”
machine_type eg. “linux”, “bsd”
internal_storage_configoptions path to the vdisk (e.g. /Users/aj/VDisks/vdisk0.img)
external_storage_configoptions path to the CD img (e.g. /Users/aj/xhyve VMs/Ubuntu.xhyvm/ubuntu.iso)
boot_options specify what it should be. for BSD this should be empty.

At last, start the VM and hope for the best. And also login. And start a VNC server, probably, if we want something graphical.

Location of boot images

Linux Live USBs

  • Arch Linux /arch/boot/x86_64/{archiso.img,vmlinuz}
  • CentOS /isolinux/{initrd.img,vmlinuz}
  • Ubuntu /install/{initrd.gz,vmlinuz}
  • Debian /install.amd/{initrd.gz,vmlinuz/

About

A simple commandline utility to manage xhyve Virtual Machines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.2%
  • C++ 1.4%
  • Other 0.4%