tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
3.07k stars 259 forks source link

Support for Ubuntu on Raspberry Pi #287

Closed SmugZombie closed 3 years ago

SmugZombie commented 4 years ago

Description

When attempting to run the install script from the main readme (curl quick-install). The script runs to a certain point then fails.

image

Returns an error that python-pip is not available. Which is true.. Because it is python3-pip

Raspberry Pi 4, Running Ubuntu

What's the behavior that you expect?

Installation to look for the proper package and install properly

What's happening instead?

Installation is looking for an invalid package

What are the steps to reproduce this behavior?

Ran the quick-install script multiple times..

image

Screenshots

Seen above

Logs

root@arm-cluster-01:/# curl   --silent   --show-error   https://raw.githubusercontent.com/mtlynch/tinypilot/master/quick-install |     bash - &&   sudo reboot
+ set -e
+ '[' -f /etc/nginx/sites-enabled/KVMPi.conf ']'
+ '[' -z '' ']'
+ TINYPILOT_INSTALL_VARS=
+ echo 'Using default install vars'
Using default install vars
+ set -u
++ mktemp -d
+ pushd /tmp/tmp.PVrdJM7deo
/tmp/tmp.PVrdJM7deo /
+ sudo apt-get update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Reading package lists... Done
+ sudo apt-get install -y libffi-dev libssl-dev python3-dev python3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
libffi-dev is already the newest version (3.3-4).
libssl-dev is already the newest version (1.1.1f-1ubuntu2).
python3-dev is already the newest version (3.8.2-0ubuntu2).
python3-venv is already the newest version (3.8.2-0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
+ python3 -m venv venv
+ . venv/bin/activate
++ deactivate nondestructive
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /usr/bin/bash -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/tmp/tmp.PVrdJM7deo/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ PATH=/tmp/tmp.PVrdJM7deo/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' 'x(venv) ' '!=' x ']'
++ PS1='(venv) '
++ export PS1
++ '[' -n /usr/bin/bash -o -n '' ']'
++ hash -r
+ pip install wheel==0.34.2
Collecting wheel==0.34.2
  Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Installing collected packages: wheel
Successfully installed wheel-0.34.2
+ pip install ansible==2.9.10
Processing /root/.cache/pip/wheels/f0/02/9e/e40841e0c3ab60142092320d6cbe45c699a965e6224dbd1258/ansible-2.9.10-py3-none-any.whl
Processing /root/.cache/pip/wheels/13/90/db/290ab3a34f2ef0b5a0f89235dc2d40fea83e77de84ed2dc05c/PyYAML-5.3.1-cp38-cp38-linux_aarch64.whl
Collecting jinja2
  Using cached Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting cryptography
  Using cached cryptography-3.1.1-cp35-abi3-manylinux2014_aarch64.whl (2.6 MB)
