Re: After printing from windows guest cpu load stays 100% on host

Discussions related to using VirtualBox on Linux hosts.
Post Reply
hefink
Posts: 26
Joined: 3. Feb 2023, 17:27

Re: After printing from windows guest cpu load stays 100% on host

Post by hefink »

After printing out a page from within guest system the cpu load of host system stays at 100%, while in guest system load is displayed as 0% and no process produces any load.

Changing print settings (e.g. with/without printing queue) in guest has no influence on the issue.

The issue shows up in both for me available windows versions
  • Win 2000 professional (last servicepack)
  • Win XP home (last servicepack)
The issue shows up on all for me available Mainboards and CPUs, which are:
  • Intel Pentium 4 on a Medion MD 5000 board
  • Intel Pentium M in RIM 2000 notebook
  • AMD Athlon Thunderbird on a Elitegroup K7S5A board (2GB RAM)
  • AMD Athlon XP ona a Elitegroup K7S5A board (2GB RAM)
  • AMD Sempron (64bit) on Foxconn M61PMV board (4GB RAM)
  • AMD Athlon 64 on Foxconn M61PMV board (4GB RAM)
  • Intel Core i3 540 on Asustek P7P55-M board (8GB RAM)
Virtualbox was installed in the highest from apt package management available version for the respective architecture and the debian based linux host, on stretch, buster and bullseye. (can't check on bookworm)

The issue is independend of usage of a swap partition and amount of free RAM.

Same finding on all systems and all the virtualbox versions, latest version checked was 7.04 (can't check 7.06, there is no install candidate in apt, and installation of manually downloaded package fails. Have to wait until it makes its way into the default repos.)

Image

The proper guest additions for the installed virtualbox version have been installed in the guest systems.

Printer is always physically connected to LPT1
and was made available to the guest systems by e.g.

Code: Select all

$ sudo rmmod lp
$ VBoxManage modifyvm "Win2000SP4" --lptmode1 "/dev/parport0"
$ VBoxManage modifyvm "Win2000SP4" --lpt1 0x378 7
After starting the guest systems everything is fine, and printing works flawlessly in fine resolution from within the guest systems.

Image

After printing the page (or pages) has finished as well printer as also the guest systems show perfectly normal behaviour, which means:
Printer displays idle mode („ready”), accepting next task
Windows guest in virtualbox shows printing task was successfully completed and virtual CPU is back to 0%

But on all host systems now virtualbox eats up 100% real cpu.
On single core systems the complete cpu is blocked by virtualbox, the cooling fan driving mad,
On multicore systems a single core stays at 100% load, (causing the average system load displayed as e.g. 25%)

Switching off the idling printer doesn't solve the issue. The system load stays at 100% from virtualbox process.

Image

Only pausing the virtual machine immediately sets back the host system load, while continuing causes 100% system load again.

Image

Additional printing tasks from within the guest system are accepted and executed properly, but again after the tasks are completed the host system cpu load stays at 100% load from virtualbox, while within guest 0% load is displayed for the virtual cpu.

Only shutting down and starting anew the guest system allows normal working on host system without 100% system load from virtualbox, until another page needs to get printed from within the guest.

The hole issue is not observed when installing the Windows system directly on the plain hardware instead in virtualbox.
Attachments
Win2000SP4-2023-02-03-07-59-40.log.tar.gz
Complete log of a run on Core i3 hardware.
(33.04 KiB) Downloaded 2 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: After printing from windows guest cpu load stays 100% on host

Post by scottgus1 »

IMG tags only work on images previously uploaded through the forum's Upload Attachment tab.
the log wrote:00:00:01.406699 VirtualBox VM 7.0.4_Debian r154605 linux.amd64 (Dec 8 2022 23:46:26) release log
Looks like you're using the Debian fork of Virtualbox. We only support the Official Virtualbox from http://www.virtualbox.org.

I don't have any experience with redirecting an LPT port to the VM, will have to lead that to a forum guru. And you may have to switch to Official Virtualbox, see https://www.virtualbox.org/manual/ch02. ... linux-host. Uninstall the fork Virtualbox and reboot first.

Have you tried sharing the printer on the host OS, then print using the share over a Virtualbox Bridged or Host-Only network?
hefink
Posts: 26
Joined: 3. Feb 2023, 17:27

Re: After printing from windows guest cpu load stays 100% on host

Post by hefink »

scottgus1 wrote:IMG tags only work on images previously uploaded through the forum's Upload Attachment tab.
Many thanks for the hint. I already wondered where the images might have gone, but then noticed the word image in my above posting works as a link you can open by right clicking on the word and open the missing images in new tabs in browser. So next time I'll upload them first as an attachment and try to link to them instead.

For now I can add: I've checked the issue on different kernels also: 4.9.0-326, 4.19.0-256, 5.10.137, 5.10.142, 5.19.0 Always same result, 100% CPU load on host after printing a page or more from within virtualbox.
scottgus1 wrote:Have you tried sharing the printer on the host OS, …
Unfortunately exactly this is the reason for using a VM at all. The printing results generated by the printer driver available on linux host are that poor the pages are mostly unusable (half resolution only). Hence I have to open all the files from within the virtualised windows (using the shared folder) and print them from therein, which comes up with really fine printing results.
scottgus1 wrote:Looks like you're using the Debian fork of Virtualbox. We only support the Official Virtualbox
Many thanks for letting me know this. I had always believed the packaged virtualbox I get via apt from any linux distribution would be the official one, if not named explicitly as a fork. OK, so next step will be: I'll follow your path and try to install the most recent version from https://download.virtualbox.org/virtualbox/ on the core i3 device. Hopefully it will let me install it this time. Will check back and let you know whether using the fork instead of original was the culprit causing this strange behaviour. Btw, does debian actually provide a fork instead of the original without letting users know about this? Would never have guessed I wasn't using the original...
hefink
Posts: 26
Joined: 3. Feb 2023, 17:27

Re: After printing from windows guest cpu load stays 100% on host

Post by hefink »

Now I have purged all debian 7.0.4 virtualbox* packages from the system, restarted, and installed the complete 7.0.6 virtualbox from https://download.virtualbox.org/virtualbox/7.0.6/ including the extpack and the guest additions, using
  • virtualbox-7.0_7.0.6-155176~Debian~bullseye_amd64.deb
  • Oracle_VM_VirtualBox_Extension_Pack-7.0.6-155176.vbox-extpack
  • VBoxGuestAdditions_7.0.6.iso
and checked the sha256 sums before installing. This time and on this device (Intel Core i3 540 on Asustek P7P55-M board, 8GB RAM, bullseye, most recent available 5.10 kernel) the installation of your original packages succeded. The new extpack has been installed into virtualbox, and also the new guest additions within the guests have been installed successfully after properly removing the previous ones.

As in all testings before, I invoked the LPT1 port, to which the printer is physically connected, by

Code: Select all

$ sudo rmmod lp
$ VBoxManage modifyvm "Win2000SP4" --lptmode1 "/dev/parport0"
$ VBoxManage modifyvm "Win2000SP4" --lpt1 0x378 7
Everything as described above with the debian 7.04 version and all the lower versions mentioned. Again, really fine printing results from within guest, but same issue with the constant 100% cpu load on one of the cores after printing was completed and guest as well as printer are idling.
Original virtualbox 7.06 causes 100% cpu on host after printing via LPT port also. (poor image quality due to 128kb attachment limit)
Original virtualbox 7.06 causes 100% cpu on host after printing via LPT port also. (poor image quality due to 128kb attachment limit)
05-original-virtualbox-7.06-causes-100%-cpu-on-host-after-printing-via-lpt-port.jpg (127.23 KiB) Viewed 2315 times
Interesting finding: During processing a next printing from within virtualbox guest, all four cores in host are active with constantly changing loads in a range from maybe 10 to 40, sometimes 75%, rarely a peak of 100% on a single core. This includes the very host core sticking to 100% while guest was idling before after first print. Only after processing of printing has finished again, three cores go back to zero, while one core in host goes up to 100% load from virtualbox process running a completely idling guest. Not always the same core stays at 100%, I have seen second core instead of third one nailed to 100% in another run. As before, also in original 7.06 virtualbox version the host cpu load goes back to normal immediately when guest is paused, and shows 100% immediately after resuming the guest.

Exactly the very same findings with the second available guest OS, which is Windows XP with last service pack installed.
Exactly the very same findings when running on 5.19.0 kernel on host.
Attachments
VBox.log.tar.gz
Complete log file
(33.21 KiB) Not downloaded yet
hefink
Posts: 26
Joined: 3. Feb 2023, 17:27

Re: After printing from windows guest cpu load stays 100% on host

Post by hefink »

Same issue still present when running virtualbox (original 7.0.6 as well as the latest version 6.1.22 packaged by the distro) on bookworm, kernel is 6.1.10, and also kernel 5.10.142

Is it possible virtualbox tries to handle the parallel port as „bidirectional” by default for some strange reason instead of normal parallelport mode, and constantly tries to read data from it to hand over to the guest system, so it constantly is busy when the port was used once? Just a guess...
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: After printing from windows guest cpu load stays 100% on host

Post by fth0 »

Sounds like busy waiting to me, too. Let htop show the threads of the VirtualBoxVM process including their names ('H', F2, Display options > Show custom thread names) ...

If you want to look at the VirtualBox source code yourself: src/VBox/Devices/Parallel.
Post Reply