News for hackers. Stuff that matters.
Re:Looking Glass: Run a Windows VM on Linux in a window with... by thejosh on Saturday July 17, 2021 @11:35PM (#27870603)
It performs really well.

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).

Re:Looking Glass: Run a Windows VM on Linux in a window with... by qalmakka on Sunday July 18, 2021 @04:09AM (#27871485)
It's QEMU and the kernel that do the magic - libvirt is actually kinda annoying and ill suited for these things, you have to edit lots of unnecessary XML just to change launch options for QEMU.
Re:Looking Glass: Run a Windows VM on Linux in a window with... by vbarrielle on Sunday July 18, 2021 @03:06AM (#27871229)
That sounds very interesting. Does that mean I should be able to load a VM containing my windows partition fron linux, even without a dedicated GPU? Do you have a pointer to a tutorial explaining the setup ?
Re:Looking Glass: Run a Windows VM on Linux in a window with... by stableviper on Sunday July 18, 2021 @04:56AM (#27871620)
Yes, I can confirm that this works. I have one windows installation and can either directly boot windows on the host or start it within Linux with VFIO.
Re:Looking Glass: Run a Windows VM on Linux in a window with... by TheFreim on Sunday July 18, 2021 @08:15AM (#27872286)
Do you know where this is documented? This would be very useful to me.
Re:Looking Glass: Run a Windows VM on Linux in a window with... by sfink on Sunday July 18, 2021 @11:59AM (#27873986)
I wrote a `viewsetup` tool for setting up a /dev/mapper device (and VMDK file pointing to it) that I use for exposing a set of native Windows partitions while masking off the active Linux partitions. It's enough to allow booting Windows natively or in a VirtualBox VM using the same partition. But the steps to create backing files, run dm-setup to create the /dev/mapper device, and create the VMDK are all separate, so you ought to be able to use this with any virtualization tool.

I sort of have it documented at https://github.com/hotsphink/sfink-tools/blob/master/doc/Vir... though that's really a set of instructions intended for a new PC that a bunch of us at my employer recently received. You just want the `viewsetup` stuff. You probably want to leave off the `--auto` flag, so that it'll prompt you per-partition.

The tool goes to some effort to only expose the specific partitions needed. It also makes the virtual disk exactly match the native disk, copying small partitions (and gaps between them) to files and exposing those over loopback interfaces, so that Windows can go crazy and write over everything and it won't break your Linux setup. (The Linux partitions themselves are exposed as loopback devices to empty sparse files of the right size.)

Get the single script file at https://hg.sr.ht/~sfink/sfink-tools/raw/bin/viewsetup?rev=ti... or check out the full repo at either https://hg.sr.ht/~sfink/sfink-tools/ (mercurial) or https://github.com/hotsphink/sfink-tools (git). I keep both up to date.

Re:Looking Glass: Run a Windows VM on Linux in a window with... by TheFreim on Sunday July 18, 2021 @12:07PM (#27874045)
Thanks! I will test this out later.
Re:Looking Glass: Run a Windows VM on Linux in a window with... by josteink on Sunday July 18, 2021 @03:45AM (#27871380)
> That sounds very interesting. Does that mean I should be able to load a VM containing my windows partition fron linux, even without a dedicated GPU?

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.

Re:Looking Glass: Run a Windows VM on Linux in a window with... by b9a2cab5 on Sunday July 18, 2021 @01:07PM (#27874561)
How is the IO (particularly random IO) performance in Windows? In my experience that's been where VMs still have a long ways to go. Even kvm2 Linux on Linux VMs have severe IO performance deficits compared to native.