PVR
Installing an App with the pvr CLI
The pvr Command Line Interface (CLI) is the fastest and easiest way to manage changes on a Pantavisor-powered device. This guide will walk you through adding a new containerized app, specifically Tailscale, to your device.
1. Cloning the Device
First, you need to clone the device’s current state to your local machine. This process requires that your device is on the same local network and that you know its IP address.
To clone the device, use the following command:
pvr clone <DEVICE_IP> mydeviceThis command clones the device’s entire state, including all running containers, their configurations, and any associated files. The device’s Board Support Package (BSP) component is also cloned, ensuring a complete and accurate replica of your device’s software environment.
2. Adding the New Container
Now that you have a local copy of the device’s state, you can add the new container. This example adds the Tailscale container.
Use the pvr app add command to add the container from its source image:
pvr app add tailscale --from tailscale/tailscale --platform linux/arm64Next, stage the newly added files to prepare them for a commit:
pvr add .3. Committing the Changes
To verify that your changes have been staged correctly, you can use the pvr status command:
pvr statusThe output will look similar to this, showing the new files for the Tailscale app staged for a commit:
A tailscale/lxc.container.conf
A tailscale/root.squashfs
A tailscale/root.squashfs.docker-digestOnce you’ve confirmed the status, commit the changes with a descriptive message:
pvr commit -m "Add Tailscale container"This command creates a new revision of your device’s configuration on your local machine.
4. Deploying to the Device
To deploy the new revision to your device, use the pvr post command:
pvr postThis command pushes the new revision to the target device. The device will automatically download the new container and trigger a reboot to apply the changes.
5. Verifying the Installation
After the device reboots, you can verify that the new container is running. If you have a serial console connected to the device, you can use the following command to list all running containers:
lxc-lsThis command will display a list of all containers, including your newly installed Tailscale app, confirming that the installation was successful. You can also check the running containers on local pvtx UI that on http:<DEVICE IP>:12368/app