Setup a WLAN / LAN Printer IPP Everywhere™

:seedling: This how-to guide provides the very fundamental configuration to get a (Brother) IPP network printer working in Qubes OS.

What is IPP Everywhere™ (driverless printing) and why should I pick a IPP printer?
What printer supports IPP?

For the ease of use and to avoid typing errors, I do not put all command in dom0 to benefit from copy & paste some code lines directly to the templateVM and appVM. To keep things minimal and avoid messing up your default templates, we are going to use a Debian minimal template as a baseline (the ‘deb-12-m-printer’ will be a clone of it).

There are additional printer features to discover (i.e. IPPS encrypted printing) and more Qubes OS configuration you can do (i.e. disposable printer qube). Feel free to extend this guide with additional configuration options. :handshake:

This guide has been made with following software and hardware:

Software:
:white_check_mark: Qubes OS 4.2.2
:white_check_mark: Debian 12 (debian-12-minimal)
:white_check_mark: cups 2.4.2

Hardware:
:white_check_mark: Brother-HL-L2375DW with ‘Generic IPP Everywhere Printer [en] recommended’ printer driver (available in cups package)
:white_check_mark:

With a very high probability, it should also work with newer versions and other IPP-compliant hardware. Feel free to add additional printers and update new software versions if you have successfully configured your printer based on this guide.

1. Set printer IP

Login to your router admin console and set a fix IP address for your printer. (i.e. 192.168.178.1) Restart your printer and verify that the IP is properly set and it is accessible within your local network (send pings, open the browser web-interface etc.).

2. Create printer qubes

Open a dom0 terminal (and keep it open):

dxy=$(qvm-template list --available | grep -Eo "debian.*minimal" | tail -n 1 | grep -Eo "[0-9]+")
src="debian-${dxy}-minimal"
tpl="deb-${dxy}-m-printer"
app="printer"
qvm-template install ${src}
qvm-clone ${src} ${tpl}
qvm-create ${app} --template ${tpl} --label red

3. Install printer software packages

open the deb- * -m-printer (template) terminal from the dom0 terminal:

qvm-run --pass-io --user root ${tpl} xterm

afterwards, in the deb- * -m-printer terminal:

You can copy & paste these code lines into the xterm terminal by:
  1. copy the line (select, ctrl+c)
  2. copy to Qubes OS clipboard (shift+ctrl+c)
  3. paste from Qubes OS clipboard to xterm (shift+ctrl+v)
  4. paste from xterm clipboard (middle mouse click)
apt update && apt upgrade --yes
apt install --no-install-recommends qubes-core-agent-passwordless-root qubes-core-agent-networking qubes-core-agent-nautilus qubes-pdf-converter qubes-img-converter qubes-app-shutdown-idle cups system-config-printer nautilus evince eog xfce4-notifyd dunst pdftk --yes
exit

back to dom0 terminal:

qvm-shutdown ${tpl}
qvm-service ${app} cups on
If you are using a VPN

You must ensure that you have access to your local (printer) network either by routing your ‘printer’ qube to a separate (local) network qube or by a VPN split tunnel configuration.

qvm-prefs ${app} netvm <sys-firewall-local-network>

4. Make cups file persistent (bind-dirs)

open the printer (appVM) terminal from the dom0 terminal:

qvm-run --pass-io --user user ${app} xterm

afterwards, in the printer terminal:

You can copy & paste these code lines into the xterm terminal by:
  1. copy the line (select, ctrl+c)
  2. copy to Qubes OS clipboard (shift+ctrl+c)
  3. paste from Qubes OS clipboard to xterm (shift+ctrl+v)
  4. paste from xterm clipboard (middle mouse click)
