Skip to content

Commit 90e23a3

Browse files
authored
Merge pull request NixOS#493 from danbst/vbox_headless
virtualbox: use VBoxHeadless and allow dots in machine names
2 parents 04c0994 + 56157cd commit 90e23a3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nixops/backends/virtualbox.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,11 @@ def _start(self):
133133
self._logged_exec(
134134
["VBoxManage", "guestproperty", "set", self.vm_id, "/VirtualBox/GuestInfo/Charon/ClientPublicKey", self._client_public_key])
135135

136-
self._logged_exec(["VBoxManage", "startvm", self.vm_id] +
137-
(["--type", "headless"] if self._headless else []))
136+
if self._headless:
137+
self._logged_exec(["VBoxHeadless", "--startvm", self.vm_id])
138+
else:
139+
self._logged_exec(["VBoxManage", "startvm", self.vm_id])
140+
138141

139142
self.state = self.STARTING
140143

@@ -285,7 +288,7 @@ def create(self, defn, check, allow_reboot, allow_recreate):
285288
["nix-build"]
286289
+ self.depl._eval_flags(self.depl.nix_exprs) +
287290
["--arg", "checkConfigurationOptions", "false",
288-
"-A", "nodes.{0}.config.deployment.virtualbox.disks.{1}.baseImage".format(self.name, disk_name),
291+
"-A", 'nodes."{0}".config.deployment.virtualbox.disks.{1}.baseImage'.format(self.name, disk_name),
289292
"-o", "{0}/vbox-image-{1}".format(self.depl.tempdir, self.name)],
290293
capture_stdout=True).rstrip()
291294
self._logged_exec(["VBoxManage", "clonehd", base_image, disk_path])

0 commit comments

Comments
 (0)