diff --git a/applets/compiler_block.pl b/applets/compiler_block.pl deleted file mode 100755 index c10e7ec3..00000000 --- a/applets/compiler_block.pl +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env perl - -# SPDX-FileCopyrightText: 2021 Pragmatic Software -# SPDX-License-Identifier: MIT - -# compiler_client.pl connects to compiler_server.pl hosted at PeerAddr/PeerPort below -# and sends a nick, language and code, then retreives and prints the compilation/execution output. -# -# this way we can run the compiler virtual machine on any remote server. - -use warnings; -use strict; - -use IO::Socket::INET; -use JSON; - -my $sock = IO::Socket::INET->new( - PeerAddr => '192.168.0.42', - PeerPort => 9000, - Proto => 'tcp' -); - -if (not defined $sock) { - print "Fatal error compiling: $!; try again later\n"; - die $!; -} - -my $json = join ' ', @ARGV; -my $h = decode_json $json; - -$h->{code} =~ s/\s*}\s*$//; - -my $lang = $h->{lang} // "c11"; -if ($code =~ s/-lang=([^ ]+)//) { $lang = lc $1; } - -$h->{lang} = $lang; -$json = encode_json $h; - -print $sock "$json\n"; - -while (my $line = <$sock>) { print "$line"; } - -close $sock; diff --git a/applets/compiler_client.pl b/applets/compiler_client.pl deleted file mode 100755 index 456cd326..00000000 --- a/applets/compiler_client.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl - -# SPDX-FileCopyrightText: 2021 Pragmatic Software -# SPDX-License-Identifier: MIT - -# compiler_client.pl connects to compiler_server.pl hosted at PeerAddr/PeerPort below -# and sends a nick, language and code, then retreives and prints the compilation/execution output. -# -# this way we can run the compiler virtual machine on any remote server. - -use warnings; -use strict; - -use IO::Socket; -use JSON; - -my $sock = IO::Socket::INET->new( - PeerAddr => '127.0.0.1', - PeerPort => 9000, - Proto => 'tcp' -); - -if (not defined $sock) { - print "Fatal error compiling: $!; try again later\n"; - die $!; -} - -my $json = join ' ', @ARGV; -my $h = decode_json $json; - -my $lang = $h->{lang} // "c11"; - -if ($h->{code} =~ s/-lang=([^ ]+)//) { $lang = lc $1; } - -$h->{lang} = $lang; -$json = encode_json $h; - -print $sock "$json\n"; - -while (my $line = <$sock>) { print "$line"; } - -close $sock; diff --git a/applets/horrorscope b/applets/horrorscope deleted file mode 100755 index ed1d4f73..00000000 --- a/applets/horrorscope +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# SPDX-FileCopyrightText: 2021 Pragmatic Software -# SPDX-License-Identifier: MIT -~/pbot/modules/lookupbot.pl horrorscope "$*" diff --git a/applets/compiler_vm/README.md b/applets/pbot-vm/README.md similarity index 100% rename from applets/compiler_vm/README.md rename to applets/pbot-vm/README.md diff --git a/applets/compiler_vm/guest/bin/accept-vsock-client b/applets/pbot-vm/guest/bin/accept-vsock-client similarity index 100% rename from applets/compiler_vm/guest/bin/accept-vsock-client rename to applets/pbot-vm/guest/bin/accept-vsock-client diff --git a/applets/compiler_vm/guest/bin/guest-gdb b/applets/pbot-vm/guest/bin/guest-gdb similarity index 100% rename from applets/compiler_vm/guest/bin/guest-gdb rename to applets/pbot-vm/guest/bin/guest-gdb diff --git a/applets/compiler_vm/guest/bin/guest-server b/applets/pbot-vm/guest/bin/guest-server similarity index 100% rename from applets/compiler_vm/guest/bin/guest-server rename to applets/pbot-vm/guest/bin/guest-server diff --git a/applets/compiler_vm/guest/bin/setup-guest b/applets/pbot-vm/guest/bin/setup-guest similarity index 100% rename from applets/compiler_vm/guest/bin/setup-guest rename to applets/pbot-vm/guest/bin/setup-guest diff --git a/applets/compiler_vm/guest/include/prelude.h b/applets/pbot-vm/guest/include/prelude.h similarity index 100% rename from applets/compiler_vm/guest/include/prelude.h rename to applets/pbot-vm/guest/include/prelude.h diff --git a/applets/compiler_vm/guest/lib/Guest.pm b/applets/pbot-vm/guest/lib/Guest.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Guest.pm rename to applets/pbot-vm/guest/lib/Guest.pm diff --git a/applets/compiler_vm/guest/lib/Languages/_c_base.pm b/applets/pbot-vm/guest/lib/Languages/_c_base.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/_c_base.pm rename to applets/pbot-vm/guest/lib/Languages/_c_base.pm diff --git a/applets/compiler_vm/guest/lib/Languages/_default.pm b/applets/pbot-vm/guest/lib/Languages/_default.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/_default.pm rename to applets/pbot-vm/guest/lib/Languages/_default.pm diff --git a/applets/compiler_vm/guest/lib/Languages/c11.pm b/applets/pbot-vm/guest/lib/Languages/c11.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/c11.pm rename to applets/pbot-vm/guest/lib/Languages/c11.pm diff --git a/applets/compiler_vm/guest/lib/Languages/c89.pm b/applets/pbot-vm/guest/lib/Languages/c89.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/c89.pm rename to applets/pbot-vm/guest/lib/Languages/c89.pm diff --git a/applets/compiler_vm/guest/lib/Languages/c99.pm b/applets/pbot-vm/guest/lib/Languages/c99.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/c99.pm rename to applets/pbot-vm/guest/lib/Languages/c99.pm diff --git a/applets/compiler_vm/guest/lib/Languages/clang.pm b/applets/pbot-vm/guest/lib/Languages/clang.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/clang.pm rename to applets/pbot-vm/guest/lib/Languages/clang.pm diff --git a/applets/compiler_vm/guest/lib/Languages/clang11.pm b/applets/pbot-vm/guest/lib/Languages/clang11.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/clang11.pm rename to applets/pbot-vm/guest/lib/Languages/clang11.pm diff --git a/applets/compiler_vm/guest/lib/Languages/clang89.pm b/applets/pbot-vm/guest/lib/Languages/clang89.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/clang89.pm rename to applets/pbot-vm/guest/lib/Languages/clang89.pm diff --git a/applets/compiler_vm/guest/lib/Languages/clang99.pm b/applets/pbot-vm/guest/lib/Languages/clang99.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/clang99.pm rename to applets/pbot-vm/guest/lib/Languages/clang99.pm diff --git a/applets/compiler_vm/guest/lib/Languages/clangpp.pm b/applets/pbot-vm/guest/lib/Languages/clangpp.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/clangpp.pm rename to applets/pbot-vm/guest/lib/Languages/clangpp.pm diff --git a/applets/compiler_vm/guest/lib/Languages/cpp.pm b/applets/pbot-vm/guest/lib/Languages/cpp.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/cpp.pm rename to applets/pbot-vm/guest/lib/Languages/cpp.pm diff --git a/applets/compiler_vm/guest/lib/Languages/freebasic.pm b/applets/pbot-vm/guest/lib/Languages/freebasic.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/freebasic.pm rename to applets/pbot-vm/guest/lib/Languages/freebasic.pm diff --git a/applets/compiler_vm/guest/lib/Languages/haskell.pm b/applets/pbot-vm/guest/lib/Languages/haskell.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/haskell.pm rename to applets/pbot-vm/guest/lib/Languages/haskell.pm diff --git a/applets/compiler_vm/guest/lib/Languages/java.pm b/applets/pbot-vm/guest/lib/Languages/java.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/java.pm rename to applets/pbot-vm/guest/lib/Languages/java.pm diff --git a/applets/compiler_vm/guest/lib/Languages/qbasic.pm b/applets/pbot-vm/guest/lib/Languages/qbasic.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/qbasic.pm rename to applets/pbot-vm/guest/lib/Languages/qbasic.pm diff --git a/applets/compiler_vm/guest/lib/Languages/tendra.pm b/applets/pbot-vm/guest/lib/Languages/tendra.pm similarity index 100% rename from applets/compiler_vm/guest/lib/Languages/tendra.pm rename to applets/pbot-vm/guest/lib/Languages/tendra.pm diff --git a/applets/compiler_vm/guest/polkit/00-auth-only.rules b/applets/pbot-vm/guest/polkit/00-auth-only.rules similarity index 100% rename from applets/compiler_vm/guest/polkit/00-auth-only.rules rename to applets/pbot-vm/guest/polkit/00-auth-only.rules diff --git a/applets/compiler_vm/host/bin/vm-client b/applets/pbot-vm/host/bin/vm-client similarity index 100% rename from applets/compiler_vm/host/bin/vm-client rename to applets/pbot-vm/host/bin/vm-client diff --git a/applets/compiler_vm/host/bin/vm-exec b/applets/pbot-vm/host/bin/vm-exec similarity index 100% rename from applets/compiler_vm/host/bin/vm-exec rename to applets/pbot-vm/host/bin/vm-exec diff --git a/applets/compiler_vm/host/bin/vm-server b/applets/pbot-vm/host/bin/vm-server similarity index 100% rename from applets/compiler_vm/host/bin/vm-server rename to applets/pbot-vm/host/bin/vm-server diff --git a/applets/compiler_vm/host/bin/vm-watchdog b/applets/pbot-vm/host/bin/vm-watchdog similarity index 100% rename from applets/compiler_vm/host/bin/vm-watchdog rename to applets/pbot-vm/host/bin/vm-watchdog diff --git a/applets/compiler_vm/host/devices/add-all b/applets/pbot-vm/host/devices/add-all similarity index 100% rename from applets/compiler_vm/host/devices/add-all rename to applets/pbot-vm/host/devices/add-all diff --git a/applets/compiler_vm/host/devices/add-serials b/applets/pbot-vm/host/devices/add-serials similarity index 100% rename from applets/compiler_vm/host/devices/add-serials rename to applets/pbot-vm/host/devices/add-serials diff --git a/applets/compiler_vm/host/devices/add-vsock b/applets/pbot-vm/host/devices/add-vsock similarity index 100% rename from applets/compiler_vm/host/devices/add-vsock rename to applets/pbot-vm/host/devices/add-vsock diff --git a/applets/compiler_vm/host/history/.gitignore b/applets/pbot-vm/host/history/.gitignore similarity index 100% rename from applets/compiler_vm/host/history/.gitignore rename to applets/pbot-vm/host/history/.gitignore diff --git a/applets/compiler_vm/host/lib/Diff.pm b/applets/pbot-vm/host/lib/Diff.pm similarity index 100% rename from applets/compiler_vm/host/lib/Diff.pm rename to applets/pbot-vm/host/lib/Diff.pm diff --git a/applets/compiler_vm/host/lib/InteractiveEdit.pm b/applets/pbot-vm/host/lib/InteractiveEdit.pm similarity index 100% rename from applets/compiler_vm/host/lib/InteractiveEdit.pm rename to applets/pbot-vm/host/lib/InteractiveEdit.pm diff --git a/applets/compiler_vm/host/lib/Languages/_c_base.pm b/applets/pbot-vm/host/lib/Languages/_c_base.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/_c_base.pm rename to applets/pbot-vm/host/lib/Languages/_c_base.pm diff --git a/applets/compiler_vm/host/lib/Languages/_default.pm b/applets/pbot-vm/host/lib/Languages/_default.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/_default.pm rename to applets/pbot-vm/host/lib/Languages/_default.pm diff --git a/applets/compiler_vm/host/lib/Languages/bash.pm b/applets/pbot-vm/host/lib/Languages/bash.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/bash.pm rename to applets/pbot-vm/host/lib/Languages/bash.pm diff --git a/applets/compiler_vm/host/lib/Languages/bc.pm b/applets/pbot-vm/host/lib/Languages/bc.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/bc.pm rename to applets/pbot-vm/host/lib/Languages/bc.pm diff --git a/applets/compiler_vm/host/lib/Languages/bf.pm b/applets/pbot-vm/host/lib/Languages/bf.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/bf.pm rename to applets/pbot-vm/host/lib/Languages/bf.pm diff --git a/applets/compiler_vm/host/lib/Languages/c11.pm b/applets/pbot-vm/host/lib/Languages/c11.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/c11.pm rename to applets/pbot-vm/host/lib/Languages/c11.pm diff --git a/applets/compiler_vm/host/lib/Languages/c89.pm b/applets/pbot-vm/host/lib/Languages/c89.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/c89.pm rename to applets/pbot-vm/host/lib/Languages/c89.pm diff --git a/applets/compiler_vm/host/lib/Languages/c99.pm b/applets/pbot-vm/host/lib/Languages/c99.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/c99.pm rename to applets/pbot-vm/host/lib/Languages/c99.pm diff --git a/applets/compiler_vm/host/lib/Languages/clang.pm b/applets/pbot-vm/host/lib/Languages/clang.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/clang.pm rename to applets/pbot-vm/host/lib/Languages/clang.pm diff --git a/applets/compiler_vm/host/lib/Languages/clang11.pm b/applets/pbot-vm/host/lib/Languages/clang11.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/clang11.pm rename to applets/pbot-vm/host/lib/Languages/clang11.pm diff --git a/applets/compiler_vm/host/lib/Languages/clang89.pm b/applets/pbot-vm/host/lib/Languages/clang89.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/clang89.pm rename to applets/pbot-vm/host/lib/Languages/clang89.pm diff --git a/applets/compiler_vm/host/lib/Languages/clang99.pm b/applets/pbot-vm/host/lib/Languages/clang99.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/clang99.pm rename to applets/pbot-vm/host/lib/Languages/clang99.pm diff --git a/applets/compiler_vm/host/lib/Languages/clangpp.pm b/applets/pbot-vm/host/lib/Languages/clangpp.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/clangpp.pm rename to applets/pbot-vm/host/lib/Languages/clangpp.pm diff --git a/applets/compiler_vm/host/lib/Languages/clisp.pm b/applets/pbot-vm/host/lib/Languages/clisp.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/clisp.pm rename to applets/pbot-vm/host/lib/Languages/clisp.pm diff --git a/applets/compiler_vm/host/lib/Languages/cpp.pm b/applets/pbot-vm/host/lib/Languages/cpp.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/cpp.pm rename to applets/pbot-vm/host/lib/Languages/cpp.pm diff --git a/applets/compiler_vm/host/lib/Languages/freebasic.pm b/applets/pbot-vm/host/lib/Languages/freebasic.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/freebasic.pm rename to applets/pbot-vm/host/lib/Languages/freebasic.pm diff --git a/applets/compiler_vm/host/lib/Languages/go.pm b/applets/pbot-vm/host/lib/Languages/go.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/go.pm rename to applets/pbot-vm/host/lib/Languages/go.pm diff --git a/applets/compiler_vm/host/lib/Languages/haskell.pm b/applets/pbot-vm/host/lib/Languages/haskell.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/haskell.pm rename to applets/pbot-vm/host/lib/Languages/haskell.pm diff --git a/applets/compiler_vm/host/lib/Languages/java.pm b/applets/pbot-vm/host/lib/Languages/java.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/java.pm rename to applets/pbot-vm/host/lib/Languages/java.pm diff --git a/applets/compiler_vm/host/lib/Languages/javascript.pm b/applets/pbot-vm/host/lib/Languages/javascript.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/javascript.pm rename to applets/pbot-vm/host/lib/Languages/javascript.pm diff --git a/applets/compiler_vm/host/lib/Languages/ksh.pm b/applets/pbot-vm/host/lib/Languages/ksh.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/ksh.pm rename to applets/pbot-vm/host/lib/Languages/ksh.pm diff --git a/applets/compiler_vm/host/lib/Languages/lua.pm b/applets/pbot-vm/host/lib/Languages/lua.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/lua.pm rename to applets/pbot-vm/host/lib/Languages/lua.pm diff --git a/applets/compiler_vm/host/lib/Languages/perl.pm b/applets/pbot-vm/host/lib/Languages/perl.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/perl.pm rename to applets/pbot-vm/host/lib/Languages/perl.pm diff --git a/applets/compiler_vm/host/lib/Languages/php.pm b/applets/pbot-vm/host/lib/Languages/php.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/php.pm rename to applets/pbot-vm/host/lib/Languages/php.pm diff --git a/applets/compiler_vm/host/lib/Languages/python.pm b/applets/pbot-vm/host/lib/Languages/python.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/python.pm rename to applets/pbot-vm/host/lib/Languages/python.pm diff --git a/applets/compiler_vm/host/lib/Languages/python3.pm b/applets/pbot-vm/host/lib/Languages/python3.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/python3.pm rename to applets/pbot-vm/host/lib/Languages/python3.pm diff --git a/applets/compiler_vm/host/lib/Languages/qbasic.pm b/applets/pbot-vm/host/lib/Languages/qbasic.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/qbasic.pm rename to applets/pbot-vm/host/lib/Languages/qbasic.pm diff --git a/applets/compiler_vm/host/lib/Languages/ruby.pm b/applets/pbot-vm/host/lib/Languages/ruby.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/ruby.pm rename to applets/pbot-vm/host/lib/Languages/ruby.pm diff --git a/applets/compiler_vm/host/lib/Languages/scheme.pm b/applets/pbot-vm/host/lib/Languages/scheme.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/scheme.pm rename to applets/pbot-vm/host/lib/Languages/scheme.pm diff --git a/applets/compiler_vm/host/lib/Languages/sh.pm b/applets/pbot-vm/host/lib/Languages/sh.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/sh.pm rename to applets/pbot-vm/host/lib/Languages/sh.pm diff --git a/applets/compiler_vm/host/lib/Languages/tcl.pm b/applets/pbot-vm/host/lib/Languages/tcl.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/tcl.pm rename to applets/pbot-vm/host/lib/Languages/tcl.pm diff --git a/applets/compiler_vm/host/lib/Languages/tendra.pm b/applets/pbot-vm/host/lib/Languages/tendra.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/tendra.pm rename to applets/pbot-vm/host/lib/Languages/tendra.pm diff --git a/applets/compiler_vm/host/lib/Languages/zsh.pm b/applets/pbot-vm/host/lib/Languages/zsh.pm similarity index 100% rename from applets/compiler_vm/host/lib/Languages/zsh.pm rename to applets/pbot-vm/host/lib/Languages/zsh.pm diff --git a/applets/compiler_vm/host/lib/Paste.pm b/applets/pbot-vm/host/lib/Paste.pm similarity index 100% rename from applets/compiler_vm/host/lib/Paste.pm rename to applets/pbot-vm/host/lib/Paste.pm diff --git a/applets/compiler_vm/host/lib/SplitLine.pm b/applets/pbot-vm/host/lib/SplitLine.pm similarity index 100% rename from applets/compiler_vm/host/lib/SplitLine.pm rename to applets/pbot-vm/host/lib/SplitLine.pm diff --git a/data/factoids.sqlite3 b/data/factoids.sqlite3 index 3bc6053f..03f8755c 100644 Binary files a/data/factoids.sqlite3 and b/data/factoids.sqlite3 differ diff --git a/doc/README.md b/doc/README.md index 790b25c7..76f73516 100644 --- a/doc/README.md +++ b/doc/README.md @@ -327,6 +327,7 @@ * [Create a new virtual machine](VirtualMachine.md#create-a-new-virtual-machine) * [Install Linux in the virtual machine](VirtualMachine.md#install-linux-in-the-virtual-machine) * [Set up serial ports](VirtualMachine.md#set-up-serial-ports) + * [Set up virtio-vsock](VirtualMachine.md#set-up-virtio-vsock) * [Reboot virtual machine](VirtualMachine.md#reboot-virtual-machine) * [Install software](VirtualMachine.md#install-software) * [Install Perl](VirtualMachine.md#install-perl) diff --git a/doc/VirtualMachine.md b/doc/VirtualMachine.md index 7f5229f0..fa8fa16f 100644 --- a/doc/VirtualMachine.md +++ b/doc/VirtualMachine.md @@ -128,7 +128,7 @@ depending on your hardware and network configuration. #### Set up serial ports While the installation is in progress, switch to a terminal on your host system. Go into the -`applets/compiler_vm/host/devices` directory and run the `add-serials` script to add the `serial-2.xml` and +`applets/pbot-vm/host/devices` directory and run the `add-serials` script to add the `serial-2.xml` and `serial-3.xml` files to the configuration for the `pbot-vm` libvirt machine. host$ ./add-serials @@ -195,7 +195,7 @@ We must attach a `vhost-vsock-pci` device to the guest to enable VM sockets comm Each VM on a hypervisor must have a unique context ID (CID). Each service within the VM must have a unique port. The PBot VM Guest defaults to `7` for the CID and `5555` for the port. -While still in the `applets/compiler_vm/host/devices` directory, run the `add-vsock` script: +While still in the `applets/pbot-vm/host/devices` directory, run the `add-vsock` script: host$ ./add-vsock @@ -238,22 +238,30 @@ as well as a few Perl modules. #### Install PBot VM Guest Next we install the PBot VM Guest server script that fosters communication between the virtual machine guest and the physical host system. We'll do this inside the virtual machine guest system, logged on as `root` -while in the `/root` directory. Feel free to `chdir` to `/tmp` if you prefer. +while in the `/tmp` directory. + + guest$ chdir /tmp The `rsync` command isn't installed with a Fedora minimal install, but `scp` is available. Replace `192.168.100.42` below with your own local IP address; `user` with the user account that has the PBot directory; and `pbot` with the path to the directory. - guest$ scp -r user@192.168.100.42:~/pbot/applets/compiler_vm/guest . + guest$ scp -r user@192.168.100.42:~/pbot/applets/pbot-vm/guest . Once that's done, run the following command: guest$ ./guest/bin/setup-guest -After running the `setup-guest` script, we need to make the environment changes take effect: +This will install `guest-server` to `/usr/local/bin/`, set up some environment variables and +harden the guest system. After running the `setup-guest` script, we need to make the environment +changes take effect: guest$ source /root/.bashrc +We no longer need the `/tmp/guest/` stuff. We can delete it: + + guest$ rm -rf guest/ + #### Start PBot VM Guest We're ready to start the PBot VM Guest server. On the guest, as `root`, execute the command: @@ -273,9 +281,11 @@ under [Set up serial ports](#set-up-serial-ports) and that your network configur access. Let's make sure the PBot VM Guest server is listening for and can execute commands. The `vm-exec` command -in the `applets/compiler_vm/host/bin` directory allows you to send commands from the shell. +allows you to send commands from the shell. Change your currect working directory to `applets/pbot-vm/host/bin` +and run the `vm-exec` command: - host$ vm-exec -lang=sh echo hello world + host$ cd applets/pbot-vm/host/bin + host$ ./vm-exec -lang=sh echo hello world This should output some logging noise followed by "hello world". You can test other language modules by changing the `-lang=` option. I recommend testing and verifying that all of your desired language @@ -284,7 +294,7 @@ modules are configured before going on to the next step. If you have multiple PBot VM Guests, or if you used a different TCP port, you can specify the `PBOTVM_SERIAL` environment variable when executing the `vm-exec` command: - host$ PBOTVM_SERIAL=7777 vm-exec -lang=sh echo test + host$ PBOTVM_SERIAL=7777 ./vm-exec -lang=sh echo test #### Save initial state Switch back to an available terminal on the physical host machine. Enter the following command @@ -305,10 +315,11 @@ virtual machine will continue running in the background until it is manually shu `shutdown now -h` inside the VM or via `virsh shutdown pbot-vm` on the host). ## Start PBot VM Host -To start the PBot VM Host server, execute the `vm-server` script in the -`applets/compiler_vm/host/bin` directory on the host. +To start the PBot VM Host server, change your current working directory to `applets/pbot-vm/host/bin` +and execute the `vm-server` script: - host$ vm-server + host$ cd applets/pbot-vm/host/bin + host$ ./vm-server This will start a TCP server on port `9000`. It will listen for incoming commands and pass them along to the virtual machine's TCP serial port `5555`. It will also monitor @@ -322,8 +333,15 @@ use `other-vm` with a longer `30` second timeout, on different serial and heartb ### Test PBot All done. Everything is set up now. -PBot is already preconfigured with commands that invoke the `applets/compiler_client.pl` -script (a copy of `host/bin/vm-client`) to send VM commands to port `9000`. +PBot is already preconfigured with commands that invoke the `host/bin/vm-client` +script to send VM commands to `vm-server` on the default port `9000`: + + factshow sh + [global] sh: /call cc -lang=sh + factshow cc + [global] cc: /call compiler {"nick":"$nick:json","channel":"$channel:json","code":"$args:json"} + factshow compiler + [global] compiler: pbot-vm/host/bin/vm-client [applet] In your instance of PBot, the `sh echo hello` command should output `hello`.