Giter VIP home page Giter VIP logo

vfio-void-linux's Introduction

vfio-void-linux

My kvm / vfio / libvirt / qemu config for a Void Linux host, Windows 11 guest.

Hook scripts are useful as a whole for other Linux guests if dedicating the entire second display to them. Bits might be used in other circumstances.

The objective: make starting and stopping Windows feel like starting any X app and restore my multi-monitor dwm desktops afterwards.

Hardware Config

Most modern hardware these days supports the necessary CPU and IOMMU features; there are plenty of tutorials out there on how to configure a system. For the record I'm running desktop workstation on:

* Host OS: Void Linux
* Board: Gigabyte X570 AORUS MASTER, BIOS F35b 09/06/2021
* Intel (for host) and Realtek (passed through) NICs
* CPU: AMD Ryzen 7 3800X 8-Core Processor
* Mem: 62GB (32GB allocated dynamically to VM as transparent hugepages)
* Host GPU: Radeon RX 5600 OEM/5600 XT / 5700/5700 XT
* Guest GPU: GeForce GTX 1660 SUPER
* Host SSD: Sabrent Rocket 1TB (Phison Electronics Corporation E16 PCIe4 NVMe)
* Guest SSD: (for Windows only) Sabrent Rocket 1TB (Phison Electronics
  Corporation E16 PCIe4 NVMe)

Mouse and Keyboard Sharing with barrier

Barrier barriers runs as a server (started and stopped in the hook scripts); allows for transparent mouse and clipboard use between the host and guest; you can even add a non-VM client like a laptop or other desktops if you like. My dotfiles repo shows an example config.

Leave a virtual console attached to your new Windows VM so you can set up the Barrier client.

Audio Return to Host

Via pipewire - see the top and bottom of the VM definition in windows.xml for the relevant incantation; in your qemu.conf set user=.

Hooks

I've generalized my setup with a few variables in kvm.conf; you may find dropping these in may work for you with just a little tweaking.

There's also https://github.com/PassthroughPOST/VFIO-Tools/blob/master/libvirt_hooks/hooks/switch_displays.sh linked appropriately to have ddcutil switch the display inputs between host->guest and back to host when the VM shuts down. That in combination with xrandr sets my dwm displays back to normal, achieving "starting Windows like an X app" convenience.

Some assembly will be required:

# clone this repo, somewhere
cd ~
git clone https://github.com/solutionroute/libvirt-win.git

# link to the hooks directory in the appropriate libvirt
# path for your system
cd /etc/libvirt
sudo ln -s ~/libvirt-win/etc/libvirt/hooks .

It's important that commands within your hook scripts don't fail with an error; this will cause startup to halt and the release scripts to be called.

Testing tip: you can run your hook scripts one by one from the command line in this manner:

/etc/libvirt/hooks/qemu windows start begin

vfio-void-linux's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.