{"id":216,"date":"2024-07-16T08:40:34","date_gmt":"2024-07-16T06:40:34","guid":{"rendered":"https:\/\/www.bsdpro.se\/?p=216"},"modified":"2024-07-16T08:46:08","modified_gmt":"2024-07-16T06:46:08","slug":"fix-openbsd-guest-cpu-idle-usage-kvm-proxmox-qemu","status":"publish","type":"post","link":"https:\/\/www.bsdpro.se\/?p=216","title":{"rendered":"Fix OpenBSD guest CPU idle usage &#8211; KVM \/ Proxmox (qemu)"},"content":{"rendered":"\n<p>When running OpenBSD as guest under KVM, the qemu CPU usage can be quite high.<br>This seems to be partly because of the USB drivers being active in OpenBSD, what you can do is to disable loading of the USB drivers.<br>NOTE: This will stop USB keyboards and mouse from working, so it&#8217;s really only suitable for headless servers with ssh or vnc console access.<\/p>\n\n\n\n<p>Make sure your KVM machine type is set to i440fx which should be the default setting in qemu, my guest was installed as an EFI system but it should work with BIOS too.<br>In the OpenBSD guest, create a file called \/etc\/bsd.re-config and add the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\ndisable usb\ndisable ahci\ndisable uhci\ndisable xhci\n<\/code><\/pre>\n\n\n\n<p>Save the file and reboot the OpenBSD guest, the qemu\/kvm process should have resonable CPU usage now, it&#8217;s might still be ~1% higher than other OSes though.<\/p>\n\n\n\n<p>For reference, here are my proxmox settings for the OpenBSD guest:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>balloon: 0\nbios: ovmf\nboot: order=virtio0;ide2;net0\ncores: 4\ncpu: max,flags=+aes\nefidisk0: ext-local01:1180\/vm-1180-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K\nide2: none,media=cdrom\nmemory: 4096\nmeta: creation-qemu=9.0.0,ctime=1721055908\nname: OpenBSD\nnet0: virtio=BC:24:11:A7:55:35,bridge=vmbr0,firewall=1\nnuma: 0\nostype: other\nscsihw: virtio-scsi-pci\nsmbios1: uuid=fe4b2233-55f9-445e-8355-6d9532228dcd\nsockets: 1\ntablet: 0\nvirtio0: ext-local01:1180\/vm-1180-disk-1.qcow2,backup=1,cache=writeback,iothread=1,size=32G\nvmgenid: 42f0eef1-b401-4988-ae8c-f09779ce062b<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When running OpenBSD as guest under KVM, the qemu CPU usage can be quite high.This seems to be partly because of the USB drivers being active in OpenBSD, what you can do is to disable loading of the USB drivers.NOTE: &hellip; <a href=\"https:\/\/www.bsdpro.se\/?p=216\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[20,23,22,21],"class_list":["post-216","post","type-post","status-publish","format-standard","hentry","category-openbsd","tag-kvm","tag-openbsd","tag-proxmox","tag-qemu"],"_links":{"self":[{"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=216"}],"version-history":[{"count":2,"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=\/wp\/v2\/posts\/216\/revisions\/219"}],"wp:attachment":[{"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bsdpro.se\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}