Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely high CPU utilization access Ubuntu Studio under Hyper-V VM #2657

Open
pcgeek86 opened this issue May 5, 2023 · 6 comments
Open

Comments

@pcgeek86
Copy link

pcgeek86 commented May 5, 2023

Repro Steps

  • Run Windows 11 and install Hyper-V
  • Create Hyper-V virtual machine w/ 4x CPU cores, 8 GB RAM, with disk on high-performance NVMe SSD
  • Install Ubuntu Studio 22.04 LTS in VM
  • Install XRDP in Ubuntu Studio VM
  • RDP into VM from Windows 11 locally

Actual Result

CPU consistently sits around 70-100% utilization.

Processes consuming the most CPU cycles:

xrdp
kwin_x11
Xorg

Here's a screenshot from btop:

image

Expected Result

CPU sits mostly idle, unless intense work being done on VM.

Question

Are there any methods of improving performance in this scenario? I have a high-end system, but with all the system resources being consumed by the Linux desktop environment and xrdp, the VM feels really sluggish.

@matt335672
Copy link
Member

What happens to the CPU if you:-

  1. Disconnect from the xrdp session, but leave it running?
  2. kill kwin_x11 (allowing for the desktop becoming unusable)?

@matt335672
Copy link
Member

@pcgeek86 - do you need any more input into this?

@pcgeek86
Copy link
Author

Yeah I do, thanks.

What are you hoping to find out by disconnecting from xrdp? Do you want me to SSH into the VM and use something like btop to inspect CPU utilization, in this scenario?

What are you hoping to accomplish by killing the kwin_x11 process?

@matt335672
Copy link
Member

It's fairly likely the high CPU is being driven by the kwin_x11 compositor:-

  1. The disconnect should remove the xrdp process from the system so we can see what else is happening. Yes - use ssh/btop (or whatever) to look at the CPU performance.
  2. Removes the compositor itself.

@pcgeek86
Copy link
Author

pcgeek86 commented Jun 3, 2023

I've since set up a new environment. Brand new Windows 11 system. Brand new Ubuntu Studio 22.04 LTS Hyper-V virtual machine. Same exact hardware as original post. Display scaling set to 200%.

I installed xrdp with apt-get install xrdp --yes. I also tweaked the port= setting to a value of vsock://-1:3389 tcp://:3389. I have no idea what that actually does, but I read it somewhere. My CPU utilization doesn't seem to be as high as in my OP.

image

On the Hyper-V host, I also ran this PowerShell command:

get-vm -Name ub* | set-vm -EnhancedSessionTransportType HvSocket 

I don't know if that did anything.

@matt335672
Copy link
Member

The vsock setting allows VMs on the same Hyper-V host to communicate directly rather than going via the TCP stack on the host. If your Windows 11 system is a separate machine, this will have no effect.

There's also some info in #2698 that may be of interest to you, namely:-

  1. Don't use less than 24-bit colour.
  2. Enable the LAN connection type in mstsc.exe if you haven't already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants