HPLIP inside a distrobox (HP printer, printing works but scanning doesn't)

Printer model: HP LaserJet Pro MFP M127fs Without the hplip drivers I can print but cannot scan, so I am trying to get scanning to work. Overlaying hplip with rpm-ostree does not work since the hplip gui wants to do the installation of drivers itself, which due to bazzite being an atomic distro is not an allowed operation, therefore hplip must go inside a container. I have created a debian:stable container and installed the hplip-gui package in it. Here is what happens when I try to run hp-toolbox (printer is connected over usb): https://pastebin.com/f9wbHFY0 (pastebin due to being too long). The key error seems to be error: Unable to connect to dbus system bus. Exiting. but googling reveals nothing and I cannot understand why this error is happening or what it means. Anyone have any idea what to do after this?
Pastebin
```bashumnikos@bazzite:~$ distrobox stop hplipDo you really want to...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Solution:
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/host/var/run/dbus/system_bus_socket hp-toolbox
Jump to solution
53 Replies
HikariKnight
HikariKnight•4mo ago
hplip is part of bazzite though?
umnikos
umnikosOP•4mo ago
what?
umnikos@bazzite:~$ hp-toolbox
bash: hp-toolbox: command not found
umnikos@bazzite:~$ hp-toolbox
bash: hp-toolbox: command not found
it definitely isn't. ...oh wait that particular command isn't, but I seem to have other hp commands...
HikariKnight
HikariKnight•4mo ago
yeah have you tried to just add the printer through the kde/gnome gui?
umnikos
umnikosOP•4mo ago
it is listed there and I can print but I can't scan the gnome scanner tool detects my printer but then when I hit the scan button immediately errors saying it can't connect to the scanner with no further elaboration on why lemme get a screenshot real quick...
umnikos
umnikosOP•4mo ago
here
No description
No description
umnikos
umnikosOP•4mo ago
umnikos@bazzite:~$ hp-scan

HP Linux Imaging and Printing System (ver. 3.24.4)
Scan Utility ver. 2.2

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.


-----------------
| SELECT DEVICE |
-----------------

Num Scan device URI
-------- -------------------------------------------------------
0* v4l:/dev/video1
1 hpaio:/usb/HP_LaserJet_Pro_MFP_M127fs?serial=CNB8HCV8XS

Enter number 0...1 for device (q=quit, <enter>=default: 0*) ?1
warning: No destinations specified. Adding 'file' destination by default.
Using device hpaio:/usb/HP_LaserJet_Pro_MFP_M127fs?serial=CNB8HCV8XS
Opening connection to device...
error: SANE: Error during device I/O (code=9)
umnikos@bazzite:~$
umnikos@bazzite:~$ hp-scan

HP Linux Imaging and Printing System (ver. 3.24.4)
Scan Utility ver. 2.2

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.


-----------------
| SELECT DEVICE |
-----------------

Num Scan device URI
-------- -------------------------------------------------------
0* v4l:/dev/video1
1 hpaio:/usb/HP_LaserJet_Pro_MFP_M127fs?serial=CNB8HCV8XS

Enter number 0...1 for device (q=quit, <enter>=default: 0*) ?1
warning: No destinations specified. Adding 'file' destination by default.
Using device hpaio:/usb/HP_LaserJet_Pro_MFP_M127fs?serial=CNB8HCV8XS
Opening connection to device...
error: SANE: Error during device I/O (code=9)
umnikos@bazzite:~$
hm. @HikariKnight any further wisdom?
HikariKnight
HikariKnight•4mo ago
i hate printers, especially multifunction ones from hp 😂 i am digging around a bit though
umnikos
umnikosOP•4mo ago
I tried hp-plugin to update stuff but it just says "installation failed" after being given admin password which is basically as far as I got when trying to overlay hplip-gui anyway I've used this same printer on a debian machine before with no problems with hplip
HikariKnight
HikariKnight•4mo ago
all im finding so far by searching is that people dislike hplip
umnikos
umnikosOP•4mo ago
I do not like it either
HikariKnight
HikariKnight•4mo ago
just for sanity checking you have tried a different port right? i have like 0 experience with hp printers on linux (might have something to do that i have avoided them like the plague or the fact i print maybe 1 page per year...)
umnikos
umnikosOP•4mo ago
did just now same thing it's a laser printer, and it accepts bootleg cartridges doesn't even connect to wifi
HikariKnight
HikariKnight•4mo ago
ah
umnikos
umnikosOP•4mo ago
as far as printers go this is a good one
HikariKnight
HikariKnight•4mo ago
only thing i got was that it needs to download the hp plugin for scanner support whats the error when you try download that?
umnikos
umnikosOP•4mo ago
Do you accept the license terms for the plug-in (y=yes*, n=no, q=quit) ? y
Please enter the root/superuser password:
error: Password incorrect. 2 attempt(s) left.
Please enter the root/superuser password:
Plugin installation failed
error: Plugin installation failed

Done.

Done.
Do you accept the license terms for the plug-in (y=yes*, n=no, q=quit) ? y
Please enter the root/superuser password:
error: Password incorrect. 2 attempt(s) left.
Please enter the root/superuser password:
Plugin installation failed
error: Plugin installation failed

Done.

Done.
HikariKnight
HikariKnight•4mo ago
probably doesnt like that it is on atomic
umnikos
umnikosOP•4mo ago
yep. therefore distrobox except it doesn't like that either
HikariKnight
HikariKnight•4mo ago
yeah and there you get the plugin but you dont get access to the printer
umnikos
umnikosOP•4mo ago
.......is the hplip running on the host interfering with the hplip running in the box
HikariKnight
HikariKnight•4mo ago
not a service that runs
umnikos
umnikosOP•4mo ago
well there's cups that runs and probably other things? but without cups on the host routing print requests into the distrobox might be impossible
HikariKnight
HikariKnight•4mo ago
only thing i can think of is download the scanning plugin in distrobox (fedora 40) and try fish it out and put it in the appropriate /usr/local folders and then cross your fingers and pray that or fishing out the files and package them as an rpm you keep for yourself that you then install with rpm-ostree wish i had an easier answer
umnikos
umnikosOP•4mo ago
I'll wait for others to answer
HikariKnight
HikariKnight•4mo ago
could also get fedora workstation on a live usb and just confirm that is whats missing by trying to add it in the live environment and download the plugin 🤔
umnikos
umnikosOP•4mo ago
if hplip comes preinstalled on bazzite I'd reckon it not working is actually a bug and not just a question, maybe?
HikariKnight
HikariKnight•4mo ago
that too but most likely we cant redistribute those proprietary plugin files by running the hp-plugin-download and answering the prompts in CI @Kyle Gospo
Kyle Gospo
Kyle Gospo•4mo ago
try a rootful distrobox
HikariKnight
HikariKnight•4mo ago
i keep forgetting those exist
umnikos
umnikosOP•4mo ago
now I have to figure out how to do that without being in the sudoers file...
Kyle Gospo
Kyle Gospo•4mo ago
You make the distrobox as a rootful box You can't make an existing box rootful
HikariKnight
HikariKnight•4mo ago
distrobox create --root blah box buddy might also have the button when making a new distrobox
umnikos
umnikosOP•4mo ago
but distrobox enter has a --root flag :thonk:
Kyle Gospo
Kyle Gospo•4mo ago
For entering a rootful box
umnikos
umnikosOP•4mo ago
I see. ah it just creates the box under the root user so I could've just done su and then distrobox there. wait, question, what will the rootful box actually do that's different from a regular box
Kyle Gospo
Kyle Gospo•4mo ago
Potentially fix your dbus issue If that doesn't work your only option would be to make a custom image
HikariKnight
HikariKnight•4mo ago
never run distrobox with sudo use the root flag
umnikos
umnikosOP•4mo ago
...okay I think what might actually work is make an init box
HikariKnight
HikariKnight•4mo ago
full access to everything on your host
umnikos
umnikosOP•4mo ago
argh I don't want to make more containers if I don't even know by what mechanism it might help what even does the error mean
HikariKnight
HikariKnight•4mo ago
the error means it cant communicate with the scanner I/O error
umnikos
umnikosOP•4mo ago
yes but more specifically it means the dbus doesn't even exist the folder /run/dbus does not exist in the box hoooly shit
Solution
umnikos
umnikos•4mo ago
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/host/var/run/dbus/system_bus_socket hp-toolbox
umnikos
umnikosOP•4mo ago
No description
Kyle Gospo
Kyle Gospo•4mo ago
Nice
HikariKnight
HikariKnight•4mo ago
so rootfull worked?
umnikos
umnikosOP•4mo ago
nope this is a rootless box it's not an init box either
HikariKnight
HikariKnight•4mo ago
so just needed env var
umnikos
umnikosOP•4mo ago
yep well, let's see if it can scan immediately prompts for a driver install...
HikariKnight
HikariKnight•4mo ago
probably the plugins
umnikos
umnikosOP•4mo ago
yep plugin install failed... but it prompted me for root password for no reason so I'll just try sudo hp-plugin success it can scan! but weirdly it can't from the hp-toolbox gui it scanned from the hp-scan command and now for the ultimate test can I somehow hook up the gnome scan utility to the distrobox
HikariKnight
HikariKnight•4mo ago
install it in distrobox and run it there i think
umnikos
umnikosOP•4mo ago
should be easiest, yeah yep, it works everything is super.
Want results from more Discord servers?
Add your server