843 points · by tambourine_man · 5y ago · 303 comments
The #1 thing that I've ever wanted is a Linux that lives between the bootloader and Windows that lets me achieve native performance on the Windows VM, but gives me an environment where I can easily do all the things that you can usually do in HyperV like create snapshots, clone installs, share Sharepoint drives between images, etc. But I do need something that is perfectly stable and just works. This is the right technology (thank you so much for working on it), but just not yet at a maturity that makes me feel comfortable about putting livelihood on the line.
Edit: actually, please, if anyone knows something that suits this use-case, even if it costs decent money, please leave a comment.
If you want a low-maintenance version, you could just snag someone's NixOS config - you'd have an easy to reproduce environment that just ensures virt-manager and a really light-weight window manager are installed and then you're done.
Virt-Manager does shared directories (9p anyway; there's no UI for virtio-fs, but you can still use it by editting XML). It handles USB2 and USB3 forwarding. It does snapshots, it does clones, you can even leverage Linux filesystems to do far fancier things than possible on HyperV hosts. Etc. (Plus KVM won't trash your plain ole EXT4 partitions like countless people keep reporting under HyperV [and I've personally experienced twice]). It can even do graphics accceleration/virtualization for Linux guests.
Virt-Manager is so under-known and under-appreciated, but then again, it's got its rough-edges. With some polish there is really no reason to ever mess with VBox under Linux.
You could even skip zfs and just use a qemu image file, with qemu-nbd you can have it present as a block device, and you can then export that block device as an iscsi target. Then you can use qemu-img for snapshotting etc.
The machine running the storage could be pretty low spec too, a nuc would do it for sure, maybe even an rpi or similar (if you go the qemu-img route, zfs on rpi is not feasible, ask me how I know :D)
If you're working on a laptop I would not recommend ZFS, ZOL doesn't implement freeze and thaw.
1: https://www.dell.com/en-au/work/shop/workstations-isv-certif...
Debian is super reliable - potentially the most reliable linux distro - but this wouldn't be a turnkey solution or anything (for example PopOS, based on Debian via Ubuntu, focuses more on the out-of-the-box experience). I don't know if Debian can handle your particular needs, but my assumption is that if any distro can Debian can - it just might take some time.
Personally I love proxmox as a main operating system, as I can get everything from broader Debian/Ubuntu/PopOS environments and learn a lot about Linux too. But, it has taken a lot of my time, so I'd only recommend it if you wanted to invest the time.
Any modern virtualization has very fast CPU virtualization (it's hard to say near-native, as there are always corner cases), and snapshotting tools. I don't know about Sharepoint; the "clone installs" is a bit fuzzy too, but one can clone installed systems by just copying the underlying image file and ensuring that it has a unique identifier (and updating the guest O/S license, if required).
If GPU matters, VFIO definitely is part of the solution.
However, if you're trying to achieve a sort-of full system passthrough (eg. because of drivers that have bugs related to certain hardware components, which it seems to be your situation), this will never happen, because certain parts of the guest need to be necessarily emulated (e.g. chipset). Even passing a USB port is not easy - one actually needs to pass the whole hubs (AFAIK a port may belong to two hubs - USB 2 and USB 3).
What needs to be kept in mind is that, as the standanrd passthrough, it's subject to the IOMMU groups handling (in best case, there's no other device in the same group; otherwise, one needs some trickery, which AFAIK is not 100% guaranteed to work).
I just build the price of the hardware into my hourly rate (which ends up being not very much .. $2 per hour), AU law instant write-off the cost of the machine as tax, tell them they don't need to buy a machine (which they are very happy about), and then everyone is surprised at how fast I can get the job done compared to the in-house teams which have their hands tied.
i have my own custom build servers at home now and virtualize everything. every client has own VM and I usually RDP/ssh into them for work.
https://forum.level1techs.com/c/software/lookingglass/142
Level1Techs also has a ton of information and help both on the forum, and their YouTube channel, about setting up Looking Glass and VFIO. The main host of the YouTube channel, Wendell, has forgotten more about nitty-gritty system administration than I will likely ever know in my lifetime. He also just seems like a genuinely good human being.
Also, didn't know that any 4 letter usernames were available here on HN anymore :)
It's difficult to set up right but it taught me a lot about VMs and hardware. Once you get it setup well enough, its relatively painless. Like I haven't messed with my VM settings in over a year, everything just continues to work smoothly. Including windows updates, driver upgrades, most online games with anti-cheat etc. If i upgrade my hardware, it might take a day or two of tinkering to get it back up. Based on my benchmarking it runs within ~5% of native perf.
This is still the best guide IMO if you want to set it up - https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF. Single GPU is basically the same as dual GPU, except you have to ensure the linux host does not take over the GPU or load any drivers for it during boot.
I have a Windows VM for gaming that owns the single Nvidia GPU. I also have a few Linux VMs for development (via VS Code remote) and media management.
As far as storage goes, I don’t have anything too fancy. Proxmox is installed on an SSD. I have a second SSD for VM images. For all other storage (media, photos, VM image backups, etc.), I have a 3 disk ZFS pool consisting of a single RAID-Z1 vdev - yea, it’s risky, but losing the pool wouldn’t be the end of the world.
One of the cool things about this kind of setup is being able to easily restore VMs from backup. Some time back, I accidentally screwed up my Windows install by enabling Hyper-V (nested virt). I panicked at first, but then remembered that I have daily snapshots of the VM. I had it back up and running within 10 minutes :)
All in all, it was fun to setup and has been running very smoothly.
* Are the VM image backups you mentioned, done to your pool by means of the ZFS snapshots? Or done at the file-level with rsync or similar.
* Do you make backups of the Proxmox installation? Similar as before: is Proxmox itself on a ZFS volume, so backups can be done just by doing ZFS snapshots? The installer lets me choose between an LVM-Thin + ext4, or a ZFS filesystem, and I was wondering whether to choose one or the other, for maximum convenience.
* "Proxmox is installed on an SSD": isn't that a bit wasteful? I mean, doesn't the Proxmox system just take like 1 or 2 GB at most?
I have a Lenovo ThinkCentre m910q which brings a 160GB M.2 NVMe disk, and another 320GB SSD disk... so I an in the process of deciding where to put each thing. Although for bigger storage I'm also considering if adding a 1 or 2 TB USB3 external disk would make sense (to store user backups like photos, documents, and also for the server's system backups)
2. No, I do not currently backup the Proxmox config. There is a good script here: https://github.com/DerDanilo/proxmox-stuff
3. If you install Proxmox on a "thin" filesystem (ZFS or LVM-Thin), then yes, you will get snapshot functionality for free. Note that you would have to configure this yourself - Proxmox does not expose a backup feature for its own config.
4. I have two NVMe SSDs. The first is 500GB and is split into two partitions: 100GB for the Proxmox install (LVM + ext4), and 400GB for VM images and containers (LVM-Thin). The second is 900GB and is fully used for VM images. Both are using LVM.
Any notable exceptions?
What's the performance like compared to the same games in a native Windows install. I tried proton several months ago and I had to go back to Windows because it wasn't even close to good enough as far as compatability goes.
I'd really love to abandon Windows as a desktop OS and just game in a VM though.
They banned the use of virtual machines [2] back in 2020 and their AC solution does not work on Linux.
Valve seems to be working on it [3], though their solution might be tailored to their SteamDeck hardware instead of a generic proton fix.
[1]: https://www.battleye.com/ [2]: https://twitter.com/TheBattlEye/status/1289027672186720263?s... [3]: https://partner.steamgames.com/doc/steamdeck/faq
Or go full Unix and attach a serial terminal to the console port and happy linuxing from there while you ignore the built-in gaming console running off a VM. This is more or less what every modern console does anyway - a hypervisor under everything. ;-)
The last time I checked, many such games explicitly do not support running in VMs and you risk being banned by obfuscating that you are running the game in a guest OS.
TBH every thread like this has the “but what about anti-cheat?” post which makes it seem like a big problem but i think only a tiny minority of games don’t work under VMs.
So... 5% of the available titles?
Most are financed by IAPs so I just stay away from them anyway.
FWIW I tried to install Valorant in a VM recently (because I'm tired of installing the root-kit anti-cheat on my main PC in order to play it). It simply fails to launch the anti-cheat, and so doesn't launch the game.
Known to work without issue are titles such as
* PUBG
* Battlefield 1/3/4/5
* Titanfall 1&2
* Arma 3
* 7 Days to Die
* Ark
* Fortnite
* Apex
* Halo: The Master Chief Collection
* Star Wars Squadrons
And many many more.It's the only thing I am missing to build another one or rebuild the one I have. I wish I had believed it was going to work perfectly when I started and wrote everything down.
+1 on the writing stuff down :D I did it twice and documented pretty thoroughly the second time around, notes before each change, testing performance delta, notes about if it worked. It really helps.
[1] https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#CP...
There was an issue with AMD systems a few years ago, which caused microstuttering.
The Arch wiki is indeed spectacular.
E.g. could you run a high end DAW on the guest with the same performance?
If not, is it something that might be added later?
Kind of defeats the point if your UI becomes windows again in my opinion.
My personal motivation is that Linux power users will miss the control, or at least, customizability, of the operating system, which is something Linux does, and Windows doesn't (as they have different targets).
Also, not to be underestimated, security (although for me it's only a very small factor).
Why are VMs being blocked?
The solution though is not to ban VMs, but to push vendors like AMD and Intel to enable access to, and enforce usage of technologies like SEV if running inside a VM.
https://www.kernel.org/doc/html/v5.6/virt/kvm/amd-memory-enc...
Would that be OK?
I ask because many laptops used to have similar setups.
I would say the use case here would be a machine that does not have a monitor connected, for example some Bitcoin mining server in the attic. With Looking Glass the game screen can get streamed to a ultrabook in your living room, with the server GPU performance
There was this recent improvement at least: https://phoronix.com/scan.php?page=news_item&px=Linux-5.14-A...
edit: seems there are some howtos - eg https://github.com/joeknock90/Single-GPU-Passthrough
Setting up looking glass itself wasn't much of a problem though. I got some AAA games cutting on my gentoo laptop like butter, though the mouse movement was more jelly unless I VFIOd my mouse/kb as well. Sound went through Scream over a socket.
Nowadays I play on my Xbox. I ditched gentoo. I've gotten old. Do you, reader, assume that I've also checked out and gone full windows?
If you do, then guess again. I'm about to port my whole gentoo gaming setup to NixOS and it will probably take me about 15 minutes, and ~ 5 - 10 minutes a year just to maintain. How much time do you spend fiddling with your windows and driver updates? Oh, wait...
0: https://old.reddit.com/r/VFIO/comments/ebo2uk/nvidia_geforce...
Also proton doesn't address the myriad of productivity applications that people still need windows for, such as Adobe products, or Autocad, etc.
I love qemu/libvirt - the crazy thing is if you have two disks and use one to boot Windows, you can mount the disk then boot into that when using Linux and have that running off another video card (I have two in my PC, one AMD and and nVidia).
That works fine.
I do that at work to avoid nuking/tampering with the Windows installation provided to me by IT, while running Linux as my main OS from a second volume.
It's how I "gamed on Linux" for a couple years. Support is basically you and you alone. The dev for Looking Glass is active but the man isn't your personal tech assistant so often you're just doing A/B testing to make something work.
For me, I just didn't want to fiddle with my home desktop that much. I went back to Windows.
I wouldn't recommend VFIO just for gaming, there are better options.
I use it for gaming, software dev, and just in general it's nice to be able to switch OSs for any reason instantly. What better options are there?
What options? I'm interested.
It's only that if you wear a fedora unironically and have a Slashdot account with a four digit user ID.
The caveats are basically:
1. Setup is a bit annoying
LG can feed input into any VM but requires guest support for capture, so you need to do the setup with a direct monitor.
2. The passed-through card must have a monitor connected.
IIRC, this is an API issue since it just captures what would go to that monitor.
3. Some things are only visible on the real monitor.
They need different capture strategies for the regular desktop, system desktops (such as lock screens), and secure desktops (UAC prompts). Sometimes the transition fails, sometimes there is no strategy implemented for what you're trying to show.
4. Your CPU and motherboard must support IOMMU passthrough.
For Intel this means using Skylake+ and ensuring that it supports VT-d. For AMD this means using Ryzen with an X-series motherboard.
5. You need separate GPUs for the host and guest.
Blame GPU vendors for making VT-g an enterprise-only feature.
1. We are working on it
2. Not if it's a vGPU or a Quadro where EDID spoofing is allowed
3. No, we capture everything now, even the windows Login screen and windows updates, etc.
4. Yes
5. Very yes!B3 and B4 both have pretty huge improvements here, but there are still a few rough corners. For example, when logging out the host shuts down immediately upon request, so you can't see the "program X is blocking shutdown" dialog.
But ultimately this is a very minor papercut for a very impressive and useful project.
Regarding this, I don't know about LG, but with a standard QEMU VFIO setup, one use a single monitor connected to the two cards, and switch the input when required.
Just note that not all multi-input monitors are equal though, a small minority appear to the GPU as unplugged when the input selection is changed.
I mantain a guide for setting up VFIO (https://github.com/saveriomiroddi/vga-passthrough), which I frequently use.
My conclusion is: for machines that are compatible with it, VFIO works very well. The technology itself is stable, so working on photoshop/game development etc. (from a technological perspective, there's no distinction between the two tasks) is not distinguishable from working on native.
I had VFIO on 4 machines I think, and one had problems which I couldn't solve, while the others worked well.
When used with QEMU, it requires some system settings and QEMU flags etc., so it's a bit annoying, but it's straightforward and documented process.
To put it in another way: if one wants to use VFIO seriously, it's best using hardware known to work well, rather trying to cram VFIO on a not very compatible system.
And also: one needs to be pratical. A USB soundcard solves countless hours of attempts to use the host's Pulseaudio system (meh).
After that it kind of just works, and continues working. I use it to play games and run Office apps, and have not had it break on me in a ~year of use. (Disclaimer: I occasionally contribute to the project now, but remember being impressed at how easy it was to get going when I first tried it out. Getting the VM working at all was the hardest part of the endeavor, but only took a few hours.)
To go into detail: are monitor color calibration from Linux (is that even existing) and Windows conflicting here?
Just a warning to readers that it's not the same company :)
Except gaming I personally don't see what prevents me from being "linux first". I'm just using windows 10 by habit and laziness.
What is your experience? What makes you still need windows? It's weird because there are so many software alternatives that run on linux and also many initiatives that allow one to be run on linux via emulators and whatnots.
For both work and casual use, there's a lot of small things that add up to it being very productive, and despite regularly giving the linux desktop a chance, I always gravitate back to Windows (and recently MacOS as well).
I feel like most of the QoL features I enjoy are mostly invisible so its hard to remember them unless I'm actually experimenting with the Linux desktop. Here's some that do come to mind though.
- Windows supports right-click and drag with context menus. For multi directory file manipulation, this shortcut is shockingly useful. While much file manipulation can be faster on the CLI, certain operations like this are incredibly efficient.
- Binary blobs are really convenient compared to package managers/source building for my daily driver stuff. I have decade old games that just work, and I've never had to deal with version incompatibilities for my tooling, unlike in my Linux environments.
- Common actions like sleep/wake just seem to work better.
- Microsoft Office is really nice.
Like, currently I dual boot into Windows for games, but I can also get into it from Virtualbox if I need to quickly use something on there.
Would I be able to use this with that? So I can use the internal GPU for my local Linux install, and then use the nvidia for the windows?
As a sibling comment stated, you can get a dummy monitor plug on Amazon for like $5 which fools your GPU into thinking there's a monitor attached.
In nutshell, KVMs aren't worth their money because they have to re-implementing a lot of hardware already found in your PC.
Is there anything similar in the works for a Linux-on-Linux scenario? My usecase is gaming without the host needing the proprietary nvidia crap (pass-through of the nvidia card for doing CUDA stuff in the guest already works great, but that doesn't help for e.g. Steam games).
This would include snapshot, switch systems, and something like snapshot and fork the running system.
We were using and had the name before they announced their product. If you want to get really finicky, you can ask why we are using the same name as Sun's Looking Glass desktop environment.
As for how viable it is, very... we have many members in our community that are using LG for productivity applications. For performance, very close to bare metal. In applications like Photoshop and Office you wouldn't be able to tell the difference.
Is the key feature clipboard sharing? Otherwise I don't know why I wouldn't redirect events with zero additional software. As-is, I press both ctrl keys and my keyboard and mouse switch to the virtual machine. The big nuisance is that I need to switch monitor inputs. That appears to be something I can automate, but simply haven't yet.
Any quick links to how that differs from a regular QEMU/KVM setup?
Totally stable - 8hrs per day over the last 16 months with 1 hiccup - and no performance complaints. I'm not doing anything graphically intensive though so virtual display hardware isn't a bottleneck.
Most of my gaming is just Proton on the host system these days.
Have a look here for a guide on Archlinux : https://wiki.archlinux.org/title/Intel_GVT-g. And here for a script to deploy macOS on KVM : https://github.com/kholia/OSX-KVM.
Side-note : vfio-mdev can now be unlocked on consumer-grades Nvidia cards too : https://github.com/DualCoder/vgpu_unlock. Sadly, it is not possible for AMD-cards.
By the way, I am working on Phyllome OS (https://phyllo.me/), which is an attempt to make it easier to do such things. But please don't tell anyone :)
1) It's not a signed executable (FOSS project, signing is a PITA without corporate sponsorship)
2) Microsoft Defender flagged the exe for wanting admin privs
3) Google were dumb and flagged us because MS did
4) All other AV vendors flagged us because google flagged our website.
We had to put the exe into a password protected zip to stop Google flagging us as we couldn't convince the idiots (robots) there that it was a FOSS project with all sources available for review.Feel free to help us out and report the false positive to your AV vendors! :)
This is how I "gamed on Linux" from 2018~2020 when I ran Ubuntu as my primary OS. It's incredibly finicky to set up (shocker, I know!) but if you're able to get it working it's truly amazing. Talking like 1% performance loss in AAA games in that virtual machine on the GPU.
As for me, I abandoned Ubuntu (and Linux, I did try other distros!) in early 2020. I was tired of juggling my home setup just to relax. In a move unpopular with the Slashdot crowd from 1996, I went back to Windows as my host OS.
No one is making user software with VFIO in mind. You will get random apps that do not launch in your virtual machine despite everything else running smoothly.
You're screwing with it near daily, certainly weekly. Need to update a driver, such as your GPU on the virtual machine? May god have mercy on your soul that everything works after, or that you can even get the host OS to deal with the GPU correctly at all.
I can sort of tell you haven't really read up on one of these setups because you seem incredulous that running Windows inside Linux is somehow finicky.
It's not ready for prime time, period.
This can however change as Steam plans to use SteamOS (based on Arch) as their primary OS on the SteamDeck.
> Just use Windows. Install games from developers directly.
See how silly that sounds to you ?
P.S. Disk I/O can be a severe bottleneck on HDDs, so try this with a SSD.