Octoprint on crouton on Chromebook

I'm trying to run octoprint in a debian install of crouton on a chromebook. It seems because it is running as a chroot there is no systemd and I cant start the server. For example if I try restarting octoprint I get

sudo service octoprint restart
octoprint: unrecognized service

and

sudo systemctl restart octoprint
Running in chroot, ignoring command 'restart'

So the question is how do I use Octoprint in a chroot environment?

When I try to start octoprint with
octoprint serve *get the following

(bullseye)jim@localhost:~/OctoPrint/bin$ ./octoprint serve
2022-10-31 20:34:52,890 - octoprint.startup - INFO - ******************************************************************************
2022-10-31 20:34:52,895 - octoprint.startup - INFO - Starting OctoPrint 1.8.6
2022-10-31 20:34:52,897 - octoprint.startup - INFO - ******************************************************************************
2022-10-31 20:34:53,351 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from offline to online
2022-10-31 20:34:53,522 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: online
2022-10-31 20:34:53,523 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 1.1.1.1:53 is working
2022-10-31 20:34:53,524 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working
2022-10-31 20:34:53,552 - octoprint.startup - INFO - Blacklist processing done, adding 3 blacklisted plugin versions: roomtemp (any), GcodeEditor (>=0.1.1,<=0.2.8), gcodeleveling (>=0.1.0,<=0.1.1)
2022-10-31 20:34:53,566 - octoprint.plugin.core - INFO - Loading plugins from /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins, /home/jim/.octoprint/plugins and installed plugin packages...
2022-10-31 20:34:56,135 - octoprint.plugin.core - INFO - Plugin Pi Support Plugin (2022.6.13) did not pass check, not loading.
2022-10-31 20:34:56,376 - octoprint.plugin.core - INFO - Found 24 plugin(s) providing 24 mixin implementations, 57 hook handlers
2022-10-31 20:34:56,409 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2022-10-31 20:34:56,533 - octoprint.server - INFO - Intermediary server started
2022-10-31 20:34:56,542 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/jim/.octoprint/uploads...
2022-10-31 20:34:56,544 - octoprint.filemanager.storage - INFO - ... file metadata for /home/jim/.octoprint/uploads initialized successfully.
2022-10-31 20:34:56,551 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW (needs: "Need(method='role', value='plugin_action_command_notification_show')")
2022-10-31 20:34:56,551 - octoprint.server - INFO - Added new permission from plugin action_command_notification: PLUGIN_ACTION_COMMAND_NOTIFICATION_CLEAR (needs: "Need(method='role', value='plugin_action_command_notification_clear')")
2022-10-31 20:34:56,552 - octoprint.server - INFO - Added new permission from plugin action_command_prompt: PLUGIN_ACTION_COMMAND_PROMPT_INTERACT (needs: "Need(method='role', value='plugin_action_command_prompt_interact')")
2022-10-31 20:34:56,552 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_READ (needs: "Need(method='role', value='plugin_announcements_read')")
2022-10-31 20:34:56,553 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_MANAGE (needs: "Need(method='role', value='plugin_announcements_manage'), Need(method='role', value='plugin_announcements_read')")
2022-10-31 20:34:56,554 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_ADMIN (needs: "Need(method='role', value='plugin_appkeys_admin')")
2022-10-31 20:34:56,554 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_GRANT (needs: "Need(method='role', value='plugin_appkeys_user')")
2022-10-31 20:34:56,555 - octoprint.server - INFO - Added new permission from plugin backup: PLUGIN_BACKUP_ACCESS (needs: "Need(method='role', value='plugin_backup_access')")
2022-10-31 20:34:56,555 - octoprint.server - INFO - Added new permission from plugin firmware_check: PLUGIN_FIRMWARE_CHECK_DISPLAY (needs: "Need(method='role', value='plugin_firmware_check_display')")
2022-10-31 20:34:56,556 - octoprint.server - INFO - Added new permission from plugin logging: PLUGIN_LOGGING_MANAGE (needs: "Need(method='role', value='plugin_logging_manage')")
2022-10-31 20:34:56,565 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_LIST (needs: "Need(method='role', value='plugin_pluginmanager_list')")
2022-10-31 20:34:56,566 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_MANAGE (needs: "Need(method='role', value='plugin_pluginmanager_manage')")
2022-10-31 20:34:56,567 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_INSTALL (needs: "Need(method='role', value='plugin_pluginmanager_install'), Need(method='role', value='plugin_pluginmanager_manage')")
2022-10-31 20:34:56,570 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CHECK (needs: "Need(method='role', value='plugin_softwareupdate_check')")
2022-10-31 20:34:56,570 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_UPDATE (needs: "Need(method='role', value='plugin_softwareupdate_update')")
2022-10-31 20:34:56,570 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CONFIGURE (needs: "Need(method='role', value='plugin_softwareupdate_configure')")
2022-10-31 20:34:56,582 - octoprint.printer.standard - INFO - Using print time estimator provided by PrintTimeGenius
2022-10-31 20:34:57,825 - octoprint.util.pip - INFO - Using "/home/jim/OctoPrint/bin/python3 -m pip" as command to invoke pip
2022-10-31 20:34:58,841 - octoprint.util.pip - INFO - Version of pip is 22.3
2022-10-31 20:34:58,849 - octoprint.util.pip - INFO - pip installs to /home/jim/OctoPrint/lib/python3.9/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2022-10-31 20:34:58,849 - octoprint.util.pip - INFO - ==> pip ok -> yes
2022-10-31 20:34:58,898 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2022-10-31 20:34:58,977 - octoprint.plugins.firmwareupdater - INFO - Python binproto2 package installed: False
2022-10-31 20:34:58,988 - octoprint.plugins.cancelobject - INFO - No beforegcode defined
2022-10-31 20:34:58,989 - octoprint.plugins.cancelobject - INFO - No aftergcode defined
2022-10-31 20:34:58,999 - octoprint.plugin.core - INFO - Initialized 24 plugin implementation(s)
2022-10-31 20:34:59,254 - octoprint.plugin.core - INFO - 24 plugin(s) registered with the system:
|  Action Command Notification Support (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/action_command_notification
|  Action Command Prompt Support (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/action_command_prompt
|  Active Filters Extended (0.1.0) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_active_filters_extended
|  Announcement Plugin (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/announcements
|  Anonymous Usage Tracking (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/tracking
|  Application Keys Plugin (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/appkeys
|  Backup & Restore (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/backup
|  Bed Visualizer (1.1.1) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_bedlevelvisualizer
|  Cancel Objects (0.4.7) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_cancelobject
|  Core Wizard (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/corewizard
|  Discovery (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/discovery
|  Error Tracking (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/errortracking
|  Event Manager (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/eventmanager
|  File Check (2021.2.23) (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_file_check
|  Firmware Check (2021.10.11) (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_firmware_check
|  Firmware Updater (1.13.3) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_firmwareupdater
|  GCode Viewer (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/gcodeviewer
|  Logging (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/logging
|  Plugin Manager (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/pluginmanager
|  PrintTimeGenius Plugin (2.3.0) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_PrintTimeGenius
|  Software Update (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate
|  Terminal Commands Extended (0.1.7) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_terminalcommandsextended
|  UI Customizer (0.1.9.0) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint_uicustomizer
|  Virtual Printer (bundled) = /home/jim/OctoPrint/lib/python3.9/site-packages/octoprint/plugins/virtual_printer
Prefix legend: ! = disabled, # = blacklisted, * = incompatible
2022-10-31 20:34:59,277 - octoprint.environment - INFO - Detected environment is Python 3.9.2 under Linux (linux). Details:
|  hardware:
|    cores: 2
|    freq: 2480.0
|    ram: 2029404160
|  os:
|    bits: 64
|    id: linux
|    platform: linux
|  python:
|    pip: '22.3'
|    version: 3.9.2
|    virtualenv: /home/jim/OctoPrint
2022-10-31 20:34:59,306 - octoprint.server - INFO - Reset webasset folder /home/jim/.octoprint/generated/webassets...
2022-10-31 20:34:59,307 - octoprint.server - INFO - Reset webasset folder /home/jim/.octoprint/generated/.webassets-cache...
2022-10-31 20:34:59,308 - octoprint.server - INFO - Reset webasset folder /home/jim/.octoprint/generated/.webassets-manifest.json...
2022-10-31 20:34:59,421 - octoprint.plugins.PrintTimeGenius - WARNING - The Blueprint of this plugin is relying on the default implementation of is_blueprint_csrf_protected (newly added in OctoPrint 1.8.3), which in a future version will be switched from False to True for security reasons. Plugin authors should ensure they explicitly declare the CSRF protection status in their BlueprintPlugin mixin implementation. Recommendation is to enable CSRF protection and exempt views that must not use it with the octoprint.plugin.BlueprintPlugin.csrf_exempt decorator.
2022-10-31 20:34:59,421 - octoprint.server - WARNING - CSRF Protection for Blueprint of plugin PrintTimeGenius is DISABLED
2022-10-31 20:34:59,424 - octoprint.plugins.bedlevelvisualizer - WARNING - The Blueprint of this plugin is relying on the default implementation of is_blueprint_csrf_protected (newly added in OctoPrint 1.8.3), which in a future version will be switched from False to True for security reasons. Plugin authors should ensure they explicitly declare the CSRF protection status in their BlueprintPlugin mixin implementation. Recommendation is to enable CSRF protection and exempt views that must not use it with the octoprint.plugin.BlueprintPlugin.csrf_exempt decorator.
2022-10-31 20:34:59,425 - octoprint.server - WARNING - CSRF Protection for Blueprint of plugin bedlevelvisualizer is DISABLED
2022-10-31 20:34:59,428 - octoprint.plugins.firmwareupdater - WARNING - The Blueprint of this plugin is relying on the default implementation of is_blueprint_csrf_protected (newly added in OctoPrint 1.8.3), which in a future version will be switched from False to True for security reasons. Plugin authors should ensure they explicitly declare the CSRF protection status in their BlueprintPlugin mixin implementation. Recommendation is to enable CSRF protection and exempt views that must not use it with the octoprint.plugin.BlueprintPlugin.csrf_exempt decorator.
2022-10-31 20:34:59,428 - octoprint.server - WARNING - CSRF Protection for Blueprint of plugin firmwareupdater is DISABLED
2022-10-31 20:34:59,431 - octoprint.plugins.uicustomizer - WARNING - The Blueprint of this plugin is relying on the default implementation of is_blueprint_csrf_protected (newly added in OctoPrint 1.8.3), which in a future version will be switched from False to True for security reasons. Plugin authors should ensure they explicitly declare the CSRF protection status in their BlueprintPlugin mixin implementation. Recommendation is to enable CSRF protection and exempt views that must not use it with the octoprint.plugin.BlueprintPlugin.csrf_exempt decorator.
2022-10-31 20:34:59,431 - octoprint.server - WARNING - CSRF Protection for Blueprint of plugin uicustomizer is DISABLED
2022-10-31 20:34:59,910 - octoprint.plugins.firmwareupdater - INFO - Setting maximum upload size for /flash to 5243904
2022-10-31 20:34:59,910 - octoprint.server - INFO - Shutting down intermediary server...
2022-10-31 20:35:00,117 - octoprint.server - INFO - Intermediary server shut down
2022-10-31 20:35:00,125 - octoprint.events - INFO - Processing startup event, this is our first event
2022-10-31 20:35:00,126 - octoprint.events - INFO - Adding 1 events to queue that were held back before startup event
2022-10-31 20:35:00,132 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2022-10-31 20:35:00,147 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2022-10-31 20:35:00,171 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder...
2022-10-31 20:35:00,173 - octoprint.plugins.softwareupdate - INFO - Fetching check overlays from https://plugins.octoprint.org/update_check_overlay.json
2022-10-31 20:35:00,186 - octoprint.server.util.watchdog - INFO - ... initial scan done.
2022-10-31 20:35:00,214 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2022-10-31 20:35:01,134 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on localhost._http._tcp.local.' for _http._tcp.local.
2022-10-31 20:35:01,320 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2022-10-31 20:35:01,990 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on localhost._octoprint._tcp.local.' for _octoprint._tcp.local.
2022-10-31 20:35:01,994 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on localhost for SSDP
2022-10-31 20:35:02,029 - octoprint.server - INFO - Listening on http://0.0.0.0:5000 and http://[::]:5000
2022-10-31 20:35:02,071 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2022-10-31 20:35:03,070 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2022-10-31 20:35:03,090 - octoprint.util.pip - INFO - Using "/home/jim/OctoPrint/bin/python3 -m pip" as command to invoke pip
2022-10-31 20:35:03,093 - octoprint.util.pip - INFO - pip installs to /home/jim/OctoPrint/lib/python3.9/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2022-10-31 20:35:03,093 - octoprint.util.pip - INFO - ==> pip ok -> yes
2022-10-31 20:35:03,105 - octoprint.plugins.softwareupdate - INFO - Minimum free storage across all update relevant locations is 961.9MB. That is considered sufficient for updating.
2022-10-31 20:35:03,322 - octoprint.plugins.bedlevelvisualizer - INFO - OctoPrint-BedLevelVisualizer loaded!
2022-10-31 20:35:03,322 - octoprint.plugins.uicustomizer - INFO - UI Customizer is initialized.
2022-10-31 20:35:03,914 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 7, 'printer_state': 'OFFLINE'}
2022-10-31 20:35:04,343 - octoprint.plugins.tracking - INFO - Sent tracking event pong, payload: {'version': '1.8.6', 'os': 'linux', 'bits': 64, 'python': '3.9.2', 'pip': '22.3', 'cores': 2, 'freq': 2480.0, 'ram': 2029404160, 'plugins': 'uicustomizer:0.1.9.0,terminalcommandsextended:0.1.7,printtimegenius:2.3.0,firmwareupdater:1.13.3,cancelobject:0.4.7,active_filters_extended:0.1.0,bedlevelvisualizer:1.1.1'}
2022-10-31 20:35:04,851 - octoprint.plugins.tracking - INFO - Sent tracking event startup, payload: {'version': '1.8.6', 'os': 'linux', 'bits': 64, 'python': '3.9.2', 'pip': '22.3', 'cores': 2, 'freq': 2480.0, 'ram': 2029404160}

Thanks

Seems like sysvinit is working so just create a service.

Download the init script files from OctoPrint's repository, move them to their respective folders and make the init script executable:

wget https://github.com/OctoPrint/OctoPrint/raw/master/scripts/octoprint.init && sudo mv octoprint.init /etc/init.d/octoprint
wget https://github.com/OctoPrint/OctoPrint/raw/master/scripts/octoprint.default && sudo mv octoprint.default /etc/default/octoprint
sudo chmod +x /etc/init.d/octoprint

Adjust the paths to your octoprint binary in /etc/default/octoprint.

Note also the removed # at the start of the line, uncommenting it and making it effective!

Then add the script to autostart using sudo update-rc.d octoprint defaults.

This will also allow you to start/stop/restart the OctoPrint daemon via

sudo service octoprint {start|stop|restart}

Thanks so much for this. It worked. I alslo had to change the OCTOPRINT_USER variable. I can now see Octoprint at http://localhost:5000 but I can't see it at 192.168.0.198:5000 from another linux machine on the network. Will I need to change something on my router? Thanks!

how does your config.yaml look like?
Iirc you have to use host: 0.0.0.0 instead of host: 127.0.0.1 if you don't use a proxy

or simply don't have the host field at all.

1 Like

config.yaml in ~/.octopringt has no host field. See the file below

api:
  key: 
plugins:
  announcements:
    _config_version: 1
    channels:
      _blog:
        read_until: 1664977500
      _important:
        read_until: 1521111600
      _octopi:
        read_until: 1659616200
      _plugins:
        read_until: 1664427600
      _releases:
        read_until: 1666085100
  bedlevelvisualizer:
    _config_version: 1
  discovery:
    upnpUuid: 
  errortracking:
    unique_id: 
  firmwareupdater:
    _config_version: 3
    _selected_profile: 0
    profiles:
    - _id: 0
      _name: Default
  gcodeviewer:
    _config_version: 1
  softwareupdate:
    _config_version: 9
  terminalcommandsextended:
    _config_version: 4
  tracking:
    enabled: true
    unique_id: 
  uicustomizer:
    mainTabs:
    - - control_link
      - true
      - false
      - fas fa-expand-arrows-alt
      - true
      - false
    - - temp_link
      - true
      - false
      - fas fa-thermometer-half
      - true
      - false
    - - timelapse_link
      - true
      - false
      - fas fa-film
      - true
      - false
    - - term_link
      - true
      - false
      - fas fa-terminal
      - true
      - false
    - - gcode_link
      - true
      - false
      - fab fa-codepen
      - true
      - false
    - - tab_plugin_bedlevelvisualizer_link
      - true
      - false
      - false
      - textOnly
      - '#000000'
    - - tab_plugin_cancelobject_link
      - true
      - false
      - false
      - textOnly
      - '#000000'
    rows:
    - _00#connection_wrapper: true
      _01#files_wrapper: true
      _02#sidebar_plugin_firmware_check_warning_wrapper: false
      _03#sidebar_plugin_firmware_check_info_wrapper: false
    - _00div.UICmainTabs: true
    - _00#UICGcodeVWidget: true
      _01#UICTempWidget: true
      _02#UICWebCamWidget: true
      _03#sidebar_plugin_action_command_notification_wrapper: true
      _04#state_wrapper: true
    themeVersion: 0.2.9.6
    topIconSort:
    - navbar_plugin_firmwareupdater
    - navbar_plugin_cancelobject
    - navbar_plugin_action_command_prompt
    - navbar_plugin_logging_seriallog
    - navbar_plugin_logging_plugintimingslog
    widths:
    - '3'
    - '6'
    - '3'
  virtual_printer:
    _config_version: 1
printerProfiles:
  default: _default
server:
  commands:
    serverRestartCommand: sudo systemctl restart octoprint
    systemRestartCommand: sudo reboot
    systemShutdownCommand: sudo shutdown now
  firstRun: false
  onlineCheck:
    enabled: true
  pluginBlacklist:
    enabled: true
  secretKey: 
  seenWizards:
    backup: 'null'
    corewizard: 4
system:
  actions:
  - action: Reset video streamer
    command: sudo systemctl restart cam_octoprint
    name: Restart webcam
temperature:
  profiles:
  - bed: 100
    chamber: null
    extruder: 210
    name: ABS
  - bed: 60
    chamber: null
    extruder: 180
    name: PLA
webcam:
  snapshot: http://localhost.local:8001?action=snapshot
  stream: http://localhost.local:8001?action=stream

Sorry I'm out of ideas here. Could be a ChromeOS firewall or some kind of sandbox issue :person_shrugging:
Isn't there an option to install debian or another linux distro instead of ChromeOS?

Thanks very much for your help to date. And yes what I have been discussing with you is already a linux distro , not ChromOS. It is the most recent Debian distron in Crouton. Meanwhile I've loaded OctoPi onto a PI and that works very well. I'll give up on Octoprint on the Chromebook for now.

1 Like