3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 11:59:43 +01:00
pbot/applets/pbot-vm/vagrant
2024-04-04 12:23:45 -07:00
..
common pbot-vm: add experimental Vagrant provisioning 2024-04-04 03:41:58 -07:00
Debian-testing64 pbot-vm: add experimental Vagrant provisioning 2024-04-04 03:41:58 -07:00
openSUSE-Tumbleweed pbot-vm: add experimental Vagrant provisioning 2024-04-04 03:41:58 -07:00
README.md pbot-vm: documentation tweaks 2024-04-04 12:23:45 -07:00

Vagrant instructions

Install libvirt and QEMU/KVM

Follow PBot VM Prerequisites up to the libvirt and QEMU section, then return to this guide.

Install Vagrant

To install vagrant on openSUSE, use:

zypper install --no-recommends vagrant vagrant-libvirt

Otherwise see https://vagrant-libvirt.github.io/vagrant-libvirt/installation.html for installation instructions for your platform.

Install vagrant-libvirt

If your distribution does not have a vagrant-libvirt package or if you need an up-to-date version use Vagrants plugin manager:

vagrant plugin install vagrant-libvirt

Start Vagrant Box

To start a virtual machine, cd into one of the PBot-VM Vagrant sub-directories and run the following command. This will download the appropriate virtual machine image and automatically configure it as a PBot VM Guest.

vagrant up

You may pass optional environment variables to override pbot-vm default configuration (see PBot VM Environment Variables):

PBOTVM_SERIAL=7777 PBOTVM_HEART=7778 vagrant up

Connect to Vagrant Box

vagrant ssh

Start PBot VM Guest Server

sudo guest-server

Some distributions may require you to specify the full path:

sudo /usr/local/bin/guest-server

Start PBot VM Host Server

After starting the guest-server, you must now start the host server.

../host/bin/vm-server

Test PBot VM

In your instance of PBot, the sh and cc, etc, commands should now produce output:

<pragma-> sh echo Hello world!
   <PBot> Hello world!

Shutdown Vagrant Box

vagrant halt

Destroy Vagrant Box

vagrant destroy

Delete Vagrant Box

vagrant box list
vagrant box remove <name>

(Optional) Install Alternative Vagrant Box

To install an alternative Vagrant box with your preferred OS/distribution, search for one at https://app.vagrantup.com/boxes/search and then make a new directory, e.g. FreeBSD-14, and copy one of the existing PBot-VM Vagrantfiles into this directory, and then edit the config.vm.box line to point at the chosen OS/distribution, e.g. freebsd/FreeBSD-14.0-CURRENT.

Some boxes may have specific settings that you may need to copy over. To obtain and examine the boxs Vagrantfile:

vagrant init <OS/distribution>

Examples:

vagrant init debian/testing64
vagrant init debian/bookworm64
vagrant init opensuse/Tumbleweed.x86_64
vagrant init archlinux/archlinux
vagrant init freebsd/FreeBSD-14.0-CURRENT
vagrant init generic/openbsd7

Then use one of the existing PBot-VM Vagrantfiles as a guide for adjusting your alternative Vagrantfile.