From 6739b5745a26a70e6d2a009d2dd38d53531d0d42 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 18 Jan 2019 12:08:28 +0200 Subject: [PATCH] Update docs to include how to use libvirt vagrant --- docs/vagrant.md | 82 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/docs/vagrant.md b/docs/vagrant.md index 5e2fa3f6a..78a070a77 100644 --- a/docs/vagrant.md +++ b/docs/vagrant.md @@ -1,21 +1,78 @@ The **LibreTime Vagrant install** is the fastet way to get LibreTime up and running in a way -to hack on its source code or to test it locally. +to hack on its source code or to test it locally. There are two supported providers: libvirt +and VirtualBox. ## Prerequisites * [Git](https://git-scm.com/) -* [VirtualBox](https://www.virtualbox.org) * [Vagrant](https://vagrantup.com) -You might also want to install [vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest) to update the guest extensions to match your host system on vagrant up. +### Virtual Box + +You will need to install [VirtualBox](https://www.virtualbox.org) and may want to consider +installing [vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest) to update the +guest extensions to match your host system on vagrant up. ```bash vagrant plugin install vagrant-vbguest ``` +### Libvirt + +Setting the libvirt provider up on (Ubuntu and Debian)[#Ubuntu and Debian] is straight +forward, using the distribution provided packages. While on +(Other Distributions)[#Other Distributions] it can be built from within vagrant. + +If you try run a libvirt provided box after using a VirtualBox one, you will receive an +error: + +``` +Error while activating network: +Call to virNetworkCreate failed: internal error: Network is already in use by interface vboxnet0. +``` + +This is fixed by stopping virtualbox and re-creating the vagrant box: + +``` +sudo systemctl stop virtualbox +vagrant destroy ubuntu-xenial +vagrant up ubuntu-xenial --provider=libvirt +``` + +#### Debian and Ubuntu + +```bash +sudo apt install vagrant vagrant-libvirt libvirt-daemon-system vagrant-mutate +sudo usermod -a -G libvirt $USER + +# Log out and back in + +vagrant box fetch bento/ubuntu-16.04 +vagrant mutate bento/ubuntu-16.04 libvirt +vagrant up bento/ubuntu-16.04 --provider=libvirt +``` + +#### Other Distributions + +You will need to install [libvirt](https://libvirt.org/) and `vagrant-mutate` and then run + +```bash +vagrant plugin install vagrant-libvirt +sudo usermod -a -G libvirt $USER + +# Log out and back in + +vagrant plugin install vagrant-mutate +vagrant box fetch bento/ubuntu-16.04 +vagrant mutate bento/ubuntu-16.04 libvirt +vagrant up bento/ubuntu-16.04 --provider=libvirt +``` + ## Starting LibreTime Vagrant -To get started you clone the repo and run `vagrant up`. +To get started you clone the repo and run `vagrant up`. The command accepts a parameter to +change the default provider if you have multiple installed. This can be done by appending +`--provider=virtualbox` or `--provider=libvirt` as applicable. ```bash git clone https://github.com/libretime/libretime.git @@ -23,13 +80,18 @@ cd libretime vagrant up ubuntu-xenial ``` -If everything works out, you will find LibreTime on [port 8080](http://localhost:8080), icecast on [port 8000](http://localhost:8000) and the docs on [port 8888](http://localhost:8888). +If everything works out, you will find LibreTime on [port 8080](http://localhost:8080), +icecast on [port 8000](http://localhost:8000) and the docs on +[port 8888](http://localhost:8888). -Once you reach the web setup GUI you can click through it using the default values. To connect to the vagrant machine you can run `vagrant ssh ubuntu-xenial` in the libretime directory. +Once you reach the web setup GUI you can click through it using the default values. To +connect to the vagrant machine you can run `vagrant ssh ubuntu-xenial` in the libretime +directory. ## Alternative OS installations -With the above instructions LibreTime is installed on Ubuntu Xenial Xerus. The Vagrant setup offers the option to choose a different operation system according to you needs. +With the above instructions LibreTime is installed on Ubuntu Xenial Xerus. The Vagrant setup +offers the option to choose a different operation system according to you needs. | OS | Command | Comment | | ------ | ------------------- | ------- | @@ -42,6 +104,8 @@ With the above instructions LibreTime is installed on Ubuntu Xenial Xerus. The V ## Troubleshooting -If anything fails during the initial provisioning step you can try running `vagrant provision` to rerun the installer. +If anything fails during the initial provisioning step you can try running `vagrant provision` +to rerun the installer. -If you only want to re-run parts of the installer, use `--provision-with install`. The supported steps are `prepare`, `install`, `install-mkdocs` and `start-mkdocs`. +If you only want to re-run parts of the installer, use `--provision-with install`. The +supported steps are `prepare`, `install`, `install-mkdocs` and `start-mkdocs`.