For my Windows workloads on Linux, I've been paying VMWare for years for their Workstation product so I can run Windows programs like Visual Studio and Quicken. Recently, having some issues with my Windows VM (VMWare using massive amounts of memory and CPU beyond the VM allocation, and causing random latency on my desktop), I thought the time was finally right to try out virsh and KVM again. Converting the VMWare image to KVM worked flawlessly via `qemu-image convert`, and then after a whole bunch of hassles getting the right virtio drivers and guest agent installed and working, the VM is running great. It's running flawlessly, just as fast or faster than my VMWare image, and way more efficient on memory and CPU. And I don't need to taint my kernel to run it.
I do have some follow-up questions though:
1) It seems the networking is not quite as straightforward as VMWare for a single-VM use case. VMWare can run the VM in bridge mode, so that it appears to the rest of my LAN as just another PC. Host-guest, and guest-other networking works perfectly. In contrast, in virsh, it looks like none of the 3 options are as transparent: https://wiki.libvirt.org/page/VirtualNetworking. Running in the default NAT mode, I have two issues:
a) My guest DNS does not transparently work to access my LAN -- only the Internet. The docs @ https://libvirt.org/formatnetwork.html do not provide any guidance for configuring DNS settings. I want to forward requests to the dnsmasq running on the host system.
b) What is the best way to configure my host system to be able to see the NATed IP addresses in the virtual network?
(Fedora 27, fully updated)
Thanks! Raman
a) My guest DNS does not transparently work to access my LAN -- only the Internet. The docs @ https://libvirt.org/formatnetwork.html do not provide any guidance for configuring DNS settings. I want to forward requests to the dnsmasq running on the host system.
Oops, looks like this one was easy: a <dns> element as per https://libvirt.org/formatnetwork.html#elementsAddress.
On Wed, 14 Mar 2018 22:20:07 -0000 Raman Gupta wrote:
Running in the default NAT mode
I always use the "bridge" networking. That way the KVM looks like just another machine on my local network, gets an IP from the DHCP on my router, etc. And I can delete the "default" network and turn off all the extra junk NAT mode makes libvirtd start (dnsmasq and such).
The one thing KVM can't do (yet anyway) is 3D accelerated video (I occasionally look for information about the one or two projects working on it, but the last I saw they were still very much works in progress).
On Wed, 2018-03-14 at 18:51 -0400, Tom Horsley wrote:
On Wed, 14 Mar 2018 22:20:07 -0000 Raman Gupta wrote:
Running in the default NAT mode
I always use the "bridge" networking. That way the KVM looks like just another machine on my local network, gets an IP from the DHCP on my router, etc. And I can delete the "default" network and turn off all the extra junk NAT mode makes libvirtd start (dnsmasq and such).
The one thing KVM can't do (yet anyway) is 3D accelerated video (I occasionally look for information about the one or two projects working on it, but the last I saw they were still very much works in progress).
I do that literally every day, for Windows gaming. It took some effort to set up but it works a treat. A good starting point is:
https://vfio.blogspot.co.uk/2015/05/vfio-gpu-how-to-series-part-1-hardware.h...
Also the VFIO mailing list at https://www.redhat.com/mailman/listinfo/vfio-users
poc
On 03/14/2018 04:17 PM, Patrick O'Callaghan wrote:
I do that literally every day, for Windows gaming. It took some effort to set up but it works a treat. A good starting point is:
https://vfio.blogspot.co.uk/2015/05/vfio-gpu-how-to-series-part-1-hardware.h...
Also the VFIO mailing list at https://www.redhat.com/mailman/listinfo/vfio-users
That requires a separate video card. There is some work on doing passthrough 3d which I think is supposed to be working, but only for X (maybe Wayland?), because there's no driver for Windows.
On Wed, 2018-03-14 at 16:57 -0700, Samuel Sieb wrote:
On 03/14/2018 04:17 PM, Patrick O'Callaghan wrote:
I do that literally every day, for Windows gaming. It took some effort to set up but it works a treat. A good starting point is:
https://vfio.blogspot.co.uk/2015/05/vfio-gpu-how-to-series-part-1-hardware.h...
Also the VFIO mailing list at https://www.redhat.com/mailman/listinfo/vfio-users
That requires a separate video card. There is some work on doing passthrough 3d which I think is supposed to be working, but only for X (maybe Wayland?), because there's no driver for Windows.
Yes, when I said "some effort" that was what I meant, plus a fair amount of configuration, including isolating the card from Linux so it doesn't compete with the VM. Currently I don't see much prospect of full 3d video passthrough given that video cards are separate processors with (often) proprietary drivers that don't expect the video context to change arbitrarily under their feet and don't provide a way to snapshot their internal state (this applies to Windows too, even on bare metal, which severely limits hibernation when using GPU drivers). It's going to take a lot of industry effort (maybe via Vulkan, though I'm reaching here) for this to work in the future.
poc
On Wed, 14 Mar 2018 18:51:00 -0400 Tom Horsley wrote:
On Wed, 14 Mar 2018 22:20:07 -0000 Raman Gupta wrote:
Running in the default NAT mode
I always use the "bridge" networking. That way the KVM looks like just another machine on my local network, gets an IP from the DHCP on my router, etc. And I can delete the "default" network and turn off all the extra junk NAT mode makes libvirtd start (dnsmasq and such).
I also use bridge. Another solution could Open vSwitch be. It's included since 3.x in the kernel, but haven't used it yet. Libvirt doesn't support it I think. [1]
[1] http://docs.openvswitch.org/en/latest/howto/libvirt/
On 03/14/2018 03:20 PM, Raman Gupta wrote:
- It seems the networking is not quite as straightforward as VMWare for a single-VM use case.
It can be. If you want to used bridged networking, you have to create a bridge in Linux. KVM doesn't handle that internally (which is to say, it doesn't duplicate functionality that exists in the OS).
If your existing Ethernet interface is "eth0", you could create the new bridge interface by running this command as root:
virsh iface-bridge eth0 br0 --no-stp