Virtual Printers

Here you can provide suggestions on how to improve the product, website, etc.
Post Reply
mark rumsey
Posts: 81
Joined: 3. Mar 2009, 23:14

Virtual Printers

Post by mark rumsey »

I have a suggestion. Would it be possible to add virtual printer support to VBox? I'm looking at something relatively straightforward (I hope). In essence, I'm thinking of a simple link that takes the output of a printer (driver) in the guest and passes it to a printer driver on the host. This is how I see it working. The guest application prints to the virtual printer, which then stores the information in a temporary location/file until enough has spooled to pass to the physical printer, at which point it is then passed on to the hosts printer driver as if it had come from a normal application. I don't know what format this temporary file would take, but I suspect it would be some sort of raw image data to esure compatibility between diverse form of printer hardware and guest operating system. I can see this isn't going to be fast as it effectively involves printing the pages twice and buffering a lot of data on the host in between. I see two versions of this setup. The first, for supported guests that have guest additions, would be a custon VBox printer driver installed in the guest. This would be by far the fastest option as it could buffer the data in an efficient format and present it in a way the host printer driver can deal with quickly, i.e it can buffer text as text, postscript as postscript, image as image etc. It may even be able to handle more advanced features like multiple pages per sheet and duplex printing if the host printer driver also supports it. The second setup involves hardware emulation of a standard printer or printers in much the same way sound cards are currently emulated. I would suggest emulating three, maybe four printers, a simple dot matrix printer such as one of the Epson ESC/P2 range, a simple PCL printer such as the HP Deskjet 500 or similar (possibly the 500C colour version), a basic postscript printer and maybe a simple generic text only printer. At least one of these will be supported by virtually every conceivable guest operating system ever produced, and in the case of DOS, almost every application written.

So, what is the point of this feature? After all, if the physical printer has drivers for the guest there's a good chance the guest will be able to print to it, either over the network or by capturing the USB connection to the printer, depending on how the printer is connected. Whislt that will be good enough for most situations, I see three places the virtual printers would be used. First, legacy support. Virtual printers would enable older guest operating systems and applications to print to modern printers even if drivers don't exist for the guest. This is by far the most obvious and probably the least commercial reason for this feature. Second, testing new operating systems. VBox often gets used for Alpha and Beta testing new operating systems and these often come with limited driver sets since many manufacturers do not release drivers for their harware until the operatng system is nearing completion.However, they often include some basic drivers, so this would allow data to be printed until the hardware drivers are written. Third, the ability to publish data from the guest through the host. One example would be printing to a PDF creator on the host. Not the best example as PDF creators exist for most operating systems, but there are more options than just PDF creators. Anything that installs as a printer (such as a fax driver) could be used. This might seem long winded, but there is one thing this would allow. It would enable information from the guest to be passed to the outside world without the guest having to be connected to a network, and that means the guest would be almost immune from hacking and attack even without firewalls, antivirus and so on making the guest a very secure environment indeed.

After all, if the physical printer has drivers for the guest there's a good chance the guest will be able to print to it, either over the network or by capturing the USB connection to the printer, depending on how the printer is connected.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtual Printers

Post by mpack »

It's a reasonable idea, but I don't see it being done. It's only of benefit to people who need hard copy (otherwise they could just install a PDF printer in any modern guest), who can't or won't use a network shared printer, and who can't or won't use a USB printer connection. Modern printer drivers for the guest OS which produces raw output (as opposed to PCL or Postscript) may also be an issue, I don't know. Alternatively VBox would have to provide parsers for one or both of these.

IMHO, the benefit sounds too marginal to merit a lot of energy expenditure.
Bigfoot
Posts: 9
Joined: 20. Apr 2009, 23:15
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows XP

Re: Virtual Printers

Post by Bigfoot »

I personally support this idea. Even if it was something as simple as a generic postscript virtual printer which sends its data to VirtualBox itself, which can then see the actual printer(s) on the host OS. This would make it a lot easier, at least for myself, so that the print jobs could ultimately be controlled through the host OS (which is what I prefer anyways). As for people who would like it to be the other way around (having the guest OS talk directly to the printer), an option could be added in the VirtualBox settings to have VB pass the printers to the guest or not.

