Clone this repo:
  1. afbe0b1 virtual-usb-printer: fixing get device descriptor response by David Valleau · 7 weeks ago firmware-sarien-12200.B master release-R75-12105.B stabilize-12054.B stabilize-12058.B stabilize-12060.B stabilize-12061.B stabilize-12088.B stabilize-12121.B stabilize-12202.B stabilize-12206.B stabilize-flapjack-12109.B
  2. 3c4785c virtual-usb-printer: Removing CUPS dependency by David Valleau · 9 weeks ago factory-sarien-12033.B stabilize-11998.B
  3. 0d3da5d Merging received chunked messages and writing to document by David Valleau · 3 months ago factory-atlas-11907.B release-R74-11895.B stabilize-11839.3.B stabilize-11839.B stabilize-11895.108.B stabilize-11895.109.B stabilize-11895.118.B stabilize-11895.72.B stabilize-11895.89.B stabilize-11895.95.B
  4. 3d5ac0d Fix compile-time issues with 32-bit architectures. by Allen Webb · 3 months ago firmware-atlas-11827.12.B firmware-atlas-11827.B
  5. 7afe61d Adding support for Validate-Job and Create-Job requests by David Valleau · 3 months ago

Virtual USB Printer

Virtual USB Printer provides a server which can be used with USBIP in order to emulate a USB printing device and bind it to the system as if it were physically connected to a USB port.

Virtual USB Printer supports both regular USB printers as well as IPP-over-USB devices.


This project was created in order to make on-device tests which check for any regressions in the native USB printing system.


  • USBIP - userspace program for binding virtual device to system
  • USBIP kernel modules:
  • Linux Kernel v4.14 - USBIP currently only works on this kernel version

In order to actually “connect” the virtual printer to the system the USBIP program is used.

USBIP is typically used to export real USB devices over a network so that other systems on the network can bind them and treat them as connected devices.

For the purposes of the virtual printer, only the client portion of USBIP is required so that the virtual device can be bound to the system.

How to Use

Run the virtual-usb-printer program:

virtual-usb-printer --descriptors_path=<path>

(Optional) Check the list of exported printers with USBIP:

usbip list -r localhost

Should return something like this:

Exportable USB devices
 - localhost
        1-1: Canon, Inc. : unknown product (04a9:27e8)
           : /sys/devices/pci0000:00/0000:00:01.2/usb1/1-1
           : (Defined at Interface level) (00/00/00)
           : 0 - Printer / Printer Bidirectional (07/01/02)

Bind the virtual printer to the system:

usbip attach -r localhost -b 1-1

Once the device has been attached it should appear in the list of connected USB devices (lsusb), and can be used with the native printing system in Chrome OS.


The printer's USB descriptors and defined IPP attributes can be configured using a JSON file and are loaded at run-time using command line flags. Example configurations can be found in the config/ directory.

The configuration files can be loaded with the following flags:

  • --descriptors_path - full path to the JSON file which defines the USB descriptors
  • --attributes_path - full path to the JSON file which defines the supported IPP attributes
    • Only needed for IPP-over-USB printer configurations
  • --record_doc_path - full path to the file used to record documents received from print jobs