kregel/homestead

A Laravel Nova tool.


README

Latest Version on Packagist Total Downloads

Have you ever just wanted an interface for managing your virtual machines, and not have it look like it came out of the early 2000s? Look no further. This package aims to satisfy a very very very very small niche portion of hobbyists who both have a Laravel Nova download available, and need to manage virtual machines.

This package does currently support remote management, so assuming you have all the ports open to the server this app is hosted from, and the user you're connecting as has permissions to access all the files, you could host this app on a DigitalOcean server and manage a VM server in your house. 😉

Quick Nav

What's the alternative?

Well, for this specific piece of software, I'm not aware of many alternatives... (They probably exist...)

Virtual machine access via novnc

See other screenshots

Goal

Get very basic create/read/update/delete functionality for just creating new VMs on a host.

  • Create (#1)
  • Read
  • Update
  • Delete
  • Start VMs
  • Stop VMs
  • Force stop VMs
  • Access Via VNC
  • Restart VM
  • SSH remote management
  • SSH private key authentication
  • Password Authentication
  • Multiple hypervisors
  • Custom networking
  • Edit disks of the VM (increase size, change format?)

Bonus:

  • Add pass through devices?
  • Add snapshots? (Looks like it could be possible through libvirt)
  • Tag the VMs with things, and the be able to manage the tags in the UI.
  • Add a way to let the VMs download isos from a remote source.
  • Add a way to manage ISOs so your VMs don't have to reach out to an external server for downloading the ISOs
  • View Guest CPU stats and display those in graphs on the VM's Show page.
  • Test driver LXC - Linux Containers
  • Test driver OpenVZ
  • Test driver QEMU
  • Test driver VirtualBox
  • Test driver VMware ESX
  • Test driver VMware Workstation/Player
  • Test driver Xen
  • Test driver Microsoft Hyper-V
  • Test driver Virtuozzo
  • Test driver Bhyve - The BSD Hypervisor
  • Qcow2 disk encryption for QEMU

Before we begin.

This is just an admin dashboard for hypervisors. A hypervisor control panel if you will. You do not need qemu, or virt-manager on the webserver you serve this from. However, you do need to use the libvirt library that comes with this package. The library built into this package has been patched, and updated to have fewer hidden error messages and fix some bugs.

Installing this package

composer require kregel/nova-homestead

Letting Nova know about it's existence.

// In your app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \Kregel\Homstead\Homestead(),
    ];
}

Installing libvirt-php.

Pre installation build tools

sudo apt install build-essential autoconf automake libtool bison re2c pkg-config libvirt-dev libxml2-dev xsltproc libxml2-utils libmagickwand-dev

Also, make sure your PHP instance has imagick installed and enabled..

git clone git@github.com:austinkregel/libvirt-php
cd libvirt-php
./autogen.sh
make
sudo make install

Installing a VNC Client

In order to view the output of your VM directly, you'll want to use this VNC client. I have only personally tested this out with novnc on Ubuntu 19.04 for QEMU.

sudo apt update
sudo apt install snapd
sudo snap install novnc

Managing VNC

At the moment, my understanding is that to view a VM's tty session we have to spin up a new instance of novnc to proxy that VM's output to your broswer. At the moment, I'm not sure how to support that. If you know how to manage this, please make an issue or a PR!.

So for the moment, I just test with 1 VM and I have 1 instance of novnc running that I start manually. It's kind of a pain I know, but it works for now.

Permissions

Ensure that the user has access to the group libvirt-qemu. Usually this mean run the program as root, but if you know another way, give that a shot.

Developing/Contributing to this project

Please see CONTRIBUTING for details.

Release notes

As this projects gets built out further and further, you can keep track of the releases on Changelager.

libvirt-php auto complete

At the moment there's a script called build-doc.php which will extract all methods from the libvirt library and put it into the .phpstorm.meta.php file. The logic of what happens within those methods can only be find in the ./docker/php/libvirt-php/src directory in the original C/C++ code.

Abstraction

The underlying APIs of this package don't require Laravel Nova and can be used outside of it. You'll just need to ensure illuminate/support at any version >5.0.

Security

If you discover any security related issues, please email security@metabit.services instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Support

If you enjoy my content, please consider supporting me on Kofi.