I was actually searching around right now to see if this feature even existed. Wine under Linux (as far as I can tell) does a similar thing. When an application run through Wine goes to print something, Wine sees the printers that are available through CUPS, and then hands them over to the application. Although I'm sure that VirtualBox will be a much different implementation than how Wine does it, the concept is the same idea.

That's just my two cents however. Figured I would chime in as well!
Ton Lindemann
Posts: 5
Joined: 19. Apr 2010, 12:41
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: MS-Dos 3.3; 4.01; 5.0; 6.22; WfW3.11; W95; W98; W2k

Re: Virtual Printers

Post by Ton Lindemann »

mpack wrote:....otherwise they could just install a PDF printer in any modern guest....
Or a Postscript printer in older guest as WfW 3.11. I'm using the HP Laserjet 4050 printerdriver for WfW 3.11 for this task. The link to this driver is available on the site from GhostView. A program you need to display the .ps file on the host, or printing it to your physical printer. It takes a view extra steps, but it is possible.

But the idea for having a virtual printer is a good one, but only if it becomes also available as a general hardware setup for use in e.g. DOS, WfW and other aged or rare OS and not only as guest additions for supported OS.

Cheers,

Ton Lindemann
mark rumsey
Posts: 81
Joined: 3. Mar 2009, 23:14

Re: Virtual Printers

Post by mark rumsey »

As I mentioned before, this isn't confined to just hard copy output. Several applications use dummy printers to take information and pass it on in a page layout format, including things like PDF creators, fax programs and desktop publishing.

I see this feature as a slightly more specialised feature for specific applications. I have already mentioned three, namely legacy hardware/software support (using old guests with modern printers and modern guests with old printers where drivers don't exist), testing new operating systems where hardware drivers have not yet been written, and the ability to publish data from the guest through the host (i.e. via virtualbox itself rather than via a USB or network link) where other means are not possible or not secure. There is also a fourth application I've come across, which is uncommon and obscure operating systems where drivers do not exist for printer hardware. Consider Solaris, OS/2 or other even more obscure operating systems that hardware manufacturers simply won't invest the time and money on writing drivers. For example, my new HP Officejet 8000 printer is only supported under Windows (2000 or later), Linux or Mac OS X. Even though this printer has both USB and network capabilities it is not possible to print to it from OS/2 or any other less common operating system.

Yes, this feature won't be needed by every user and in all likelyhood will only be used by a small percentage of users, but then how many users will acutally make use of recently added features like multiple virtual monitors, virtual hardware 3D acceleration or CPU hot plugging? It should also be relatively simple to implement as, in principle, its no different to the existing Soundblaster or S3 video chipset emulation that is already used in VB.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Virtual Printers

Post by fixedwheel »

mark rumsey wrote:Even though this printer has both USB and network capabilities it is not possible to print to it from OS/2 or any other less common operating system.
its possible from OS/2 using a Windows print server => http://www.os2ezine.com/20030716/page_3.html and should be even more easy to set up with a cups based print server instead.

maybe interesting too: set up a postscript to PDF printer queue with cups-pdf => http://www.cups-pdf.de/documentation.shtml
a_m0d
Posts: 3
Joined: 25. Apr 2009, 08:28
Primary OS: Fedora 10
VBox Version: OSE Fedora
Guest OSses: Windows XP

Re: Virtual Printers

Post by a_m0d »

I would also find this useful - it might allow me to easily print to my CUPS PDF printer from windows. I have an application from which I wish to print to PDF, but it blocks any printer which it thinks generates PDFs. This is the only way I could think of to get around.
poks
Posts: 1
Joined: 7. Dec 2015, 19:10

Re: Virtual Printers

Post by poks »

This feature would be useful in testing SNMP features in lab environment for various printers that have wealth of features, and for that if their toner level MIB OID is standard or C/M/Y/K etc.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtual Printers

Post by mpack »

If you want this feature implemented I think you'd have to explain how this would be useful to Oracle, not how it would be useful to you! I mean, how many extra support licenses would implementing this feature make you buy?
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Virtual Printers

Post by michaln »

As mpack points out, "useful" is not what really matters. This sounds like something that would take quite some effort to implement but it would only be of any use to a very small subset of VirtualBox users. That places it quite far down the to-do list. The way to change the priority would either be a paying customer requesting such a feature, or someone contributing the implementation.
Post Reply