VMware Communities
sdmurphy
Contributor
Contributor

vmware.exe cpu usage is high when I start adb on ubuntu guest

I have VMware Workstation 11 on a Windows 7 host. I am running Ubuntu 14.04 as a guest.

I use the Ubuntu guest primarily for Android development. And I have been having problems with IntelliJ IDEA became very sluggish. Which I thought was just because I had lot of processing going on. But then I noticed that my guest CPU utilization was very low and vmware-vmx.exe utilization on my host was very low, but the VMware Workstation was very sluggish and I couldn't even switch to another guest and I noticed that the vmware.exe process was very high at 12% (which normally tells me that one of my 8 cores is maxed out).

My assumptions:

vmware-vmx.exe on my host is where all guest processing is reported

vmware.exe is only responsible for the Workstation UI

My test:

I have my Ubuntu guest running (with no applications running) and vmware.exe utilization is low/normal:

vmware.exe normal.PNG

I start the adb server on the guest:

start adb service.PNG

I check the vmware.exe utilization on my host and it sits around 3% to 6%, and everything feels normal:

vmware.exe when adb starts.PNG

vmware.exe when adb starts details.PNG

But then slowing (over about an hour), the vmware.exe process utilization slowly increases until it reaches approximately 12%.

vmware.exe cpu high.PNG

vmware.exe cpu high2.PNG

and then everything inside of VMware Workstation becomes incredibly slow. (everything includes, this guest, other guests and the workstation UI) It become almost impossible to switch to another guest.

If I kill the adb server process, the vmware.exe utilization drops back to 0%.

stop adb service.PNG

vmware.exe cpu when adb is stopped.PNG


But when I restart the adb service the vmware.exe utilization goes right back to where it was.


My current workaround: I enabled "Keep VMs running after Workstation closes", I then close VMware Workstation and everything runs smoothly for another hour.


Any ideas????


30 Replies
VooDiK
Enthusiast
Enthusiast

Can comfirm, issue still persist in Vmware Workstation 12

0 Kudos
admin
Immortal
Immortal

I was unable to reproduce your problem, but I found the bug report associated with your service request.  It looks like this is somehow related to USB auto-suspend.  I'm not sure how much you've heard from our support staff, but it appears that the simplest workaround is to disable the automatic addition of a virtual USB hub with the following configuration option:

usb.virtualHubAuto = FALSE

This will limit the number of USB devices that you can connect to the VM.

0 Kudos
VooDiK
Enthusiast
Enthusiast

Unfortunately this doesn't help.

adb  daemon not always using usb, it can connect to the device via tcp/ip ...

Also i make all test without any USB connected, just by startin adb daemon.


I don't know why you can't reproduce the issue, i will try with fresh installed Ubuntu and Android SDK om virtual disks (because now i using physical disks) and let you know.

Thanks.

0 Kudos
admin
Immortal
Immortal

Did you set the option with the VM powered off?

0 Kudos
VooDiK
Enthusiast
Enthusiast

Of course.

Also with closed vmware workstation main window.

0 Kudos
HoboJ
Contributor
Contributor

I'd like to confirm that this issue exists too. I have Workstation PRO 12 installed on Windows 10, running a Ubuntu 14.04.03 VM. After booting the VM the host machine will show 0% CPU utilization in task manager (for VMware Workstation (32bit)), but if I execute "adb devices" (which also starts the adb server) in the VM the CPU utilization on the host machine starts to slowly increase and after some time the VM becomes unusable. However, if I execute "adb kill-server" before the VM fully hangs, the host CPU utilization drops back to 0%. Note that the high CPU utilization is seen on the host machine, not on the VM after running the "adb devices" command.

0 Kudos
HoboJ
Contributor
Contributor

Is this the correct setting?

usb.virtualHubAuto = FALSE

I also tried this and it didn't seem to have an effect. However, updating the following on the VM seems to work around the problem:

In /etc/udev/rules.d/50-usb_power_save.rules, create or add:

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="on"

Then reboot

0 Kudos
HoboJ
Contributor
Contributor

Did my suggestion work for you? Or did you find an alternative solution?

0 Kudos
pigswig
Contributor
Contributor

Thanks HoboJ‌. The /etc/udev/rules.d file worked for me!!! I'm running WS 11.1.2 and this problem just recently cropped up. I originally thought it was due to Android Studio, so I switch to my Win7 host and ran AS fine. I prefer to develop Android apps in my linux guest, and so that was painful, but then I ran adb logcat in my guest, and my linux shell went to a crawl and was unusable.

Unfortunately, I made several changes at once before this issue appeared. I upgraded WS from 11.1.0 to 11.1.2, Debian 7.8 to 8.1, Android SDK (includes adb), AS, and possibly more. So I'm not sure what did it.

Adding usb.virtualHubAuto = FALSE did not help or make any noticeable changes.

0 Kudos
dariusd
VMware Employee
VMware Employee

Workstation 12.1.1, released just today, addresses some issues related to the use of the Android Debug Bridge (ADB) inside a Linux guest.  The internal ticket for this issue suggests that there are a remarkably complicated set of circumstances around this particular problem, and I'm not 100% confident that we have addressed all of them.  Host CPU usage might still be higher than expected, but the host's performance should no longer degrade over time.

If you are already running Workstation 12.x, I'd appreciate your feedback on whether the Workstation 12.1.1 update helps to alleviate the problems you've been encountering using ADB inside a virtual machine.

VMware Workstation 12 Pro Version 12.1.1 Release Notes

Download VMware Workstation Pro

Please let us know how it goes!  Hopefully we have at least managed to address the worst of the problems.

Thanks,

--

Darius

0 Kudos
TheErrant1
Contributor
Contributor

100000% true!

The moment I unmapped my USB smart card reader the CPU utilization went to zero! THANKS a ton!

0 Kudos