VMware Cloud Community
geogherkins
Enthusiast
Enthusiast
Jump to solution

esxi 6.5 usb printer - partial printing on guest VM

I am having trouble with a USB attached printer (attached to ESXi 6.5 host) when printing from the guest Windows Server 2008 R2 VM.There are no error messages, everything seems to checks out fine on the printer hardware. If I print a small text document, also ok. But Ms-Word, Ms-Excel, PDF, etc., over a half page will misbehave. The document will print until about midway through the current page and then jump ahead to a new sheet of paper. This happens portrait, landscape, high quality, draft, etc.

Background: Physical server hardware was failing, so this is a P2V solution to save the server. Purchased a used Dell server, installed the free ESXi hypervisor, free P2V converter. New guest VM up and running. Saved the day. The original physical server had three USB devices: UPS, external HDD, Canon MP810 printer. Everything worked on the original physical server. All three UPS devices PnP and are available to the guest VM and are working - except this printing issue. The printer is shared on the network for other (64bit and 32bit Win7 and Win10) clients to use it. It is also a multifunction scanner to the guest server. Scanning works fine. Printing is not printing the entire page on a single page. I get an unexpected page eject and the each page is broken up and printed on one or more sheets of paper. Usually a 1 page document will print on 2 or 3 physical sheets of paper.

Steps taken so far:

1. Reinstall printer driver on guest VM and clients

2. Save Word document as PDF, try printing PDF

3. Try various printer settings (quality, print direction, etc.)

4. Disable power-saving on the USB device settings in the guest VM

5. Restart client, restart VM guest, restart ESX host.

6. Windows client print troubleshooter - "couldn't identify the problem".

None of above have not fixed this issue!

Google searches have come up empty. Looking for tips, ideas to try. I hate the idea of tossing (an otherwise) perfectly good working printer. Thanks!

0 Kudos
1 Solution

Accepted Solutions
geogherkins
Enthusiast
Enthusiast
Jump to solution

I want to close out this question as answered, so here is the summary:

A USB-connected Canon inkjet multifunction printer would scan and print very small files, but would do unexpected page-ejects when printing larger files. The solution was disabling ESXi 6.5 USB drivers and falling back to VMKLINUX USB drivers.

Here is the command to do this:

     esxcli system module set -m=vmkusb -e=FALSE

Followed by a restart of the ESX host.

I then tested three USB devices connected to a Windows 2008 R2 guest VM.

  • Canon MP810 (USB 1.1)
  • Generic External USB Device (USB 2.0)
  • CyberPower UPS

Although my printing problem is fixed, and the other USB devices continue to operate, it seems as if my USB-connected external hard disk drive performance is slow. The evidence of this is circumstantial.  I use a Microsoft Windows Backup on a guest server to write directly to the USB HDD. When using the native ESXi 6.5 vmkusb driver a 800GB system backup ran in under 24 hours. When using the vmklinux USB driver, this same backup takes more than 24 hours (approaching 48 hours).

If there is a solution from VMware to allow the Canon MP810 to work using native ESXi 6.5 USB drivers, I would like to try again in hopes it speeds up the external USB HDD.

View solution in original post

0 Kudos
21 Replies
lancechou
Enthusiast
Enthusiast
Jump to solution

Thanks for reporting the issue.

Could you help provide the following

1. /dev/usbdevices result

    run 'cat /dev/usbdevices' and get the result back to me

2. vmware.log

    Before you reproduce the issue, please turn the VM off, and append the following line to the vmx file (if not existing)

    usb.analyzer.enable = "TRUE"

Thanks,

Lance

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