Processing /root/.cache/pip/wheels/0c/61/d6/4db4f4c28254856e82305fdb1f752ed7f8482e54c384d8cb0e/MarkupSafe-1.1.1-py3-none-any.whl
Collecting six>=1.4.1
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting cffi!=1.11.3,>=1.8
  Using cached cffi-1.14.3-cp38-cp38-manylinux2014_aarch64.whl (208 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Installing collected packages: PyYAML, MarkupSafe, jinja2, six, pycparser, cffi, cryptography, ansible
Successfully installed MarkupSafe-1.1.1 PyYAML-5.3.1 ansible-2.9.10 cffi-1.14.3 cryptography-3.1.1 jinja2-2.11.2 pycparser-2.20 six-1.15.0
+ echo '[defaults]
roles_path = /tmp/tmp.PVrdJM7deo
interpreter_python = /usr/bin/python3
'
+ ansible-galaxy install mtlynch.tinypilot
- downloading role 'tinypilot', owned by mtlynch
- downloading role from https://github.com/mtlynch/ansible-role-tinypilot/archive/master.tar.gz
- extracting mtlynch.tinypilot to /tmp/tmp.PVrdJM7deo/mtlynch.tinypilot
- mtlynch.tinypilot (master) was installed successfully
- adding dependency: mtlynch.ustreamer
- adding dependency: geerlingguy.nginx
- downloading role 'ustreamer', owned by mtlynch
- downloading role from https://github.com/mtlynch/ansible-role-ustreamer/archive/master.tar.gz
- extracting mtlynch.ustreamer to /tmp/tmp.PVrdJM7deo/mtlynch.ustreamer
- mtlynch.ustreamer (master) was installed successfully
- downloading role 'nginx', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-nginx/archive/2.8.0.tar.gz
- extracting geerlingguy.nginx to /tmp/tmp.PVrdJM7deo/geerlingguy.nginx
- geerlingguy.nginx (2.8.0) was installed successfully
+ echo '- hosts: localhost
  connection: local
  become: true
  become_method: sudo
  roles:
    - role: mtlynch.tinypilot'
+ ansible-playbook -i localhost, install.yml --extra-vars ''

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [mtlynch.ustreamer : enable OpenMax IL acceleration on Pi OS] *************
ok: [localhost]

TASK [mtlynch.ustreamer : collect universal required apt packages] *************
ok: [localhost]

TASK [mtlynch.ustreamer : collect Raspberry Pi OS specific required apt packages] ***
skipping: [localhost]

TASK [mtlynch.ustreamer : install libraspberrypi-dev if we're using OpenMax IL acceleration] ***
skipping: [localhost]

TASK [mtlynch.ustreamer : collect Debian-specific required apt packages] *******
skipping: [localhost]

TASK [mtlynch.ustreamer : collect Ubuntu-specific required apt packages] *******
ok: [localhost]

TASK [mtlynch.ustreamer : install uStreamer pre-requisite packages] ************
ok: [localhost]

TASK [mtlynch.ustreamer : create ustreamer group] ******************************
ok: [localhost]

TASK [mtlynch.ustreamer : create ustreamer user] *******************************
ok: [localhost]

TASK [mtlynch.ustreamer : create uStreamer folder] *****************************
ok: [localhost]

TASK [mtlynch.ustreamer : get uStreamer repo] **********************************
ok: [localhost]

TASK [mtlynch.ustreamer : clean repository if needed] **************************
skipping: [localhost]

TASK [mtlynch.ustreamer : build uStreamer] *************************************
ok: [localhost]

TASK [mtlynch.ustreamer : fix uStreamer folder permissions] ********************
ok: [localhost]

TASK [mtlynch.ustreamer : install uStreamer as a service] **********************
ok: [localhost]

TASK [mtlynch.ustreamer : enable systemd uStreamer service file] ***************
ok: [localhost]

TASK [geerlingguy.nginx : Include OS-specific variables.] **********************
ok: [localhost]

TASK [geerlingguy.nginx : Define nginx_user.] **********************************
ok: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
included: /tmp/tmp.PVrdJM7deo/geerlingguy.nginx/tasks/setup-Ubuntu.yml for localhost

TASK [geerlingguy.nginx : Ensure dirmngr is installed (gnupg dependency).] *****
ok: [localhost]

TASK [geerlingguy.nginx : Add PPA for Nginx.] **********************************
skipping: [localhost]

TASK [geerlingguy.nginx : Ensure nginx will reinstall if the PPA was just added.] ***
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
included: /tmp/tmp.PVrdJM7deo/geerlingguy.nginx/tasks/setup-Debian.yml for localhost

TASK [geerlingguy.nginx : Update apt cache.] ***********************************
ok: [localhost]

TASK [geerlingguy.nginx : Ensure nginx is installed.] **************************
ok: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : include_tasks] ***************************************
skipping: [localhost]

TASK [geerlingguy.nginx : Remove default nginx vhost config file (if configured).] ***
ok: [localhost]

TASK [geerlingguy.nginx : Ensure nginx_vhost_path exists.] *********************
ok: [localhost]

TASK [geerlingguy.nginx : Add managed vhost config files.] *********************
ok: [localhost] => (item={'listen': '80 default_server', 'server_name': 'tinypilot', 'root': '/opt/tinypilot', 'index': 'index.html', 'extra_parameters': 'proxy_buffers 16 16k;\nproxy_buffer_size 16k;\nproxy_set_header Host $host;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_http_version 1.1;\n\nlocation /socket.io {\n  proxy_pass http://tinypilot;\n  proxy_set_header Upgrade $http_upgrade;\n  proxy_set_header Connection "Upgrade";\n}\nlocation /state {\n  proxy_pass http://ustreamer;\n}\nlocation /stream {\n  proxy_pass http://ustreamer;\n}\nlocation / {\n  proxy_pass http://tinypilot;\n}\nlocation ~* ^/.+\\.(html|js|js.map|css)$ {\n  root "/opt/tinypilot/app/static";\n\n  # Disable caching\n  add_header Last-Modified $date_gmt;\n  add_header Cache-Control \'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0\';\n  if_modified_since off;\n  expires off;\n  etag off;\n}\nlocation ~* ^/.+\\.(jpg|jpeg|png|ico)$ {\n  root "/opt/tinypilot/app/static";\n}\n'})

TASK [geerlingguy.nginx : Remove managed vhost config files.] ******************
skipping: [localhost] => (item={'listen': '80 default_server', 'server_name': 'tinypilot', 'root': '/opt/tinypilot', 'index': 'index.html', 'extra_parameters': 'proxy_buffers 16 16k;\nproxy_buffer_size 16k;\nproxy_set_header Host $host;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_http_version 1.1;\n\nlocation /socket.io {\n  proxy_pass http://tinypilot;\n  proxy_set_header Upgrade $http_upgrade;\n  proxy_set_header Connection "Upgrade";\n}\nlocation /state {\n  proxy_pass http://ustreamer;\n}\nlocation /stream {\n  proxy_pass http://ustreamer;\n}\nlocation / {\n  proxy_pass http://tinypilot;\n}\nlocation ~* ^/.+\\.(html|js|js.map|css)$ {\n  root "/opt/tinypilot/app/static";\n\n  # Disable caching\n  add_header Last-Modified $date_gmt;\n  add_header Cache-Control \'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0\';\n  if_modified_since off;\n  expires off;\n  etag off;\n}\nlocation ~* ^/.+\\.(jpg|jpeg|png|ico)$ {\n  root "/opt/tinypilot/app/static";\n}\n'})

TASK [geerlingguy.nginx : Remove legacy vhosts.conf file.] *********************
ok: [localhost]

TASK [geerlingguy.nginx : Copy nginx configuration in place.] ******************
ok: [localhost]

TASK [geerlingguy.nginx : Ensure nginx service is running as configured.] ******
ok: [localhost]

TASK [mtlynch.tinypilot : check for a boot config file] ************************
ok: [localhost]

TASK [mtlynch.tinypilot : enable dwc2 driver in boot config] *******************
skipping: [localhost]

TASK [mtlynch.tinypilot : enable dwc2 driver in modules] ***********************
ok: [localhost]

TASK [mtlynch.tinypilot : install usb-gadget initializer as a service] *********
ok: [localhost]

TASK [mtlynch.tinypilot : enable systemd usb-gadget initializer service file] ***
ok: [localhost]

TASK [mtlynch.tinypilot : install TinyPilot pre-requisite packages] ************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "No package matching 'python-pip' is available"}

PLAY RECAP *********************************************************************
localhost                  : ok=30   changed=0    unreachable=0    failed=1    skipped=12   rescued=0    ignored=0

Please paste the URL you see when you run /opt/tinypilot/dev-scripts/dump-logs

root@arm-cluster-01:/# cat /opt/tinypilot/dev-scripts/dump-logs cat: /opt/tinypilot/dev-scripts/dump-logs: No such file or directory

SmugZombie commented 4 years ago

While I now see my issue is likely that I am running Ubuntu and not Raspbian.. I am guessing this is a relatively easy fix (if only I knew ansible)

mtlynch commented 4 years ago

I messed around with it a little bit and got it past the python-pip failure:

https://github.com/mtlynch/ansible-role-tinypilot/pull/56

The problem is that I don't know how to get the ConfigFS HID gadget to load on Ubuntu. So everything installs, but TinyPilot still can't send keyboard or mouse input to the target computer. I tried adding dtoverlay=dwc2 to /boot/firmware/usercfg.txt, but that sent it into a boot loop (on Raspberry Pi OS the role automatically adds this line to /boot/config.txt).

I've tried on a few different SBC OSes, and Raspbian is the only one where I've been successful.

mtlynch commented 3 years ago

This is now working as of this change:

https://github.com/mtlynch/ansible-role-tinypilot/pull/77