138 lines
6.4 KiB
HTML
138 lines
6.4 KiB
HTML
<h1 id="using-vagrant-and-virturalbox-for-developing-libretime">Using Vagrant and Virturalbox for developing LibreTime</h1>
|
|
|
|
<p>The <strong>LibreTime Vagrant install</strong> is the fastet way to get LibreTime up and running in a way
|
|
to hack on its source code or to test it locally. There are two supported providers: libvirt
|
|
and VirtualBox.</p>
|
|
|
|
<h2 id="prerequisites">Prerequisites</h2>
|
|
|
|
<ul>
|
|
<li><a href="https://git-scm.com/">Git</a></li>
|
|
<li><a href="https://vagrantup.com">Vagrant</a></li>
|
|
</ul>
|
|
|
|
<h3 id="virtual-box">Virtual Box</h3>
|
|
|
|
<p>You will need to install <a href="https://www.virtualbox.org">VirtualBox</a> and may want to consider
|
|
installing <a href="https://github.com/dotless-de/vagrant-vbguest">vagrant-vbguest</a> to update the
|
|
guest extensions to match your host system on vagrant up.</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>vagrant plugin <span class="nb">install </span>vagrant-vbguest
|
|
</code></pre></div></div>
|
|
|
|
<h3 id="libvirt">Libvirt</h3>
|
|
|
|
<p>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.</p>
|
|
|
|
<p>If you try run a libvirt provided box after using a VirtualBox one, you will receive an
|
|
error:</p>
|
|
|
|
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Error while activating network:
|
|
Call to virNetworkCreate failed: internal error: Network is already in use by interface vboxnet0.
|
|
</code></pre></div></div>
|
|
|
|
<p>This is fixed by stopping virtualbox and re-creating the vagrant box:</p>
|
|
|
|
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl stop virtualbox
|
|
vagrant destroy ubuntu-xenial
|
|
vagrant up ubuntu-xenial --provider=libvirt
|
|
</code></pre></div></div>
|
|
|
|
<h4 id="debian-and-ubuntu">Debian and Ubuntu</h4>
|
|
|
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt <span class="nb">install </span>vagrant vagrant-libvirt libvirt-daemon-system vagrant-mutate libvirt-dev
|
|
<span class="nb">sudo </span>usermod <span class="nt">-a</span> <span class="nt">-G</span> libvirt <span class="nv">$USER</span>
|
|
|
|
<span class="c"># Reboot</span>
|
|
|
|
vagrant box add bento/ubuntu-16.04 <span class="nt">--provider</span><span class="o">=</span>virtualbox
|
|
vagrant mutate bento/ubuntu-16.04 libvirt
|
|
vagrant up ubuntu-xenial <span class="nt">--provider</span><span class="o">=</span>libvirt
|
|
</code></pre></div></div>
|
|
|
|
<h4 id="other-distributions">Other Distributions</h4>
|
|
|
|
<p>You will need to install <a href="https://libvirt.org/">libvirt</a> and <code class="highlighter-rouge">vagrant-mutate</code> and then run</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>vagrant plugin <span class="nb">install </span>vagrant-libvirt
|
|
<span class="nb">sudo </span>usermod <span class="nt">-a</span> <span class="nt">-G</span> libvirt <span class="nv">$USER</span>
|
|
|
|
<span class="c"># Reboot</span>
|
|
|
|
vagrant plugin <span class="nb">install </span>vagrant-mutate
|
|
vagrant box fetch bento/ubuntu-16.04
|
|
vagrant mutate bento/ubuntu-16.04 libvirt
|
|
vagrant up ubuntu-xenial <span class="nt">--provider</span><span class="o">=</span>libvirt
|
|
</code></pre></div></div>
|
|
|
|
<h2 id="starting-libretime-vagrant">Starting LibreTime Vagrant</h2>
|
|
|
|
<p>To get started you clone the repo and run <code class="highlighter-rouge">vagrant up</code>. The command accepts a parameter to
|
|
change the default provider if you have multiple installed. This can be done by appending
|
|
<code class="highlighter-rouge">--provider=virtualbox</code> or <code class="highlighter-rouge">--provider=libvirt</code> as applicable.</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/libretime/libretime.git
|
|
<span class="nb">cd </span>libretime
|
|
vagrant up ubuntu-xenial
|
|
</code></pre></div></div>
|
|
|
|
<p>If everything works out, you will find LibreTime on <a href="http://localhost:8080">port 8080</a>,
|
|
icecast on <a href="http://localhost:8000">port 8000</a> and the docs on
|
|
<a href="http://localhost:8888">port 8888</a>.</p>
|
|
|
|
<p>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 <code class="highlighter-rouge">vagrant ssh ubuntu-xenial</code> in the libretime
|
|
directory.</p>
|
|
|
|
<h2 id="alternative-os-installations">Alternative OS installations</h2>
|
|
|
|
<p>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.</p>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>OS</th>
|
|
<th>Command</th>
|
|
<th>Comment</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Debian 10</td>
|
|
<td><code class="highlighter-rouge">vagrant up debian-buster</code></td>
|
|
<td>Install on Debian Buster.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Debian 9</td>
|
|
<td><code class="highlighter-rouge">vagrant up debian-stretch</code></td>
|
|
<td>Install on current Debian Stretch. Needs manual intervention due to Liquidsoap 1.3.3.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Ubuntu 18.04</td>
|
|
<td><code class="highlighter-rouge">vagrant up ubuntu-bionic</code></td>
|
|
<td>Install on current Ubuntu Bionic Beaver.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Ubuntu 16.04</td>
|
|
<td><code class="highlighter-rouge">vagrant up ubuntu-xenial</code></td>
|
|
<td>Install on Ubuntu Xenial Xerus.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>CentOS</td>
|
|
<td><code class="highlighter-rouge">vagrant up centos</code></td>
|
|
<td>Extremely experimental install on 7.3 with native systemd support and activated SELinux. Needs manual intervention due to Liquidsoap 1.3.3.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h2 id="troubleshooting">Troubleshooting</h2>
|
|
|
|
<p>If anything fails during the initial provisioning step you can try running <code class="highlighter-rouge">vagrant provision</code>
|
|
to re-run the installer.</p>
|
|
|
|
<p>If you only want to re-run parts of the installer, use <code class="highlighter-rouge">--provision-with $step</code>. The
|
|
supported steps are <code class="highlighter-rouge">prepare</code>, <code class="highlighter-rouge">install</code>, <code class="highlighter-rouge">install-mkdocs</code> and <code class="highlighter-rouge">start-mkdocs</code>.</p>
|