User avatar
Gavinmc42
Posts: 4850
Joined: Wed Aug 28, 2013 3:31 am

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Thu Oct 31, 2019 2:58 am

Have you asked on the Ubuntu forums?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Cob
Posts: 28
Joined: Tue Mar 05, 2013 2:03 am

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Thu Oct 31, 2019 11:25 am

Tried this? linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+kvm_arm64 and linux-image-5.3.0-1008-raspi2_5.3.0-1008.9+kvm_armhf

https://bugs.launchpad.net/ubuntu/+sour ... comments/1

pooky
Posts: 2
Joined: Wed Oct 30, 2019 8:11 pm

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Thu Oct 31, 2019 11:56 am

It's works !

Now my kernel is:
Linux ubuntu 5.3.0-1008-raspi2 #9+kvm SMP Wed Oct 23 15:33:01 CST 2019 aarch64 aarch64 aarch64 GNU/Linux

Thank you for share!


BRX7
Posts: 91
Joined: Sat Aug 31, 2019 11:07 pm

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Sat Nov 02, 2019 11:06 pm

ok I have run the script on Gentoopi64 RPI4 4GB,
I get a message saying GTK initialization failed, is this because I am running it through a rdp connection to my pi?

KuroRyu
Posts: 1
Joined: Mon Nov 11, 2019 12:58 pm

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Mon Nov 11, 2019 1:00 pm

I am trying to follow the tutorial but I am facing some issues during the process.
When I have booted the image, there seems to be some problem with libc. I can not update the system at all.

Code: Select all

ubuntu@ubuntu:/$ apt-get update
apt-get: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.30' not found (required by /lib/aarch64-linux-gnu/libudev.so.1)
ubuntu@ubuntu:/$ apt-get upgrade
apt-get: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.30' not found (required by /lib/aarch64-linux-gnu/libudev.so.1)
How can I solve this?

User avatar
Gavinmc42
Posts: 4850
Joined: Wed Aug 28, 2013 3:31 am

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Thu Nov 14, 2019 10:52 am

Is Ubuntu now the most up to date OS for Pi3/4?
Kernel 5.3 on aarch64?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

XperfectTR
Posts: 1
Joined: Wed Feb 19, 2014 3:52 pm

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Wed Dec 04, 2019 2:42 pm

Following the same steps I did with orange pi 3.but the screen does not come with virtualization.

It works without virtualization.

What is the reason?

gilius2k15
Posts: 67
Joined: Thu Jul 18, 2019 8:42 am

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Wed Dec 25, 2019 9:51 pm

Windows 10 Lite version 1.0 for Raspberry Pi 3/4 has been released today:
https://discourse.pi64.win/t/woalite-re ... rry-pi/457

It includes simplified instructions for RPi4 KVM using the WOALight install.wim with built-in drivers. Basically, everything is done remotely from a Windows 10 PC besides copying the bios file to the Gentoo desktop - see instructions via the above link.

ChasTech
Posts: 22
Joined: Mon Oct 21, 2019 5:01 am

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Thu Jan 02, 2020 9:26 pm

Nice! When my RPi4 accessories arrive later tomorrow, I'll try this out! Considering I have the 4GB RAM version this should be good :D :D
If apples give you apple pie, bananas give you banana pie, pears give you pear pie, and cherries give you cherry pie, then what do raspberries give you?

A Raspberry Pi :lol:

AveryFreeman
Posts: 1
Joined: Wed Jan 08, 2020 5:08 pm

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Wed Jan 08, 2020 5:10 pm

Three questions:

Which version of Windows IOT are you running? 19035 is supposed to have major upgrades for KVM ARM

Is the ARM version of Windows only capable of running appx containers? (UWP apps - like windows store apps)

Have you been able to use KVM 5.3? 5.3 kernel is supposed to have major updates for KVM ARM - 5.5.1 builds on that (was just looking at source in GitHub)

Thanks!

User avatar
Botspot
Posts: 1554
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Fri Jan 10, 2020 12:51 am

Could someone share an img file of this setup?
Want to run Minecraft Java on your RPi? Easiest way is with Pi-Apps - just click Install.
https://github.com/Botspot/pi-apps
Pi-Apps also includes Zoom, Visual Studio, Tor browser, Windows 10 theme, and 33 more.
Over 50,000 users!

