<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/L9j6-vpuSmY?si=-tmP8sotHIb3oUe0" title="YouTube video player" width="560"></iframe>
State of the linux desktop in 2023
Linux today have matured to the point where majority of activities commonly done by computer users can be achieved easily, especially considering most people are primarily using the computer to access internet applications. Even when it comes to gaming, thanks to Steam’s effort in Proton and Steam Deck, Linux is now a pretty viable platform for those who who are not playing competitive games.
People I know also have experimented with making purely non-technical people to use Linux without them knowing, with good success rate, while I myself have experimented with forcing my department staff to use Linux as their primary operating system with good success, to the point of the staff noticed that Windows is a pretty difficult platform to work with for modern day developers.
Libreoffice also is fully capable to do all common office tasks without issues, and with some training to leverage the features available in Libreoffice, the team also discovered how frustrating it can be when working with Microsoft Office especially when trying to structurally automate formatting. A simple tool you know how to use well is a magnitude better than a fancy tool that you only know how to use its basic feature. Libreoffice also opens Microsoft Office documents well with minimal issues, except for the usual missing fonts messing with documents a bit, which easily fixed by installing the fonts.
However, Microsoft Office dominance can be an annoying problem when working with clients that primarily uses Microsoft’s stack and refuses to accept or work with PDF. Microsoft Office also almost always open ODF poorly with regular corruption, while DOCX files saved by Libreoffice seems to almost always opened poorly by Microsoft Office.
Wine, while becoming a great platform to run games thanks to Proton initiative, is still quite flaky to run Office due to less community investment is put on the matter. The Wine AppDB page for Office generally reported garbage rating for Office 2016 and newer.
Windows Subsystem For Linux (WSL)
The frustration regularly faced by developers when working on Windows, and the dominance of Open Source in software development ecosystem to a degree threathened Windows, where developers preferring MacOS for their preferred desktop because of its Unix heritage and MacPorts.
In response to that , for a few years now, Windows introduced the ability to run Linux commandline seamlessly on Windows through their WSL feature which essentially runs a Linux VM on top of Windows, with seamless filesystem integration to allow access of files in the host by the guest VM. This to a degree allows developers to have access to their Linux tooling on Windows, alongside access to Microsoft Office.
WSL also shows that, with some clever virtualization tricks to integrate the host and guest, the experience of using VM can be pretty seamless to the user if done well.
Reverse WSL With QEMU, Libvirt, VirtIO & SPICE/RDP
For those who primarily use Linux as their daily driver and dealing with clients who are locked into Microsoft ecosystem (even rejecting Google Docs), the lack of Microsoft Office on Linux sometimes forces people to switch to Windows in order to get work done, which usually means a troublesome dual computer operation.
However little is known to most that Linux virtualization have also improved significantly over the past several years, where it is now possible to create a “Reverse WSL” that allows you access to Microsoft Office on your Linux desktop, complete with clipboard sharing and filesystem sharing, with near-native performance using QEMU KVM virtualization. Effectively allowing you to keep using Linux as your primary operating system, while still getting access to Microsoft Office without having to dual-boot or lugging two computers around.
This guide will help you set up your computer with a highly fine tuned VM of Windows 11, alongside customizations needed to make integration seamless between the two operating systems, so that you can get benefits of both worlds on a single unified dual operating system experience.
This guide assumes that you have at least 4c/8t CPU with 16GB of RAM, and you are using Fedora as the primary operating system. Any other Linux distro should work too, but this guide focuses on Fedora.
You may want to use Windows 10 Pro or Windows 11 Pro as I found RDP local cursor give a better experience compared to SPICE. RDP is only available on the Pro edition of Windows.
Setting Up The VM
You will need to install and use QEMU and Libvirt for your virtualization, as VirtIO comes with it.
$ sudo dnf install virt-manager libvirt-daemon-kvm -y
$ sudo systemctl enable --now libvirtd.service
For near-native performance, we will be using VritIO to improve both disks, network and graphics I/O, which means, the VM creation process would be slightly different.
The first step is to start up Virt Manager, and before starting with installation, you will need to enable XML editing at Edit > Preferences
Then, create a new VM with at least 2 cores, and 8GB of RAM (you can enable ballooning later). Make sure that you check “Customize configuration before install” option at the final step of VM creation.
At the customization page, you will need to configure the following:
<vcpu placement="static" cpuset="2,3">2</vcpu>
<vcpupin vcpu="0" cpuset="2"/>
<vcpupin vcpu="1" cpuset="3"/>
This will pin the 2 CPU to physical core 2 (third core) and core 3 (fourth core) of the base host, minimizing competition with the main operating system running at core 0 (first core) and core 1 (second core)
You can view which core tied to which cpuset by running
cat /proc/cpuinfo |egrep -i 'processor|core id'. From the output,
processor is the cpuset id, while
core id is the physical core id.
Set SPICE port. Note that we keep video to QXL as VirtIO video is only supported on Linux guests.
Change default disk to VirtIO bus
(Optional) If you will only have 1 windows VM, you may want to use TPM passthrough.
Add VirtIO driver ISO image as another SATA CDROM. You will need it to load VirtIO driver
You can get VirtIO driver ISO image from Fedora here: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Configure HyperV enlightenment.
Set the configuration to:
<spinlocks state="on" retries="8191"/>
Enable shared memory (this is needed later for filesystem sharing)
Add filesystem sharing to your Home directory
- Then click Begin Installation to start installation.
When at the disk selection you will see that there are no disk to select. This is because Windows does not carry VirtIO disk drivers by default. You will need to load the driver from the secondary CD drive.
Then proceed the installation as you would normally
On first boot , to improve performance, disable all telemetry monitoring
Setting up Windows
After successful installation, you will need to then install the rest of VirtIO drivers, VirtIO guest tools, and WinFSP to further improve host-guest integration and improve user experience.
Install VirtIO drivers
Install VirtIO guest tools
Install WinFSP & Enable VirtIO FS
WinFSP (https://github.com/winfsp/winfsp) provide capabilities similar to FUSE on Windows, which allows mounting of userspace filesystems. It is required in order to mount VirtIO shared filesystem as a drive in Windows. Download and install it, then enable VirtIO FS by enabling the following service in the Services app.
If enabled correctly, you will see that a new drive Z:\ appeared that links to the Linux host storage
(Optional) Then, enable RDP
Afterwards, shutdown the VM, as we now need to switch the network to VirtIO. Open the VM properties and ensure that NIC is switch to VirtIO
Now you can start the VM back up.
Connecting to VM
To connect to the VM, I recommend to use Remmina
$ sudo dnf install remmina remmina-plugins-spice -y
Launch Remmina, then you may want to disable the fullscreen toolbar in Remmina preferences for added seamlessness
SPICE is the default remote connection protocol for QEMU and is generally recommended if you just need basic capabilities.
You make sure you use QXL driver. If you are using SPICE with Virtio video driver, you may experience mouse lag on slower computers.
On Wayland on my F37, SPICE also behave weirdly after Alt+Tab when put in full screen mode, where it behave as if Alt/Ctrl
is always pressed until you leave full screen.
If you face above issues, then use RDP.
To connect to SPICE, use following settings
- Protocol: SPICE
- Basic tab:
- Advanced tab:
- Preferred video codec: VP8
- Preferred image compression: LZ4
- Enable audio channel
Click Save and connect., and you now have connected to the VM and can use it.
Switch to full screen view for seamless display. You will need to set resolution to match your monitor resolution.
Optionally, for better display performance with this method of connection, launch Performance app and configure
it for best performance.
I recommend using RDP because it uses local cursor and suffer less mouse lag compared to SPICE. You also have
better control on display peformance tweaks on the client side, however, it might not perform that well for videos.
To connect to RDP, use following settings
- Protocol: RDP
- Basic tab:
- Server: IP Address of the VM
- Username: Windows login username
- Password: Windows login password
- Resolution: Use client resolution
- Network connection type: LAN
- Advanced tab:
- Quality: Medium/Good
- Gateway transport type: RPC
- FreeRDP log level: ERROR
- Audio output mode: Local
Click Save and connect., and you now have connected to the VM and can use it.
Switch to full screen view for seamless display.
Optimization & Tuning
For less CPU and RAM usage, you may want to also do the following:
- Uninstall Microsoft 365
- Uninstall Microsoft Teams
- Uninstall OneDrive
- Uninstall ClipChamp
- Uninstall Microsoft Todo
- Uninstall Microsoft News
- Uninstall Xbox related packages
If you are on GNOME and is used to use top right hot corner for window switching, you may also want to install Winxcorners, and set top left corner to open Task View.
I recommend setting the VM wallpaper to match your main desktop wallpaper.
Windows-on-Linux virtualization have improved significantly today that it is possible to run Windows VM with minimal impact on performance. Open Source RDP
clients also have catched up quite well in bringing smooth integration of audio and clipboard with remote Windows connection that it become pretty seamless to use
Windows applications through RDP, especially for work related applications such as Microsoft office. VirtIO FS in the other hand makes disk integration experience
almost as if you are using Wine.
Using this method, one more barrier of adoption of Linux as primary operating system is solved as it is relatively seamless to work with documents in the VM, that
it barely feel like Microsoft Office is running in a VM.