Skip to content

Commit e4fa85d

Browse files
committed
Use the UUID for the machine ID
This avoids leaking the real machine ID into guests, and provides an easy way for guests to know their own UUID. Fixes: QubesOS/qubes-issues#8833
1 parent f66c912 commit e4fa85d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qubes/vm/qubesvm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,16 +2533,17 @@ def kernelopts_common(self):
25332533
"""
25342534
if not self.kernel:
25352535
return ""
2536+
base_kernelopts = "systemd.machine_id=" + self.uuid.hex + " "
25362537
kernels_dir = self.storage.kernels_dir
25372538

25382539
kernelopts_path = os.path.join(
25392540
kernels_dir, "default-kernelopts-common.txt"
25402541
)
25412542
if os.path.exists(kernelopts_path):
25422543
with open(kernelopts_path, encoding="ascii") as f_kernelopts:
2543-
return f_kernelopts.read().rstrip("\n\r")
2544+
return base_kernelopts + f_kernelopts.read().rstrip("\n\r")
25442545
else:
2545-
return qubes.config.defaults["kernelopts_common"]
2546+
return base_kernelopts + qubes.config.defaults["kernelopts_common"]
25462547

25472548
#
25482549
# helper methods

0 commit comments

Comments
 (0)