puppywang
Posts: 1
Joined: Tue Jan 14, 2020 9:03 am

Re: Ubuntu 19.10 for the Raspberry Pi 4 with a KVM-enabled kernel & Windows 10 guest

Wed Oct 07, 2020 9:40 am

I tried to run woa on Ubuntu 20 LTS, with latest 19041.508.200906-1326 win10 arm64 iso, but it hangs after the second time display `TianoCore` banner, after the `Press any key to boot from CD or DVD` prompt, I tried both software emulation mode on intel cpu and kvm mode on raspberry pi4, the same hang happened, The QEMU_EFI.fd I'm using is downloaded from `http://publishing-ie-linaro-org.s3.amaz ... C42QCU7ITA` and ISO is `19041.508.200906-1326.VB_RELEASE_SVC_PROD1_CLIENTPRO_OEMRET_A64FRE_ZH-CN.ISO`, the full cmd to run qemu is `qemu-system-aarch64 -accel tcg,thread=multi -M virt-2.12 -smp 2 -m 1.5G -cpu cortex-a53 -bios QEMU_EFI.fd -device ramfb -device ich9-usb-ehci1 -device usb-kbd -device usb-mouse -device usb-tablet -device usb-storage,drive=install -drive if=none,id=install,format=raw,media=cdrom,file=19041.508.200906-1326.VB_RELEASE_SVC_PROD1_CLIENTPRO_OEMRET_A64FRE_ZH-CN.ISO -device usb-storage,drive=drivers -drive if=none,id=drivers,media=cdrom,file=virtio-win-0.1.171.iso -device virtio-net,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:3389,smb=/home/ubuntu/Desktop -hda system.vhdx`

Is there any prebuilt vhdx that we can test easier ? Thanks.
gilius2k15 wrote:
Mon Aug 26, 2019 11:35 pm
Running Windows 10 on ARM with KVM acceleration enabled is quite tricky and requires a 64-bit OS with a KVM-enabled kernel (/dev/kvm must exist) - so not sure if the current Pi distros of Debian satisfy those requirements? Best bet is Ubuntu or Gentoo right now.

I'll take you through some of the prerequisites first...

You can install one of the latest versions of Qemu-kvm using a package manager, but it doesn't actually matter if it's version 3 or 4 because the only virtual machine version that works is 2.12 (and below) because of a bug that still hasn't been fixed in maybe 1.5 years.

Code: Select all

sudo apt install qemu-kvm libvirt-daemon-system samba
(The samba is needed if you like to create a shared drive to be accessible from within the guest VM - depends on network access).

You need to pick a folder - say the desktop or downloads folder - and download the following to the same folder:
http://snapshots.linaro.org/components/ ... EMU_EFI.fd
This is the Linaro UEFI bios that exists as a single file - but can be converted to two flash0 and flash1 IMG files if you wanted to save any bios settings - not really necessary though.

https://fedorapeople.org/groups/virt/vi ... noarch.rpm
Above is the latest ARM64 guest drivers for Qemu - comparable to VMware Tools - or VirtualBox guest add-ons, etc. You need to extract the ISO from the RPM file using an archive manager, such as 7-Zip.

Besides the drivers ISO you need to download and build up a Windows 10 on ARM ISO from one of the two main UUP dump sites (best done from an actual windows command line instead of linux terminal):
https://uup.rg-adguard.net/index.php or https://uupdump.ml/

Only newer versions work with the official Qemu:
Insider 18348.190226-1407 (1st March 2019) or newer i.e. feature upgrade 1903 (April/May 2019) or the latest Insider is recommended.
https://blogs.windows.com/windowsexperi ... ild-18348/
https://www.theregister.co.uk/2019/03/1 ... 10_on_kvm/

If you wish to run an earlier build of Windows 10 then you should use driver1998's Qemu fork - but the CPU speed may be reduced based on how many cores you include in your VM script:

Code: Select all

git clone https://github.com/driver1998/qemu
sudo apt install glib2.0 libpixman-1-dev gcc libsdl2-dev bison flex qemu-kvm libvirt-daemon-system
cd qemu
git checkout woa-kvm
mkdir build
cd build
sudo ../configure --target-list=aarch64-softmmu --disable-werror
sudo make
sudo make install
Lastly, you need to create a VHD or VHDX for your VM - about 13 GB minimum:

