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?
#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
#3
I'd also be interested in this.
#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.
#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.
#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)
#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.
#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.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Official Debian support moonwalkers 64 65,546 07-08-2024, 01:40 PM
Last Post: Humid Stylus
  Debian on Pinebook Pro u974615 7 3,014 03-31-2024, 10:11 AM
Last Post: u974615
  Nethunter default password failed lamlarryyyy 0 745 11-23-2023, 02:48 AM
Last Post: lamlarryyyy
  install debian on pbp jsch 7 5,528 11-22-2023, 04:22 PM
Last Post: TRS-80
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 10,038 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  Unable to install Debian Bullseye because of missing wifi firmware Pino64 7 5,519 07-15-2023, 02:58 PM
Last Post: u974615
Question Debian (Vanilla) no output on display after Kernel update (6.0.8-1) as365n4 1 1,697 12-09-2022, 12:43 PM
Last Post: as365n4
  Unsuccessful using danielt's unofficial Debian installer on the PBP joeDoe 2 2,995 12-09-2022, 05:04 AM
Last Post: ndp
  How can I install Debian? ImmyChan 1 2,821 10-19-2022, 03:09 AM
Last Post: alpopa
  when i close my laptop lid the screen doesn't turn on? (debian bullseye based) computerc 3 2,618 09-23-2022, 08:37 PM
Last Post: computerc

Forum Jump:


Users browsing this thread: 1 Guest(s)