Thanks for replying Lance. (Sorry for the delay, somehow I didn't get an e-mail notification on this question.)  Attached are the files you requested. I powered on, printed (with error), and powered off the VM guest. Noted during session that the usb.analyzer.enable setting considerably slowed down the process of startup.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

Hi,

  Thanks for helping us debug this issue.

  From the dev_usbdevices.txt you uploaded, I couldn't see your printer. From the vmware.log, everything looked normal. I will also find an USB printer and try reproduce it by myself. Will keep you posted.

Thanks,

Lance

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

Hello,

  I noticed the last line in vmware.log is "<<< file Throttled >>>". Is it the only log file in your VM folder? You can run "ls vmware*.log" to find out. Also, if you could, please attach your printer to the machine and re-run 'cat /dev/usbdevices' again.

Thanks,

Lance

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

There are several vmware.log files (vmware-5.log thru vmware-10.log).

It is baffling why you can't see the printer as connected since during the time in question it was connected and I printed something in an effort to capture the symptom.

I will post new results shortly. Thanks for your continued interest in solving this issue.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

Thanks for the help.

As I mentioned in the previous post, I will also find a USB printer here to reproduce the issue.

--Lance

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

Here is what I did:

  1. Backed up, then edited the .vmx and added the usb.analyze = "TRUE"
  2. Restarted the VM guest print server.
  3. Confirmed the host USB devices show as connected to the guest.
  4. Used PUTTY to view the USB device configuration.
  5. Printed something from a client over the network to the VM guest print server (Noted problem symptom: buffering problem, printer skips ahead to a new page).
  6. I also took some screenshots.
  7. Shutdown the VM guest.
  8. I downloaded in the .vmx, logs, and saved PUTTY output from the 'cat /dev/usbdevices' listing and it seems to contain everything this time.
  9. Everything is in the attached zip archive attachment.
  10. Backed out the usb analyze change to the .vmx file (it slows things down).
  11. Started the VM guest.

Thanks again.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

I'm very sorry that I forgot to mention the most important log in ESXi which is /var/log/vmkernel.log

Thanks again for the help,

Lance

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

So, it's a network printer connected to a VM.

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

To clarify:

The printer is connected by USB to the host.

The USB printer is configured as attached to the guest.

The USB printer is shared by the guest and available to clients on the network.

Networked clients send their print output over the network to the guest's shared printer.

Please see the screenshots included in the attached zip file for clarification.

I have downloaded all logs for the time frame in question. Some have already rolled up into the local .gz compressed format, but you should be able to find the date-time in question in these. Please see attached. Thanks.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

Thanks. This time I saw the Canon MP810 connected to a USB2.0 port on the host.

From the vmkernel.log, the only kind of errors was transfer timeout. I'm thinking if 5 seconds of timeout for a printer is good enough. I will find a printer and see if I can reproduce the issue.

Thanks again for reporting the issue and collecting data for me.

--Lance

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

Can you tell me where I can set the timeout value? Is it a config file I can edit? I could try setting it to a large value, 30 seconds for instance.

I've done some more printing to try to detect a pattern. For a normal dense document, a typical PDF, web page, etc., the printer will print about a half page of information on sheet 1 and then page-eject and continue printing beginning at the top edge of sheet 2 (still logically, page 1 data). Assuming that the data hitting the printer is essentially a graphics file (whether text, images, or whatever) it seems like we are talking about a buffer or memory limit... However, there is no "timeout" (no pause). Sheet 2 starts printing immediately after the sheet 1 page-eject. The page-eject occurs without regard to whitespace and will print the top half of a line of text on sheet 1 and the bottom half of the same line of text on sheet 2.  If I format a small 200 word document with wide margins and lots of whitespace between paragraphs, so the formatted memo occupies the entire page, but is a small file, then the amount of data sent to the printer is small and prints normally on a single sheet of paper even if it occupies an entire page as formatted.

Thanks for continuing to look into this.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

Sorry for not making it clear.

I was talking about transfer timeout in the driver. But unfortunately, it's not configurable.

I checked the USB printer class spec. the BULK IN endpoint is optional and is for status reporting purposes. I think that's the reason. We should have had a longer timeout or no timeout in our driver. But I still need to reproduce it and verify the fix in house.

In the meantime, if you need to have the printer work in a VM, you can disable the native driver before the issue is fixed. Please use

esxcli system module set -m=vmkusb -e=FALSE

or visit Important information about the new ESXi 6.5 USB driver vmkusb, and the legacy USB drivers (2147650)...

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

Can you confirm how I would "undo" the disabling of the native driver in case it makes things worse?

disable driver:

esxcli system module set -m=vmkusb -e=FALSE

enable driver?

esxcli system module set -m=vmkusb -e=TRUE

I will give the above a try to see if I can print normally again. But it might cause problems on the other USB devices, so I need to be sure I can back out that change if necessary.

Do I need to restart the VM guest or the ESX host after issuing the command?

Thanks!

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

Yes, that's the right way to switch between two drivers.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

BTW, you need to reboot your machine after you do so

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

That was a quick response, and we simultaneously cross-posted. Thanks! I'll try this weekend.

0 Kudos
geogherkins
Enthusiast
Enthusiast
Jump to solution

After

1. esxcli system module set -m=vmkusb -e=FALSE

2. restarting ESXi host and VM guest

Now printing is working. The other USB devices (UPS and external HDD) are also working.

Why does disabling the vmkusb module cause USB devices to work normally? This is not intuitive.

0 Kudos
lancechou
Enthusiast
Enthusiast
Jump to solution

vmkusb is the new version of USB drivers in ESXi which is used to replace the old drivers in vmklinux. We allow customers to fall back to the old drivers in case something bad happens.

0 Kudos