VirtualBox闲置Windows guest虚拟机在主机上的CPU使用率很高

时间:2019-05-03 04:53:59

标签: virtualbox

VirtualBox Windows 8.1映像是在i7系统上创建的,并且运行良好(Linux和Windows主机)。在Xeon系统上移动映像时,空闲的来宾会使用约300%的Linux主机CPU。

VBoxManage showvminfo vm
Name:                        vm
Groups:                      /
Guest OS:                    Windows 8.1 (64-bit)
UUID:                        fdb2debf-31ff-4867-8c53-a315d12d348b
Config file:                 /root/VirtualBox VMs/vm/vm.vbox
Snapshot folder:             /root/VirtualBox VMs/vm/Snapshots
Log folder:                  /root/VirtualBox VMs/vm/Logs
Hardware UUID:               fdb2debf-31ff-4867-8c53-a315d12d348b
Memory size                  8000MB
Page Fusion:                 disabled
VRAM size:                   128MB
CPU exec cap:                100%
HPET:                        disabled
CPUProfile:                  host
Chipset:                     piix3
Firmware:                    BIOS
Number of CPUs:              32
PAE:                         enabled
Long Mode:                   enabled
Triple Fault Reset:          disabled
APIC:                        enabled
X2APIC:                      disabled
Nested VT-x/AMD-V:           disabled
CPUID Portability Level:     0
CPUID overrides:             None
Boot menu mode:              disabled
Boot Device 1:               HardDisk
Boot Device 2:               Not Assigned
Boot Device 3:               Not Assigned
Boot Device 4:               Not Assigned
ACPI:                        enabled
IOAPIC:                      enabled
BIOS APIC mode:              APIC
Time offset:                 0ms
RTC:                         local time
Hardw. virt.ext:             enabled
Nested Paging:               enabled
Large Pages:                 enabled
VT-x VPID:                   enabled
VT-x unr. exec.:             enabled
Paravirt. Provider:          Default
Effective Paravirt. Prov.:   HyperV
State:                       running (since 2019-05-03T04:26:59.439000000)
Monitor count:               1
3D Acceleration:             disabled
2D Video Acceleration:       disabled
Teleporter Enabled:          disabled
Teleporter Port:             0
Teleporter Address:          
Teleporter Password:         
Tracing Enabled:             disabled
Allow Tracing to Access VM:  disabled
Tracing Configuration:       
Autostart Enabled:           disabled
Autostart Delay:             0
Default Frontend:            
Storage Controller Name (0):            cont
Storage Controller Type (0):            IntelAhci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  30
Storage Controller Port Count (0):      30
Storage Controller Bootable (0):        on
cont (0, 0): /root/VirtualBox VMs/vm/Snapshots/{eec50ba7-9d02-4c51-9676-4ed0a761c6ce}.vdi (UUID: eec50ba7-9d02-4c51-9676-4ed0a761c6ce)
NIC 1:                       MAC: 080027F44A7A, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82545EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0):   name = http, protocol = tcp, host ip = , host port = 8000, guest ip = , guest port = 80
NIC 1 Rule(1):   name = rdp, protocol = tcp, host ip = , host port = 3389, guest ip = , guest port = 3389
NIC 2:                       disabled
NIC 3:                       disabled
NIC 4:                       disabled
NIC 5:                       disabled
NIC 6:                       disabled
NIC 7:                       disabled
NIC 8:                       disabled
Pointing Device:             PS/2 Mouse
Keyboard Device:             PS/2 Keyboard
UART 1:                      disabled
UART 2:                      disabled
UART 3:                      disabled
UART 4:                      disabled
LPT 1:                       disabled
LPT 2:                       disabled
Audio:                       disabled
Audio playback:              disabled
Audio capture:               disabled
Clipboard Mode:              disabled
Drag and drop Mode:          disabled
Session name:                headless
Video mode:                  2217x1272x32 at 0,0 enabled
VRDE:                        enabled (Address 0.0.0.0, Ports 6666, MultiConn: off, ReuseSingleConn: on, Authentication type: external)
VRDE port:                   6666
Video redirection:           disabled
VRDE property               : TCP/Ports  = "6666"
VRDE property               : TCP/Address = <not set>
VRDE property               : VideoChannel/Enabled = <not set>
VRDE property               : VideoChannel/Quality = <not set>
VRDE property               : VideoChannel/DownscaleProtection = <not set>
VRDE property               : Client/DisableDisplay = <not set>
VRDE property               : Client/DisableInput = <not set>
VRDE property               : Client/DisableAudio = <not set>
VRDE property               : Client/DisableUSB = <not set>
VRDE property               : Client/DisableClipboard = <not set>
VRDE property               : Client/DisableUpstreamAudio = <not set>
VRDE property               : Client/DisableRDPDR = <not set>
VRDE property               : H3DRedirect/Enabled = <not set>
VRDE property               : Security/Method = <not set>
VRDE property               : Security/ServerCertificate = <not set>
VRDE property               : Security/ServerPrivateKey = <not set>
VRDE property               : Security/CACertificate = <not set>
VRDE property               : Audio/RateCorrectionMode = <not set>
VRDE property               : Audio/LogPath = <not set>
OHCI USB:                    disabled
EHCI USB:                    disabled
xHCI USB:                    disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:<none>

VRDE Connection:             active
Clients so far:              3
Start time:                  2019/05/03 04:27:05 UTC
Sent:                        24421625Bytes
Average speed:               26504B/s
Sent total:                  24421625Bytes
Received:                    270108Bytes
Speed:                       293B/s
Received total:              270108Bytes
User name:                   admin
Domain:                      
Client name:                 dev
Client IP:                   192.168.0.59
Client version:              2600
Encryption:                  RDP4

Capturing:                   not active
Capture audio:               not active
Capture screens:             
Capture file:                /root/VirtualBox VMs/vm/vm.webm
Capture dimensions:          1024x768
Capture rate:                512kbps
Capture FPS:                 25kbps
Capture options:             

Guest:

Configured memory balloon size: 0MB
OS type:                     Windows81_64
Additions run level:         3
Additions version            6.0.6 r130049

Guest Facilities:

Facility "VirtualBox Base Driver": active/running (last update: 2019/05/03 04:27:11 UTC)
Facility "VirtualBox System Service": active/running (last update: 2019/05/03 04:27:24 UTC)
Facility "VirtualBox Desktop Integration": active/running (last update: 2019/05/03 04:27:53 UTC)
Facility "Seamless Mode": active/running (last update: 2019/05/03 04:27:11 UTC)
Facility "Graphics Mode": active/running (last update: 2019/05/03 04:27:11 UTC)

2 个答案:

答案 0 :(得分:0)

解决方案违反直觉,限制来宾OS在一(1)个内核上运行。它带来了极快的操作系统启动时间,在我看来,这是最佳处理性能。所有这些都与OS或硬件级别的CPU上下文切换和优化有关。

没有弄清楚究竟是什么使VBox以这种方式执行,但是我的猜测是与CPU有关的,而不仅限于i7 / Xeon。

发现以下有用信息: https://www.reddit.com/r/linux/comments/1tqlsz/adding_cpus_to_virtualbox_guests_makes_guests/

答案 1 :(得分:0)

在我的情况下,需要在虚拟机设置中将cpu计数从1增加到2(主机cpu负载在此之前一直为25%,在之后为1%)。