Files
oam/knowledge base/ubports.md
2023-02-25 21:13:08 +01:00

2.0 KiB

UBports

  1. TL;DR
  2. Connect using SSH
  3. Sources

TL;DR

# List containers.
libertine-container-manager list

# Create containers.
# Default type: 'chroot'.
libertine-container-manager create -i 'identifier'
libertine-container-manager create -i 'identifier' -n 'name' -t 'lxc'

# Search for packages.
libertine-container-manager search-cache -s 'pattern'

# Install packages.
libertine-container-manager install-package -p 'package'

# Execute commands.
libertine-container-manager exec -c 'command'
libertine-launch -i 'identifier' ls -a
DISPLAY= libertine-launch ls -a

# Get a shell inside the container.
DISPLAY= libertine-launch '/bin/bash'

# Launch graphical applications from the terminal.
ubuntu-app-launch 'containerId_app_0.0'

# Remove packages.
libertine-container-manager remove-package -p 'package'

# Destroy containers.
libertine-container-manager destroy -i 'identifier'

Connect using SSH

SSH is configured to allow only public key-based access.

  1. Open the terminal application.

  2. Download, receive or otherwise write the public key on your device:

    wget 'https://some.reachable.url/key.pub'
    
  3. Copy the key to the authorized_keys file; start from the following commands:

    mkdir "${HOME}/.ssh"
    chmod 700 "${HOME}/.ssh"
    cat "${HOME}/key.pub" >> "${HOME}/.ssh/authorized_keys"
    chmod 600 "${HOME}/.ssh/authorized_keys"
    
  4. Start SSH:

    # On Android-based devices (like the OnePlus One).
    sudo android-gadget-service enable ssh
    
    # On Linux-based devices (like the PinePhone).
    sudo service ssh start
    
  5. Optionally, find the device's IP address:

    hostname -I
    
  6. Finally, connect from a device using the private key and the phablet user:

    ssh -i 'path/to/private.key' 'phablet@ubuntu-phablet.lan'
    

Sources