Skip to content

Commit 1b26257

Browse files
committed
nixos-modules/host: remove disk group from microvm user
Fix Github issue #222
1 parent 782e849 commit 1b26257

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* Runners execute the hypervisor with a process name of
1717
`microvm@$NAME`
1818
* We no longer let `environment.noXlibs` default to `true`
19+
* **Breaking:** the `microvm` user is no longer in the `disk` group
20+
for security reasons. Add `users.users.microvm.extraGroups = [
21+
"disk" ]` to your config to restore the old behavior.
1922

2023
## 0.4.1 (2023-11-03)
2124

doc/src/faq.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,16 @@ nix.nixPath = [
122122
"nixpkgs=${builtins.storePath <nixpkgs>}"
123123
];
124124
```
125+
126+
# How do I let the `microvm` user access block devices?
127+
128+
You can re-add the following line to your host's NixOS configuration
129+
which was removed from microvm.nix:
130+
131+
```nix
132+
users.users.microvm.extraGroups = [ "disk" ];
133+
```
134+
135+
The more secure solution would be writing custom
136+
`services.udev.extraRules` that assign ownership/permissions to the
137+
individually used block devices.

nixos-modules/host/default.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ in
171171
users.users.${user} = {
172172
isSystemUser = true;
173173
inherit group;
174-
# allow access to zvol
175-
extraGroups = [ "disk" ];
176174
};
177175

178176
security.pam.loginLimits = [

0 commit comments

Comments
 (0)