diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 9d89960876eb..872e96327e87 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -606,12 +606,15 @@ class Machine: + os.environ.get("QEMU_OPTS", "") ) - environment = { - "QEMU_OPTS": qemu_options, - "SHARED_DIR": self.shared_dir, - "USE_TMPDIR": "1", - } - environment.update(dict(os.environ)) + environment = dict(os.environ) + environment.update( + { + "TMPDIR": self.state_dir, + "SHARED_DIR": self.shared_dir, + "USE_TMPDIR": "1", + "QEMU_OPTS": qemu_options, + } + ) self.process = subprocess.Popen( self.script,