{"id":241,"date":"2025-02-19T13:33:49","date_gmt":"2025-02-19T11:33:49","guid":{"rendered":"https:\/\/blog.douwedevri.es\/?p=241"},"modified":"2025-02-19T17:49:52","modified_gmt":"2025-02-19T15:49:52","slug":"octoprint-on-proxmox","status":"publish","type":"post","link":"https:\/\/blog.dbdv.nl\/?p=241","title":{"rendered":"OctoPrint on Proxmox"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Create VM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new Ubuntu VM in Proxmox and write down the ID.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">USB Passthough<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Connect the print to the server and find the device ID in Proxmox.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">lsusb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example the following output has 1a86:7523 as the ID.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Bus 002 Device 005: ID 1a86:7523 QinHeng Electronics CH340 serial converter<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Assign the ID to the VM you just created.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">qm set 101 -usb0 host=1a86:7523<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install OctoPrint<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"201\" src=\"https:\/\/blog.douwedevri.es\/wp-content\/uploads\/2025\/02\/logo.png\" alt=\"\" class=\"wp-image-248\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Update the VM and install the dependencies.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">sudo apt update\nsudo apt install python3 python3-pip python3-dev python3-setuptools python3-venv git libyaml-dev build-essential libffi-dev libssl-dev<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a python virtual environment in a new folder.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">mkdir octoprint &amp;&amp; cd octoprint\npython3 -m venv venv\nsource venv\/bin\/activate<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the virtual environment active, upgrade and install the following packages.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">pip install --upgrade pip wheel\npip install octoprint<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, add your user to the <code>tty <\/code>and <code>dialout<\/code> groups.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">sudo usermod -a -G tty pi\nsudo usermod -a -G dialout pi<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, it might be necessary to logout for the changes to take effect. After that, go back into the virtual environment and start OctoPrint.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">octoprint serve<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Start after reboot<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new file <code>\/etc\/systemd\/system\/octoprint.service<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\" line-numbers\">[Unit]\nDescription=The snappy web interface for your 3D printer\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nEnvironment=\"LC_ALL=C.UTF-8\"\nEnvironment=\"LANG=C.UTF-8\"\nType=exec\nUser=user\nExecStart=\/home\/user\/octoprint\/venv\/bin\/octoprint serve\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, enable the service using systemctl.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">sudo systemctl enable octoprint.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: You may need to reload the daemon after changes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">sudo systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create VM Create a new Ubuntu VM in Proxmox and write down the ID. USB Passthough Connect the print to the server and find the device ID in Proxmox. For example the following output has 1a86:7523 as the ID. Assign the ID to the VM you just created. Install OctoPrint Update the VM and install [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":253,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[23,24],"class_list":["post-241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-octoprint","tag-proxmox"],"_links":{"self":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=241"}],"version-history":[{"count":19,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":290,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions\/290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=\/wp\/v2\/media\/253"}],"wp:attachment":[{"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dbdv.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}