Skip to main content

Running Windows 10 on Ubuntu with support for 2D accelerated video, disk, network and touch support

How to run windows with acceleration support on Ubuntu 17.10


This works on 17.10, 17.04, 16.10, 16,04.

This setup will accelerate the virtual VM for disk, network, video, random device and memory, it also adds support for touch screen for windows 10 running inside Ubuntu.

Download the iso for windows 10 from Microsoft web site, install the image using regular gnome-boxes interface.

Goto to https://www.spice-space.org/download.html and download the Spice Windows guest tools, to allow copy paste and resize when running under boxes, and install it.

I also installed the guest-agent available inside the virtio-win-XXX.iso cd image under the guest agent folder.

Then download the virtio-win-XXX.iso from here, pick the latest version.
https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio

Goto the device manager browser on windows 10 and click on all devices with problems, and point these to the where the cdrom is and select update.

Do the same for the display driver, the network driver and the disk driver.

This should pick the RedHat drivers, you need to trust Redhat since the drivers are not signed with Microsoft keys.

In a Windows guest, you must then install spice-webdavd service.
https://www.spice-space.org/download/windows/spice-webdavd/

Windows should be running fine now, the instructions below will allow to run the VM even faster, but if you want you can stop here.




After all driver are installed you can change these settings with a permanent way using

sudo apt-get install virt-manager gnome-boxes

Use virt-manager to change the configs for the vms created by gnome-boxes and set all the virtio devices you can (disk and network are a must for speed).
After these changes gnome-boxes will pick the same settings. Don't forget to create a qemu/kvm user session connection to be able to see the gnome-boxes vms in virtual machine manager, in case they are missing.

Some device like the virtio-keyboard virtio-mouse and virtio-tablet are still missing from virtual machine manager interface, so the default ps2 mouse and keyboard are used in this example, and the tablet usb device is used for the mouse to lose focus when it touches the border of the window, but also allowing the windows 10 to be used on a touch screen laptop inside Ubuntu.

Also for all virtio disks setup set cache to none and mode to native, that should make the VMs more reliable and faster if you are using and SSD disk, you can check the picture for the settings.

There is some overlap between the agent and the drivers from the iso file, but it will work fine in the end.

Using the Virtual Machine Manager change the following:
- removed IDE drives.
- added a SATA disk.
- changed the network interface to use virtio.
- changed the sound controller to ich9.
- added a USB mouse and USB keyboard without removing the PS2 mouse and keyboard.
- Installed Spice Windows guest tools.
- Installed Virtio-win-XXX driver for all devices that where marked as red on windows device manager.
- add a small VirtIO disk 2Gb just to force windows to load drivers.
- at this point, install all updates and make not red devices are showing under windows device manager.

After shutting down:

- for all virtio disks setup the cache to "none" and the mode to "native".
- shutdown the vm, then I switched the SATA drive with a VitrIO disk pointing to the same file, remove the SATA drive and fixed the Boot options to use this new drive and windows loaded the new drive just fine.

After all these changes the windows 10 vm works much faster and is integrated with copy paste support. You can also share folders from gnome file manager, using Local Network Share and browse windows shared folders by using gnome file manager "other locations" followed by "windows network".

Advanced

Editing the xml config file with virsh

<input type='tablet' bus='virtio'/>
<input type='mouse' bus='virtio'/>

Replacing the usb tablet and mouse with a virtio tablet, possibly eliminating the need to have a usb host adapter in your virtual machine as often the usb tablet is the only usb device.

At the moment the firmware (edk2/slof) lacks support for virtio keyboards, so switching from usb to virtio looses the ability to do any keyboard input before the linux kernel driver loads, i.e. you can’t operate the grub boot menu. I hope this changes in the future.

If you have to stick to the usb keyboard or usb tablet due to missing guest drivers for virtio input I strongly suggest to use xhci as usb host adapter. Under the USB controller in "Virtual Machine Manager" change it to USB3, windows 10 supports USB 3, you might need to remove some usb devices from your VM.