Code: Select all

qemu-img create -f vhdx -o subformat=fixed system.vhdx 13G
Ensure the above are all contained in the same folder then you just need to create an SH script to run the VM:
virtio-win-0.1.171.ISO
18362.1.190318-1202.19H1_RELEASE_CLIENTPRO_OEMRET_ARM64FRE_EN-US.ISO
QEMU_EFI.fd
system.vhdx
script.sh - blank for now - see bottom

BTW, if you want to run this on Windows 10 Intel host, without KVM ,in software simulation mode only then you need to install the following and then put the same files listed above under c:\program files\qemu (or move the qemu folder to c:\qemu after installing it):
https://qemu.weilnetz.de/w64/
(and Instead of script.sh it would be named script.bat)

So you see there are two main modes for running a Qemu guest VM:
Software simulation mode
near-native hardware acceleration mode (KVM) - Intel guest on Intel host - or in this case ARM64 guest on ARM64 host.

Software Simulation mode is generally more stable, but runs extremely SLOW - recommended to use an Intel host to try to build up/test/update your VHDX-based VM before copying across to the Pi as it would be quite painful to install the Windows.ISO to the system.vhdx using the Pi in sim mode and take about 3 hours. I can do it in about 30 minutes using an i7-8700K

KVM mode currently has problems with Ethernet drivers because the VirtIO NetKVM driver hasn't been fixed yet - but there are some workarounds.

The script requires about 15 lines to run the VM. Let's start with the first few lines - some subtle differences exit between sim vs. KVM modes:

Software Simulation Mode - Linux

Code: Select all

sudo qemu-system-aarch64 \
-cpu cortex-a57 \
-accel tcg,thread=multi
Software Simulation Mode - Windows

Code: Select all

qemu-system-aarch64.exe ^
-cpu cortex-a57 ^
-accel tcg,thread=multi
KVM mode

Code: Select all

sudo qemu-system-aarch64 \
-cpu host \
-enable-kvm
For sim mode you could choose cortex-a53 instead of a57 if you wish. The rest of the script is the same for both modes:

Code: Select all

-M virt-2.12 \
-smp 2 \
-m 1.5G \
-bios QEMU_EFI.fd \
-device ramfb \
-device usb-kbd \
-device usb-mouse \
-device usb-tablet \
You must use virt-2.12 or maybe 2.11 or 2.10, etc. You cannot use just -virt (latest version) or even version 3 - due to a bug.
The smp value is the number of CPU cores - can affect CPU speed with driver1998's qemu fork for some reason. I think with the Pi3-4 you should be safe with 2-3. -smp 4 seems to work too - but 1 core is meant to be reserved for the host.
The -m value represents RAM. With the Pi4 you could increase to 2 GB - but 1.5 is a more safe bet.
The bios we spoke about already...
Ramfb allows you to display the guest in a GUI window. In the past, -device VGA was used in Intel contexts - but with ARM KVM there's a bug with the framebuffer so ramfb is used instead. Should you manage to get network/RDP working later (with auto sign in) then you could use the -nographics option and just RDP to the guest.
USB devices must be added, such as keyboard and mouse. I think the tablet helps with cursor problems.

You must choose a USB controller - there are about 5 available - but the most widely used one is ich9:

Code: Select all

-device ich9-usb-ehci1 \
The CD-ROM is quite straightforward to add:

Code: Select all

-device usb-storage,drive=install \
-drive if=none,id=install,format=raw,media=cdrom,file=18362.1.190318-1202.19H1_RELEASE_CLIENTPRO_OEMRET_ARM64FRE_EN-US.ISO \
NOTE: If you find the CD-ROM doesn't boot for whatever reason (old Windows Server 2016 on ARM or perhaps really new Windows 10 Insiders) then you can extract the contents to a FAT32 VHDX and use that as a source instead (see below for adding VHDX to the script)

To add the VirtIO ISO:

Code: Select all

-device usb-storage,drive=drivers \
-drive if=none,id=drivers,media=cdrom,file=virtio-win-0.1.171.iso \
There's two ways of adding the main hard drive - as a standard USB or VirtIO block device - both require the VioStor drivers generally:

Code: Select all

-hda system.vhdx \
OR

Code: Select all

-device usb-storage,drive=system \
-drive if=none,id=system,format=raw,file=system.vhdx \
OR

