vm: remove bridge network interface, update vm xml, general cleanup
This commit is contained in:
parent
9030a12931
commit
227c761ebe
5 changed files with 43 additions and 53 deletions
|
@ -33,10 +33,10 @@
|
|||
];
|
||||
|
||||
# So that I can get to the netgear router
|
||||
networking.extraHosts = ''
|
||||
10.0.0.152 routerlogin.net
|
||||
10.0.0.152 www.routerlogin.net
|
||||
'';
|
||||
# networking.extraHosts = ''
|
||||
# 10.0.0.152 routerlogin.net
|
||||
# 10.0.0.152 www.routerlogin.net
|
||||
# '';
|
||||
|
||||
services.flatpak.enable = true;
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
|
|
@ -119,15 +119,16 @@ in {
|
|||
# So I can build for kernel 6.13
|
||||
# til https://github.com/gnif/LookingGlass/pull/1154 is merged
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
(kvmfr.overrideAttrs (old: {
|
||||
patches = [ ]; # The patches have already since been merged
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zeule";
|
||||
repo = "LookingGlass";
|
||||
rev = "7740692e3000c2019e21b9861585960174dd5ddc";
|
||||
sha256 = "sha256-2ayH8FXOn4Bflf55WvhMWTDMLwvucmofD3POI72bC+Q=";
|
||||
};
|
||||
}))
|
||||
kvmfr
|
||||
# (kvmfr.overrideAttrs (old: {
|
||||
# patches = [ ]; # The patches have already since been merged
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "zeule";
|
||||
# repo = "LookingGlass";
|
||||
# rev = "7740692e3000c2019e21b9861585960174dd5ddc";
|
||||
# sha256 = "sha256-2ayH8FXOn4Bflf55WvhMWTDMLwvucmofD3POI72bC+Q=";
|
||||
# };
|
||||
# }))
|
||||
];
|
||||
|
||||
services.udev.packages = optionals (cfg.devices != [ ]) [ udevPackage ];
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"libvirtd"
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"video"
|
||||
|
|
39
nixos/vm.nix
39
nixos/vm.nix
|
@ -82,33 +82,33 @@ in {
|
|||
# the network bridge interface with systemctl start network-addresses-winvm0.service,
|
||||
# and potentially toggle the link state in the vm config
|
||||
# to get this working. would be good to fix it.
|
||||
networking.bridges = {
|
||||
"winvm0" = {
|
||||
interfaces = [ "eth0" ];
|
||||
};
|
||||
};
|
||||
# networking.bridges = {
|
||||
# "winvm0" = {
|
||||
# interfaces = [ "eth0" ];
|
||||
# };
|
||||
# };
|
||||
|
||||
networking.dhcpcd.denyInterfaces = [ "winvm0" ];
|
||||
# networking.dhcpcd.denyInterfaces = [ "winvm0" ];
|
||||
|
||||
# TODO: the below doesn't actually work, so I just
|
||||
# disable wait-online entirely.
|
||||
# ensure the bridge network doesn't cause us to wait
|
||||
# on boot
|
||||
# systemd.network.wait-online.ignoredInterfaces = [ "eth0" "winvm0" ];
|
||||
systemd.network.wait-online.anyInterface = true;
|
||||
boot.initrd.systemd.network.wait-online.ignoredInterfaces = [ "eth0" "winvm0" ];
|
||||
# systemd.network.wait-online.anyInterface = true;
|
||||
# boot.initrd.systemd.network.wait-online.ignoredInterfaces = [ "eth0" "winvm0" ];
|
||||
|
||||
# These are needed, since I'm not currently trying to
|
||||
# reserve a static IP for the bridge interface
|
||||
networking.defaultGateway = { address = "10.0.0.1"; interface = "eth0"; };
|
||||
networking.interfaces.winvm0 = {
|
||||
useDHCP = false;
|
||||
ipv4 = {
|
||||
addresses = [
|
||||
{ address = "10.0.5.1"; prefixLength = 32; }
|
||||
];
|
||||
};
|
||||
};
|
||||
# networking.defaultGateway = { address = "10.0.0.1"; interface = "eth0"; };
|
||||
# networking.interfaces.winvm0 = {
|
||||
# useDHCP = false;
|
||||
# ipv4 = {
|
||||
# addresses = [
|
||||
# { address = "10.0.5.1"; prefixLength = 32; }
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
environment.systemPackages = [
|
||||
# For sharing filesystems
|
||||
|
@ -135,7 +135,10 @@ in {
|
|||
hardware.graphics.enable = true; # needed for display spice opengl
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemu.swtpm.enable = true; # for TPM 2.0 support
|
||||
qemu = {
|
||||
swtpm.enable = true; # for TPM 2.0 support
|
||||
ovmf.packages = [ pkgs.OVMFFull.fd ];
|
||||
};
|
||||
|
||||
onBoot = "ignore"; # only start autostart vms, not just ones that were running
|
||||
onShutdown = "shutdown"; # always shut down the vm's cleanly
|
||||
|
|
29
win10.xml
29
win10.xml
|
@ -183,25 +183,12 @@
|
|||
<controller type="virtio-serial" index="0">
|
||||
<address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
|
||||
</controller>
|
||||
<filesystem type="mount" accessmode="passthrough">
|
||||
<driver type="virtiofs"/>
|
||||
<binary path="/run/current-system/sw/bin/virtiofsd"/>
|
||||
<source dir="/home/evar/Virtio Shared/"/>
|
||||
<target dir="Virtio Shared"/>
|
||||
<address type="pci" domain="0x0000" bus="0x0c" slot="0x00" function="0x0"/>
|
||||
</filesystem>
|
||||
<interface type="network">
|
||||
<mac address="52:54:00:15:1c:97"/>
|
||||
<source network="default"/>
|
||||
<model type="virtio"/>
|
||||
<address type="pci" domain="0x0000" bus="0x0a" slot="0x00" function="0x0"/>
|
||||
</interface>
|
||||
<interface type="bridge">
|
||||
<mac address="52:54:00:33:7d:5e"/>
|
||||
<source bridge="winvm0"/>
|
||||
<model type="virtio"/>
|
||||
<link state="up"/>
|
||||
<address type="pci" domain="0x0000" bus="0x0b" slot="0x00" function="0x0"/>
|
||||
<address type="pci" domain="0x0000" bus="0x0a" slot="0x00" function="0x0"/>
|
||||
</interface>
|
||||
<serial type="pty">
|
||||
<target type="isa-serial" port="0">
|
||||
|
@ -255,19 +242,17 @@
|
|||
</source>
|
||||
<address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
|
||||
</hostdev>
|
||||
<hostdev mode="subsystem" type="usb" managed="yes">
|
||||
<source>
|
||||
<vendor id="0x256c"/>
|
||||
<product id="0x006b"/>
|
||||
</source>
|
||||
<address type="usb" bus="0" port="1"/>
|
||||
</hostdev>
|
||||
<watchdog model="itco" action="reset"/>
|
||||
<memballoon model="none"/>
|
||||
<shmem name="scream">
|
||||
<model type="ivshmem-plain"/>
|
||||
<size unit="M">2</size>
|
||||
<address type="pci" domain="0x0000" bus="0x00" slot="0x11" function="0x0"/>
|
||||
</shmem>
|
||||
</devices>
|
||||
<qemu:commandline>
|
||||
<qemu:arg value="-device"/>
|
||||
<qemu:arg value="{"driver":"ivshmem-plain","id":"shmem0","memdev":"looking-glass"}"/>
|
||||
<qemu:arg value="{"driver":"ivshmem-plain","id":"shmem1","memdev":"looking-glass"}"/>
|
||||
<qemu:arg value="-object"/>
|
||||
<qemu:arg value="{"qom-type":"memory-backend-file","id":"looking-glass","mem-path":"/dev/kvmfr0","size":134217728,"share":true}"/>
|
||||
</qemu:commandline>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue