Enable KVM on default OS (Debian 9)
#1
Hi, I just received my PineBook Pro yesterday and I am using the default OS with Debian 9 (32bit user space, 64bit kernel). I would like to recompile the kernel to enable the KVM module. I want to test containers and possibly Windows 10 on ARM. I have seen the images on the wiki, but I am not sure where the sources are to build an image myself, although ideally I just want to update the kernel on my existing OS. Since there are so many repos and distros for the PineBook Pro, I am not sure where to start. I don't want to lose all the great driver support, like the Mali drivers, I am hoping someone could share simple instructions to clone the repo of the kernel, build a .deb and install a kernel upgrade. Or in any case, this could possibly be a feature request for @Mrfixit2001  or @ayufan to include in the official image?
  Reply
#2
See also  Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

https://www.raspberrypi.org/forums/viewt...1#p1526221
  Reply
#3
I'd also be interested in this.
  Reply
#4
It works very well on the current Manjaro preview:
[Image: xbcgefjhdiw.png]
[Image: rtpycmqudkx.png]
Code:
#!/bin/bash
export QEMU_AUDIO_DRV=pa

sudo qemu-system-aarch64 \
-cpu host \
-enable-kvm \
-M virt-2.12 \
-smp 2 \
-m 1.5G \
-bios QEMU_EFI.fd \
-device ramfb \
-device ich9-usb-ehci1 \
-device usb-kbd \
-device usb-mouse \
-device usb-tablet \
-device usb-storage,drive=drivers \
-drive if=none,id=drivers,media=cdrom,file=virtio-win-0.1.173.iso \
-device virtio-blk,drive=system \
-drive if=none,id=system,format=qcow2,file=system.qcow2 \
-soundhw hda \
-device usb-ehci,id=ehci -device usb-host,bus=ehci.0,vendorid=0x0bda,productid=0x8153

I used a USB network card (realtek gigabit), virtio-net and e1000 caused bluescreens. 
KVM only works on the 2 BIG cores, not the 4 little cores. Linux currently can't handle that automatically and the scheduler has problems with it as well. 
For now, I just disable the 4 little cores at runtime using the /sys/devices/system/cpu/cpu{0-3}/online flags. 


Windows image was a 19030.1, for arm64. 
x86 emulation works well, it's quite fast.
  Reply
#5
Updated kernel in v1.5 update just released. A new release on GitHub was also pushed. I added virtualization and kvm to the kernel, as requested.
  Reply
#6
(11-23-2019, 03:52 PM)Mrfixit2001 Wrote: Updated kernel in v1.5 update just released. A new release on GitHub was also pushed. I added virtualization and kvm to the kernel, as requested.

I can confirm that this does not work on the stock Debian-Desktop distribution with Kernel 4.4.202 
Qemu just bails out that that "kvm" accelerator not found

The Manjaro-ARM   ( Kernel 5.4.0-1) works fine after setting

echo 0 > /sys/devices/system/cpu/cpu0/online
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /sys/devices/system/cpu/cpu2/online
echo 0 > /sys/devices/system/cpu/cpu3/online

Then the 2 cores work with -enable-kvm  ( tested with qemu-system-aarch64  4.1.93)
  Reply
#7
(11-30-2019, 05:50 PM)astr0baby Wrote:
(11-23-2019, 03:52 PM)Mrfixit2001 Wrote: Updated kernel in v1.5 update just released. A new release on GitHub was also pushed. I added virtualization and kvm to the kernel, as requested.

I can confirm that this does not work on the stock Debian-Desktop distribution with Kernel 4.4.202 
Qemu just bails out that that "kvm" accelerator not found

The Manjaro-ARM   ( Kernel 5.4.0-1) works fine after setting

echo 0 > /sys/devices/system/cpu/cpu0/online
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /sys/devices/system/cpu/cpu2/online
echo 0 > /sys/devices/system/cpu/cpu3/online

Then the 2 cores work with -enable-kvm  ( tested with qemu-system-aarch64  4.1.93)

It looks like maybe you're trying to use the 64-bit kvm? The default userspace is 32-bit while the kernel is 64-bit. So it supports 64-bit but you'll need to configure multiarch first. Otherwise I expect qemu-system-arm will work.
  Reply
#8
Is therean official way how to do this for the Debian-Desktop distro ?

The issue is the following on the Pinebook-pro Debian-Desktop 4.4.205 (up2date)

# dpkg --print-architecture
armhf
# dpkg --print-foreign-arhitectures
aarch64
arm64
# dpkg --add-foreign-architecture aarch64
Odd number of elements in hash assignment at /usr/share/pkg-config-dpkghook line 30.
# dkg --add-foreign-architecture arm64
Odd number of elements in hash assignment at /usr/share/pkg-config-dpkghook line 30.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  An unofficial Debian Installer for Pinebook Pro danielt 439 190,149 05-13-2021, 03:54 AM
Last Post: ab1jx
Music No sound on PBP default installation ivek 9 2,795 05-09-2021, 05:58 PM
Last Post: binholz
  Keyboard issue: Debian PineSupporter 8 959 02-01-2021, 09:57 PM
Last Post: PineSupporter
  Debian Bullseye installation Baconomics 3 956 01-07-2021, 01:46 PM
Last Post: kuleszdl
  My Debian journey on the Pinebook Pro schwarzwieweiss 32 6,311 01-07-2021, 09:35 AM
Last Post: schwarzwieweiss
  Graphic problems when booting Debian crecker 1 945 12-15-2020, 06:39 PM
Last Post: marszal
  trying to install packages to debian onlyjediontheweekend 1 587 12-09-2020, 03:25 PM
Last Post: nas
  Failing to install usb wifi adapter Debian older PBP AaronMFeld 0 621 09-14-2020, 07:42 PM
Last Post: AaronMFeld
  Debian (or ubuntu) on a micro sd card (pinebook pro) pine76 28 10,600 09-06-2020, 08:20 AM
Last Post: pine76
  Debian/Mobian for PBP bcnaz 0 725 08-30-2020, 04:17 PM
Last Post: bcnaz

Forum Jump:


Users browsing this thread: 1 Guest(s)