Exercise: Create a Persistent Virtual IPP Printer

Using a systemd User Service

A hands-on exercise to create a persistent, driverless virtual printer that runs automatically as a background service.
Author

Chuck Nelson

Published

November 17, 2025

1 Purpose

To properly simulate a modern network printer, we need a virtual device that is always running in the background. In this exercise, you will create a persistent, driverless IPP printer by setting it up as a systemd user service. This is a real-world administration task that ensures your virtual printer starts automatically when you log in, without needing a dedicated terminal window. This robust setup will serve as the foundation for all subsequent exercises.

2 What You’ll Accomplish

By the end of this exercise, you will be able to:

  • Install the cups-printerapp package containing the ippeveprinter tool.
  • Create a dedicated output directory for printed files.
  • Write and configure a systemd --user service file.
  • Enable and start a persistent user service that runs on login.
  • Verify that the virtual printer service is running correctly.

This exercise maps to the following program and course learning outcomes:

  • Course Learning Outcomes (CLOs):
    • 1. Identify hardware and basic network components: This exercise simulates a modern network peripheral (IPP Printer) and uses system software to ensure its persistence.
    • 3. Troubleshoot hardware and basic network components: Managing and checking the status of system services is a fundamental troubleshooting skill for any network-attached device.

This exercise develops the following skills, which align with the O*NET SOC Code 15-1232.00 for Computer User Support Specialists.

Learning Objective O*NET KSAs Technologies Used
Create and manage a systemd user service. Knowledge: Computers & Electronics, Operating Systems
Skills: Installation, Systems Analysis
systemd, ippeveprinter, dnf

3 Prerequisites

This exercise requires a running Fedora 43 virtual machine with sudo privileges and an internet connection.

4 Step-by-Step Guide

4.1 Step 1: Install the Prerequisite Package

The ippeveprinter utility is part of the cups-printerapp package, which is not installed by default.

  1. Open a terminal window.

  2. Run the following command to install the package:

    sudo dnf install -y cups-printerapp

4.2 Step 2: Create the Output Directory

This is the folder where your virtual printer will save its “printed” PDF files. Creating it in your home directory makes it easy to access.

In your terminal, run the following command:

mkdir -p ~/PrinterOutput

4.3 Step 3: Create the systemd User Service File

You will now define the service. systemd user services are stored in ~/.config/systemd/user/.

  1. First, ensure the directory exists:

    mkdir -p ~/.config/systemd/user
  2. Next, create a new service file named ipp-virtual-printer.service using a text editor like nano.

    nano ~/.config/systemd/user/ipp-virtual-printer.service
  3. Copy and paste the entire block of text below into the nano editor.

    [Unit]
    Description=IPP Everywhere Virtual Printer (Test-IPP-Printer)
    After=network.target
    
    [Service]
    ExecStart=/usr/bin/ippeveprinter --port 8631 --directory %h/PrinterOutput --format application/pdf --keep-files "Test-IPP-Printer"
    Restart=always
    
    [Install]
    WantedBy=default.target
  4. Save the file and exit the editor (in nano, press Ctrl+X, then Y, then Enter).

4.4 Step 4: Understanding the Service File

Let’s break down the key commands in the service file you just created.

  • [Unit] Section:
    • Description: A human-readable name for the service.
    • After=network.target: Ensures the service only starts after the network is up.
  • [Service] Section:
    • ExecStart: The exact command the service will run.
      • --port 8631: Sets a fixed, predictable port for the printer.
      • --directory %h/PrinterOutput: Sets the output directory. %h is a systemd variable that automatically points to your home directory.
      • --format application/pdf: Restricts the printer to accepting and producing PDF files.
      • --keep-files: Crucially, this tells the printer not to delete the output file after printing.
      • "Test-IPP-Printer": The broadcast name of your new virtual printer.
    • Restart=always: A robustness feature that automatically restarts the service if it ever fails.
  • [Install] Section:
    • WantedBy=default.target: This hooks the service into the standard user login process, ensuring it starts automatically.

4.5 Step 5: Enable and Start the Service

Now, tell systemd to recognize and run your new service. Because this is a --user service, sudo is not needed.

  1. Reload the systemd user daemon to make it aware of the new file:

    systemctl --user daemon-reload
  2. Enable the service to start on every login and start it right now:

    systemctl --user enable --now ipp-virtual-printer.service

4.6 Step 6: Verify the Service is Running

Check the status to ensure it started correctly.

systemctl --user status ipp-virtual-printer.service

You should see active (running) in green in the output. If you see an error, double-check your service file for typos. Your persistent virtual printer is now running and will be automatically discovered by CUPS.

5 Reflect and Review

ImportantReflection: 3-2-1

Now that you have completed this exercise, reflect on your experience in your personal notes:

  • 3 arguments you used in the ExecStart line for ippeveprinter.
  • 2 systemctl commands you used with the --user flag.
  • 1 reason why using a fixed port (8631) is beneficial for this setup.
TipCheck on Learning

Answer these questions in your notes to solidify your understanding:

  1. What is the purpose of creating a systemd --user service instead of just running the command in a terminal?
  2. In the service file, what does the %h variable represent? Why is it useful?
  3. What command must you run after creating or editing a service file to make systemd aware of the changes?
  4. How can you check if your new user service is running correctly?
  5. Which ippeveprinter flag ensures that your printed PDF files are not deleted?
Back to top