You may experience an issue printing under CentOS 7 or RHEL 7 and later. The printer appears in the CUPS list and is available from the print menu (though it has a status of "/usr/lib/cups/backend/vnc failed"), but very quickly after a message saying the document is printing, another appears saying it has been aborted.
This issue has two potential causes: SELinux, and PrivateTmp.
If you are using Red Hat-compatible Linux and SELinux is enabled during your installation of VNC Server, the VNC policy modules used to fix this issue are registered automatically (if SELinux is enabled after you upgrade, run
vncinitconfig -register-SELinux to register the policy modules manually). If you are using Debian-compatible Linux, you must register the policy modules manually.
If your issue persists, it may be due to the "PrivateTmp" security feature introduced, which can be enabled on a per-service basis. As the name suggests, services running with this enabled have a private
/tmp directory which is not shared with other processes. The CUPS service has this feature enabled by default, which explains why it cannot connect to the VNC Server printing socket in
/tmp. PrivateTmp must be disabled for CUPS for the VNC CUPS driver to work.
- Copy the file
/lib/systemd/system/cups.service to /etc/systemd/system/cups.serviceto create a local copy that won't be reverted by package updates.
/etc/systemd/system/cups.serviceby commenting out the line
PrivateTmp=truewith a hash sign.
systemctl daemon-reload; systemctl restart cups.service