To use qemux86 images you need to builld your own qemu.
With Gentoo it's easy, just enable following USE-flags: opengl, virgl and gtk or sdl2.
Then download latest webos-image-qemux86-master-*.vmdk from http://build.webos-ports.org/webosose/qemux86/ and unzip it.
And start qemu like this:
qemu-system-i386 -m 2048M -drive file=/tmp/webos-image-qemux86-master-20180611230313.vmdk,if=virtio -enable-kvm -device virtio-vga,virgl -display sdl,gl=on -show-cursor -usb -device usb-tablet -net nic -net user,hostfwd=tcp::6622-:22
Change -display sdl
to -display gtk
if you prefer GTK.
You might need to tweak -cpu
parameter as well to match with the features your host CPU has (to be able to use KVM), see discussion here:
https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg109511.html
For Ubuntu you need to rebuild the qemu-kvm .deb packages with necessary options.
First you can try it with the qemu provided by your distribution but in 99.9% it won't work because no distribution ships qemu with opengl and virgl support, e.g. with Ubuntu 18.04 you can do:
apt-get install qemu-kvm
but then when you try to use it like this:
qemu-system-i386 -m 2048M -drive file=webos-image-qemux86-master-20180611230313.vmdk,if=virtio -enable-kvm -device virtio-vga,virgl -display sdl,gl=on -show-cursor -usb -device usb-tablet -net nic -net user,hostfwd=tcp::6622-:22
it will fail with:
SDL1 display code has no opengl support. Please recompile qemu with SDL2, using ./configure --enable-sdl --with-sdlabi=2.0 qemu-system-i386: OpenGL support is disabled
If you try to use GTK:
qemu-system-i386 -m 2048M -drive file=webos-image-qemux86-master-20180611230313.vmdk,if=virtio -enable-kvm -device virtio-vga,virgl -display gtk,gl=on -show-cursor -usb -device usb-tablet -net nic -net user,hostfwd=tcp::6622-:22
qemu-system-i386: -display gtk,gl=on: GTK support is disabled
You can also see
Could not access KVM kernel module: Permission denied qemu-system-i386: failed to initialize KVM: Permission denied
which means that the user you're using isn't included in the kvm group. Just add it in /etc/group, re-login to your desktop environment, verify with groups
that kvm is now listed there.
You can drop -device virtio-vga,virgl -display sdl,gl=on
and it will boot OK, but instead of the webOS OSE UI you'll get just the text console (with surface-manager.service failed, because of missing support).
To include the necessary support you need to rebuild it.
Basically just follow instruction from:
https://help.ubuntu.com/community/UpdatingADeb
-
add deb-src source in /etc/apt/sources.list and run sudo apt-get update
-
sudo apt-get build-dep qemu
that will install quite a few -dev dependencies:
The following NEW packages will be installed: acpica-tools autoconf automake autopoint autotools-dev build-essential debhelper device-tree-compiler dh-autoreconf dh-strip-nondeterminism dpkg-dev g++ g++-7 gcc gcc-7 ibverbs-providers libaio-dev libaio1 libasan4 libasound2-dev libatomic1 libattr1-dev libbluetooth-dev libbrlapi-dev libc-dev-bin libc6-dev libcaca-dev libcacard-dev libcacard0 libcap-dev libcap-ng-dev libcilkrts5 libcurl4-gnutls-dev libdrm-dev libfdt-dev libfdt1 libfile-stripnondeterminism-perl libgcc-7-dev libgl1-mesa-dev libgles2 libglib2.0-dev libglib2.0-dev-bin libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libibverbs-dev libibverbs1 libidn2-0-dev libidn2-dev libiscsi-dev libiscsi7 libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev liblsan0 libmpx2 libncursesw5-dev libnl-route-3-200 libnspr4-dev libnss3-dev libnuma-dev libopengl0 libp11-kit-dev libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpixman-1-dev libpng-dev libpthread-stubs0-dev libpulse-dev libquadmath0 librados-dev librados2 librbd-dev librbd1 librdmacm-dev librdmacm1 libsasl2-dev libsdl1.2-dev libsdl1.2debian libseccomp-dev libslang2-dev libspice-protocol-dev libspice-server-dev libspice-server1 libstdc++-7-dev libtasn1-6-dev libtext-unidecode-perl libtinfo-dev libtool libtsan0 libubsan0 libunbound2 libusb-1.0-0-dev libusbredirparser-dev libusbredirparser1 libx11-dev libx11-xcb-dev libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0 libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxen-4.9 libxen-dev libxenstore3.0 libxext-dev libxfixes-dev libxshmfence-dev libxxf86vm-dev linux-libc-dev m4 make mesa-common-dev nettle-dev pkg-config po-debconf tex-common texinfo uuid-dev x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-xext-dev x11proto-xf86vidmode-dev xfslibs-dev xorg-sgml-doctools xtrans-dev zlib1g-dev
-
sudo apt-get install fakeroot devscripts
Install few more tools used later
-
apt-get source qemu
will download necessary sources and apply the ubuntu patches
-
cd qemu-2.11+dfsg/
apply following patch:
--- debian/control-in.orig 2018-06-12 11:10:13.982959884 +0000
+++ debian/control-in 2018-06-12 11:11:10.298273843 +0000
@@ -42,8 +42,12 @@
# --enable-gnutls
gnutls-dev,
# gtk ui is almost the same as sdl but adds bloat
-# --disable-gtk
-## --with-gtkabi=2.0
+# --enable-gtk
+# --with-gtkabi=3.0
+# --enable-opengl
+# --enable-sdl
+# --with-sdlabi=2.0
+# --enable-virglrenderer
# libgtk2.0-dev, libvte-dev (>> 0.18.0~),
# vte is used together with gtk
# --disable-vte
patch -p0 < qemu-opengl-virgl.patch
debchange -i
-
install few more additional dependencies:
sudo apt-get install liblzo2-dev libbz2-dev libsnappy-dev libgtk-3-dev libsdl2-dev libepoxy-dev libgbm-dev libdrm-dev libvirglrenderer-dev
-
rebuild the package
debuild -us -uc -i -I
-
check the configure output that all expected options are now enabled:
SDL support yes (2.0.8)
GTK support yes (3.22.30)
GTK GL support yes
...
virgl support yes
you can check this later in the build log qemu_2.11+dfsg-1ubuntu9_amd64.build
9) if everything went well, you now have bunch of .deb packages in the directory above qemu-2.11+dfsg
For the webOS OSE testing all you need is the qemu-system-x86 package:
sudo dpkg -i qemu-system-x86_2.11+dfsg-1ubuntu9_amd64.deb
Now you can try it again:
qemu-system-i386 -m 2048M -drive file=webos-image-qemux86-master-20180611230313.vmdk,if=virtio -enable-kvm -device virtio-vga,virgl -display sdl,gl=on -show-cursor -usb -device usb-tablet -net nic -net user,hostfwd=tcp::6622-:22
it will show something like:
gl_version 43 - core profile enabled
depending on the graphics card in your system and what drivers you're using, for me this is with default Xubuntu 18.04 install with
VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)
glxinfo | grep "OpenGL core profile version"
OpenGL core profile version string: 4.3 (Core Profile) Mesa 18.0.0-rc5
or gl_version 45 - core profile enabled
with VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
glxinfo | grep "OpenGL core profile version"
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.0-rc5
and it should work fine. There are some issues in the emulator and it isn't
officially supported yet, but at least you can see how it looks now (almost
the same as on raspberrypi3). With GTK UI there are few more issues, the
resolution isn't set correctly and the cursor isn't rendered inside QEmu
window.
Don't forget to repeat this procedure every time the system qemu is upgraded (so that you get all the new fixes from your distribution and keep the modified qemu-system-x86 package compatible with the rest for qemu packages).