Opengl version 2 support


There is some work going on to support opengl in Linux and windows guests but this work is not yet support in Ubuntu 16.04, see references below.

The qemu command line will look something like this to enable the opengl on guest systems.

qemu-system-x86_64 ... -display sdl,gl=on -device virtio-vga -vga virtio

To my very naive knowledge qemu on Ubuntu needs to be compiled with gtk3 or sdl2 and this is not the case. Ubuntu qemu binaries do not support gtk3 or sdl2, only sdl1.
Everything else seems to be OK, mesa, kernel and qemu all are the versions that should support opengl initial versions, it should be possible to run a linux guest OS with opengl.

<controller type='usb' model='nec-xhci'/>
<input type='tablet' bus='usb'/>


References


https://wiki.archlinux.org/index.php/QEMU
https://virgil3d.github.io/
http://www.spice-space.org/download.html
https://www.kraxel.org/blog/
https://www.kraxel.org/slides/qemu-gfx.pdf




Post a Comment

Popular posts from this blog

Ubuntu GNOME 17.04 running with HiDPI and touch screen support

Ubuntu GNOME 17.04 running with HiDPI and touch screen support








See my previous post on how to install Ubuntu on Yoga Pro 2 for Ubuntu GNOME 16.10.

I think Ubuntu GNOME is the best flavor of Ubuntu if you are running in HiDPI mode 3200x1800. All screen captured images are at HiDPI resolution.
Touch support Ubuntu gnome support for touch screen is pretty good on the desktop shell.
Chrome browser supports touch screen very well and much better than Firefox without any plug-ins.
The windows key on the screen panel works as the windows key on the keyboard.
Screen rotation is supported on the new gnome and disables the keyboard when the yoga is used as a tablet, side lock rotation button works to lock the screen in a certain rotation.



 What works Almost everything works great out of the box, there isn't many changes you need to do.
UbuntuGnome ships with gnome 3.24 and will boot with full resolution HiDPI and touch screen support enabled
Screen HiDPI supportBrightness, resolution keys, o…

Ubuntu 17.10 review. Running with hidpi, touch screen and wayland support

Ubuntu GNOME 17.10

I think Ubuntu GNOME is the best flavor of Ubuntu if you are running in HiDPI mode 3200x1800 with a touchscreen. All screen captured images are at HiDPI resolution.

Since I prefer the standard gnome-session experience, I installed the "gnome-session" package and rebooted the system. And on the cog icon next to the sign in button, select the "GNOME" instead of ''Ubuntu" option before clicking the sign in button.

sudo apt install gnome-session

Touchpad
I increased the speed, enabled "tap to click", "two finger scrooling". and on gnome-tweak enabled click method to "fingers".
Touch support Ubuntu gnome support for touchscreen is pretty good on the desktop.
Chromium browser supports touch screen very well and much better than Firefox without any plug-ins.
In my Yoga pro 2, the windows key on the screen panel works as the windows key on the keyboard.
Screen rotation is supported on the new gnome and disables …

Ubuntu 17.10 running on Lenovo Yoga 920 with HiDPI and touch screen support

I resized the windows partiton to the minimun necessary (100G), disabled secure boot and I also remove bitlocker key encryption on windows drive, this allows Ubuntu to see that partition and allow windows to boot with secure boot disabled, without complaning.

This makes everything go easier if you want to keep windows arround on the same disk and dual boot with Ubuntu, you should do this it helps a lot. Even after you disable this, you can re-enable it back, both secure boot and bitlocker key encryption.

Before installing on windows updates resize your windows partition, installing all windows updates will not alow you to gain as much space as possible. After resizing the windows partition to the minimium size you want, install all windows updates, bios and driver updates.

I upgraded all windows updates to the latest version and all drivers to the latest version and upgraded the bios on windows to the latest version before installing Ubuntu, I don't think this makes much differenc…