From 95b65c5d15c631330b3b15a8817045a61a44d43e Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 11 Aug 2021 10:52:49 +0200 Subject: [PATCH] sayuri: Add samba sharing files with windows VM This requires enabling guest access in Windows [1]. [1] https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/guest-access-in-smb2-is-disabled-by-default --- machines/sayuri/configuration.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/machines/sayuri/configuration.nix b/machines/sayuri/configuration.nix index 293d680..b5553c2 100644 --- a/machines/sayuri/configuration.nix +++ b/machines/sayuri/configuration.nix @@ -36,6 +36,31 @@ enableTor = true; }; + services.samba = { + enable = true; + securityType = "user"; + extraConfig = '' + interfaces = 192.168.122.1 + bind interfaces only = yes + map to guest = bad user + load printers = no + printing = bsd + disable spoolss = yes + usershare max shares = 0 + acl allow execute always = True + ''; + shares = { + qemu = { + path = "/data/cache/win10/shared"; + browseable = "yes"; + "read only" = "no"; + "guest ok" = "yes"; + "force user" = "simon"; + }; + }; + }; + networking.firewall.trustedInterfaces = [ "virbr0" ]; + networking.hostName = "sayuri"; system.stateVersion = "20.03";