libvirt
Last updated
Last updated
Setup .
To keep my libvirt setup outside of any boot environments I give them their own dataset.
Add to fstab
Check modules are loaded.
If blank, .
Install the dependencies.
KVM/QEMU
Network
Nat/DHCP
bridged networking
UEFI
Frontends
I like to use ZFS ZVOL's as my backing store.
Create a dataset for ZVOLs:
Create a dataset for user 'john''s ZVOLs
To let guest do its own caching, use:
primarycache=metadata
Create ZVOL for a new VM. Replace with name. Volumes still need to be created by root.
If you want passwordless authentication, as of libvirt 1.2.16, anyone in the libvirt
group can access to the RW daemon socket by default.
Create the group if it doesn't exist.
Add any users required to it.
Make sure to re-login after.
Enable libvirtd.service.
To run only a user-session the daemon does not need to be enabled.
Test libvirt system-session:
Test libvirt system user-session:
Add the following to /etc/libvirt/qemu.conf
.
I have found UEFI may not work if I haven't set the system user to user = root
in /etc/libvirt/qemu.conf
.
and restart libvirtd
To use uefi as a user, note networking options are limited, move the nvram to a user readable location and add it to ~/.config/libvirt/qemu.conf
.
Add the following to /etc/libvirt/qemu.conf
.
Use virsh or virt manager.
Select virtIO Network and storage for best performance. Select ZVOL raw device. Mine was /dev/vault/zvols/john/libvirt/<new VM>
.
If using a user session the block device might need to be changed to be owned by the user running the VM.
Refresh the rules with udevadm control --reload
Install drivers:
At the "Where do you want to install Windows?" screen, select the option Load Drivers, uncheck the box for "Hide drivers that aren't compatible with this computer's hardware".
Browse to the wanted driver(s) at:
SCSI: "viostor\w10\amd64" Networking: "NetKVM\w10\amd64"
To use another interface, don't configure anything on the host and select macvtap passthrough, and select the interface.
Install then reboot.
As of ZFS delegation using zfs allow
works on linux. Delegate permissions giving the abiity to snapshot and create datasets.
By default, anybody in the wheel
group can authenticate with polkit as defined in /etc/polkit-1/rules.d/50-default.rules
(see ).
Temporarily the device can be chown'd, but the owner will not live through reboot. For persistence by creating a new file 99-local-zvol.rules
in /etc/udev/rules.d/
that contains the following (replacing the ZVOL path and user):
I ISO and attached the drivers pre-install.