Run your bots' computer on your own machine
Member·7 minutes to read
What this does for you
Your bots normally use a computer hosted by Botseon. With this page you move that computer to a machine or server of your own: a desktop under your desk, a server in your office or a virtual machine you rent. Your bots then open their screens, run their commands and keep their files on that machine.
The rules stay the same as on the hosted computer:
- an approval your organisation asks for is still asked for;
- a person driving a screen still holds it until they stop;
- the bots can still reach only the sites your organisation allows.
Before you start
- You are signed in to the hosted Botseon service. The home edition already runs its computer on your own hardware, so it has no such setting.
- The machine runs Linux with Docker. The connect command downloads one image, the same computer image the hosted computers run. It starts that image once as a small connect container, and the connect container starts your computer from the same image next to it.
- The machine has a private address the Botseon service can reach, such as an address on a private network you share with the service. A home network address behind a router is not enough on its own. Ask your administrator which private network your organisation uses.
- The machine holds your own computer and, if your organisation spreads bots across A pool per person, each pool computer of yours as well: every one runs as its own box on the machine.
- Bots that get a computer of their own (one computer per bot), and pool computers of members who have not connected a machine, run on your team's servers when an owner or admin has added some, and on the hosted computers otherwise.
- The service reaches your computer on port
7443of the machine, and each pool computer on the next port up (7444for the first pool computer,7445for the second, and so on). Allow those ports from the private network, and nothing else.
Steps
- Open Settings → Computer and find Your own machine.
- Choose
Connect a machine. A command appears underRun this once on the machine (it needs Docker and downloads one image):. It works once, and only for 15 minutes. It is not shown again. ChooseCopyto copy it. - Run the command in a terminal on the machine. It starts a container called
botseon-connectthat restarts with the machine. If the machine has more than one private address, add-e BOTSEON_CONNECT_ADDRESS=<address>before the image name, so the service reaches the right one. Only this container is given the machine's Docker socket; the computers it starts are not. - Wait for the status line.
Waiting for the machine to connect…turns into<machine name> is connected. Your bots use it.within a minute. From then on your bots start their work on that machine. - To stop using it, choose
Disconnect. The status readsDisconnected. Your bots use the hosted computer again.At its next check-in the machine stops every computer it was running for your bots, and thebotseon-connectcontainer stops too and stays stopped. The files those computers kept stay on the machine; remove thebotseon-connectcontainer and its volume yourself when you no longer need them.
To move to a different machine, choose Connect a different machine and run the new command there. The machine you used before is disconnected when you do.
Your team's servers
An owner or admin can run the team's pooled and isolated bot computers on the team's own servers. The same rules apply as above: approvals, screen control and allowed sites stay as they are. A member who connected their own machine keeps their own pool computers on it; the team's servers take the rest.
- Open Settings → Computer and find Your team's servers. Members who are not an owner or admin do not see it.
- Choose
Add a server. A command appears underRun this once on the server (it needs Docker and downloads one image):. It is the same kind of command as for your own machine: it works once, for 15 minutes. - Run it on the server. The line for the server reads
Waiting for the server to connect…, then<server name> is connected and free. - Add one server for each computer you want to run. Each server runs one bot computer at a time. When a bot on a pool or with a computer of its own needs its computer, Botseon puts it on a free server, and the line reads
<server name> is connected and running a bot computer.The computer stays on that server from then on. - To take a server away, choose
Disconnecton its line. Its bot computer moves to another free server the next time it is needed. When the team has no servers left, bots go back to the hosted computers.
Once the team has a server, its pooled and isolated computers do not start on the hosted computers. A bot whose server is offline, or that finds every server busy, waits instead. Add a server, or disconnect them all to go back to the hosted computers.
A worked example
On a server whose private address is 10.20.0.7, the command from step 2 looks like this. The code and the service address are your own:
docker run -d --name botseon-connect --restart unless-stopped --network host \
-v /var/run/docker.sock:/var/run/docker.sock \
-v botseon-connect:/var/lib/botseon-connect \
-e BOTSEON_CONNECT_URL='https://app.example' \
-e BOTSEON_CONNECT_CODE='bsc_…' \
'ghcr.io/botseon/botseon-computer:latest' connect
The word connect after the image name starts the image's connect mode instead of a computer.
Copy the command from Settings rather than from this page: the image name it shows is the one your
deployment publishes, and it may differ from the example.
To check on it later, run docker logs botseon-connect on the server. The container's own lines start with [botseon-connect].
What can go wrong
| What you see | Why | What to do |
|---|---|---|
The connect command expired before a machine used it. Make a new one. | Nobody ran the command within 15 minutes. | Choose Connect a machine again and run the new command. |
[botseon-connect] connect: the connect code was refused — it is used or expired; make a new one in Settings > Computer | The code was already used, or it expired. | Make a new command in Settings → Computer. |
[botseon-connect] no private address found on this machine; set BOTSEON_CONNECT_ADDRESS to the address the service reaches it at | The machine has no private address the container will pick on its own. It never advertises a public one. | Run the command again with -e BOTSEON_CONNECT_ADDRESS=<address>. |
<machine name> is offline. Bots wait for it to come back. | The service has not heard from the machine for a minute: it is off, asleep or off the network. | Start the machine, or check that the botseon-connect container is running. Bots wait for it. They do not move to the hosted computer on their own. |
[botseon-connect] this machine was disconnected in Settings > Computer; stopping its computers | You chose Disconnect, or you connected a different machine. | Nothing, if you meant to. Otherwise connect the machine again. |
A bot on a pool does not start, and every line under Your team's servers reads is connected and running a bot computer. | Each server runs one computer, and all are taken. | Add a server. |
The box starts and stops again, and docker logs of the box mentions the encrypted volume | The server's kernel or AppArmor stops the box mounting its volume. | Run the command again with -e COMPUTER_DOCKER_APPARMOR_PROFILE=<profile> after loading the profile the computer image ships, or with -e COMPUTER_DOCKER_DM_MAJOR=<number> from /proc/devices. |
See also
Last verified against build 5561f08.