sudo mkdir --parents /rw/config/qubes-bind-dirs.d
sudo mkdir --parents /rw/bind-dirs/etc/cups/
sudo cp --recursive /etc/cups/* /rw/bind-dirs/etc/cups/
echo binds+=\( \'/etc/cups/\' \) | sudo tee /rw/config/qubes-bind-dirs.d/50_user.conf
exit

back to dom0 terminal:

qvm-shutdown ${app}

5. Add and configure printer

open the printer (appVM) terminal from the dom0 terminal:

qvm-run --pass-io --user user ${app} xterm

afterwards, in the printer terminal:

printer_name="Brother-HL-L2375DW" # modify to your configuration!
printer_IP="192.168.178.1" # modify to your configuration!
Verify printer connection
ping -c 1 -q ${printer_IP}

    pinging was successfully

--- 192.168.178.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms

    ping test failed :man_facepalming:

--- 192.168.178.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Please double check that your printer is switched on, printer has a fix IP address and the printer appVM qube has the proper netvm defined (to access your local network; see qube Settings).


sudo usermod -aG lpadmin user
sudo systemctl restart cups.service
Verify cups is running
systemctl status cups

All status should show active (running), enabled etc.

If an error or failure is displayed check the printer appVM qube Settings: Tab ‘Services’. Cups should be listed and checked.


sudo lpadmin -p ${printer_name} -E -v ipp://${printer_IP}/ipp/print -m everywhere

back to dom0 terminal:

qvm-shutdown ${app}

Finally, go to the ‘printer’ qube ‘Settings’, to the ‘Applications’ tab and add:

  • Document Viewer
  • Files
  • Image Viewer
  • Printer Settings

Back to the Q-menu: printer qube and launch Printer Settings
You should see your printer (icon and printer name), right-click on it, make your final configurations (page size / format, dpi …) and run a test page.

Happy IPP printing :partying_face:


6. Printer, Qubes OS, IPP options

'Printer harding'

Limit the printer appVM to access the printer device only.

app="printer"
printer_IP="192.168.178.1" # modify to your configuration!
qvm-firewall ${app} del accept
qvm-firewall ${app} add accept dsthost=${printer_IP}
qvm-firewall ${app} add accept specialtarget=dns 
qvm-firewall ${app} add accept proto=icmp
qvm-firewall ${app} add drop

Verify that printing works as before.
Perform i.e. a ping test to verify the new printer firewall configuration.

5 Likes

Hi, everything went fine sofar with the installation…

Ok, after a complete reboot of Qubes everything works fine - except I do not have access to the installed printer from my Office Qube resp. Liberoffice.

I started bot the printer template and the printer app.
What am I missing ??

regards, hitam

Please verify that you have not accidentally used ‘root’ instead of ‘user’ or forget to use ‘sudo’.

Try to redo all and see if you will face the some issue.

test

I know these issues it took me two weeks to understand the dependencies and make a robust setup procedure. That was the reason why I decided to make this step by step guide.

I verified the procedure 3 times and it worked for me.

Beside the ‘root’, ‘user’, ‘sudo’ pitfalls it is important to follow strictly to the order of creation, keep it running and shutdown templateVM and appVM. If not you will end with all these issues you listed.

HI,
thank you very much for your feedback and creating this step-by-step guide. However I do not have time and do not want to spent “two weeks time” to figure out, what went wrong.

Sofar the installed printer(s) are available in ther “printer” app and I do not have to install them anymore, everytime i start the “printer” app.

What ist still missing is the access from e.g. my Office Qube e.g. from Libroffice writer and e.g. from Firefox. Other Qubes still have no access to the printers installed.

I set the “printer” app to be started at every boot in its settings, the same happens with the “printer” template.

regards, hitam

Thanks for the guide, will try to replace my current standalone with it.

1 Like

This is excatly what this guide should do.

This is not part of this guide. You have to move or copy the file you want to print to the printer appVM (using Qubes OS copy file to VM feature; available in the Nautilus file browser).

You can find a (a more complex solution) here:

Ditched my old template/appVM-combo and used your solution, since it’s “better” (AKA “driver free” → no hplip). Works like a charm. Thank you!

1 Like

Well since I use HP printer only since decades, hplip is the swiss army knife for all HP printers.

regards, Hitam