Code: Select all

-device virtio-blk,drive=system \
-drive if=none,id=system,format=raw,file=system.vhdx \
This line is only for running old betas of Windows Server 2016 on ARM:

Code: Select all

-rtc base="2016-04-20",clock=vm
Enabling network access will cause crashes and unidentified network with KVM enabled - otherwise can be used in software simulation mode with RDP connections enabled for 127.0.0.1:5555 and a shared samba drive:

Code: Select all

-device virtio-net,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5555-:3389,smb=/home/ubuntu/Desktop
You have to allow blank passwords over RDP via secpol.msc:
Open Local Policies -> Security Options
Change Accounts: Limit local account use of blank passwords to console from Enabled to Disabled
This will allow auto sign in, etc. Or see this page:
https://support.microsoft.com/en-gb/hel ... in-windows

Note: Qemu guest graphics acceleration does not yet exist for ARM64 Windows by the Fedora Project (driver is named QXL) - but if you RDP you should get a better graphical experience than ramfb.

The workarounds that exist for network access inside KVM (I haven't tried them):
https://github.com/virtio-win/kvm-guest ... -522130741
https://github.com/virtio-win/kvm-guest ... -468149012

BTW, Server 2016 betas are a real nightmare to get working since the VioStor drivers only work on Win 10 and not Win Server, so simply extracting the installer ISO to a FAT32 VHD is not enough - you need to use DISM to apply the actual WIM image from the ISO sources folder to a VHDX:

Code: Select all

diskpart
list disk
select disk x (after creating/attaching VHDX in disk management)
clean
convert gpt
create partition efi size=124
format fs=fat32
assign letter s
create partition primary size=13000
format fs=ntfs quick
assign letter w
exit
dism /apply-image /imagefile:c:\wim\install.wim /index:1 /applydir:W:
bcdboot W:\Windows /s s: /f UEFI
bcdedit /store s:\EFI\Microsoft\Boot\bcd /set {default} testsigning on
bcdedit /store s:\EFI\Microsoft\Boot\bcd /set {default} nointegritychecks on
Note: the last 2 lines may not be needed when it comes to the latest drivers.

Anyway, so here's the final script for Windows 10:

Software Simulation Mode

Code: Select all

sudo qemu-system-aarch64 \
-accel tcg,thread=multi \
-M virt-2.12 \
-smp 2 \
-m 1.5G \
-cpu cortex-a53 \
-bios QEMU_EFI.fd \
-device ramfb \
-device ich9-usb-ehci1 \
-device usb-kbd \
-device usb-mouse \
-device usb-tablet \
-device usb-storage,drive=install \
-drive if=none,id=install,format=raw,media=cdrom,file=18362.1.190318-1202.19H1_RELEASE_CLIENTPRO_OEMRET_ARM64FRE_EN-US.ISO \
-device usb-storage,drive=drivers \
-drive if=none,id=drivers,media=cdrom,file=virtio-win-0.1.171.iso \
-device virtio-net,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5555-:3389,smb=/home/ubuntu/Desktop \
-hda system.vhdx
KVM

Code: Select all

sudo qemu-system-aarch64 \
-M virt-2.12 \
-smp 2 \
-m 1.5G \
-cpu host \ 
-enable-kvm \
-bios QEMU_EFI.fd \
-device ramfb \
-device ich9-usb-ehci1 \
-device usb-kbd \
-device usb-mouse \
-device usb-tablet \
-hda system.vhdx
Again, you add a NIC and RDP if you get that far by appending the following:

Code: Select all

-device virtio-net,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5555-:3389,smb=/home/ubuntu/Desktop
Consider a -nographic option instead of ramfb is fully working with network, RDP and auto sign-in enabled.

Consider a block device too for the main hard drive - original source here using an NEC USB bus instead - but it's up to you:
https://withinrafael.com/2018/02/11/boo ... 0-in-qemu/

When you first start the script it will load the bios then attempt to boot from CD-ROM:
press any key for cd...
Leave default keyboard
install now
skip product key
accept terms
custom: install windows only (advanced)
load driver > browse > CD virtio > viostor > w10 > ARM64
load driver > browse > CD virtio > NetKVM > w10 > ARM64
Select system hard drive > Next to install

Return to “Ubuntu”