Skip to content

Commit 0b1412a

Browse files
committed
[windows] Add environment variable RACKER_WDM_PROVIDER
This can be used to reconfigure the Vagrant virtualization backend differently than VirtualBox. Possible values are, in alphabetical order, `hyperv`, `virtualbox`, `qemu`, `vmware_fusion`, `vmware_workstation`. It has been tested with `virtualbox` only.
1 parent 2183317 commit 0b1412a

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ in progress
2222
- Rename environment variables used to control the Windows Docker Machine
2323
subsystem. The new names are ``RACKER_WDM_VCPUS``, ``RACKER_WDM_MEMORY``,
2424
and ``RACKER_WDM_MACHINE``.
25+
- Add environment variable ``RACKER_WDM_PROVIDER`` to reconfigure the
26+
Vagrant virtualization backend differently than VirtualBox.
27+
2528

2629
2022-05-20 0.2.0
2730
================

doc/winrunner.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,26 @@ reset the `Windows Docker Machine`_ installation directory. For example, it is:
7979
- On Linux: ``/root/.local/state/racker/windows-docker-machine``
8080
- On macOS: ``/Users/amo/Library/Application Support/racker/windows-docker-machine``
8181

82-
Runtime
83-
=======
82+
83+
VM provider
84+
===========
85+
86+
`Vagrant`_ is able to use different providers as virtualization backend. By
87+
default, Racker selects `VirtualBox`_. In order to change the backend,
88+
reconfigure this environment variable::
89+
90+
export RACKER_WDM_PROVIDER=vmware_workstation
91+
92+
Possible values are, in alphabetical order, ``hyperv``, ``virtualbox``,
93+
``qemu``, ``vmware_fusion``, ``vmware_workstation``.
94+
95+
Please note that this has not been tested with providers other than
96+
`VirtualBox`_, so we would welcome to receive feedback from the community
97+
whether this also works well for them on other hypervisors.
98+
99+
100+
VM machine
101+
==========
84102

85103
The architecture of Windows leads to container compatibility requirements that
86104
are different than on Linux, more background about this detail can be found at
@@ -444,6 +462,8 @@ The whole software catalog can be inquired at `Chocolatey community packages`_.
444462
.. _Overview of System Center release options: https://docs.microsoft.com/en-us/system-center/ltsc-and-sac-overview
445463
.. _Python: https://www.python.org/
446464
.. _Using Racker and Postroj for CrateDB CI: https://github.com/cicerops/racker/blob/main/doc/cratedb.rst
465+
.. _Vagrant: https://www.vagrantup.com/
466+
.. _VirtualBox: https://www.virtualbox.org/
447467
.. _Windows Container Base Images: https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-base-images
448468
.. _Windows container version compatibility: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility
449469
.. _Windows Docker Machine: https://github.com/StefanScherer/windows-docker-machine

postroj/winrunner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
class WinRunner:
2626

27+
VAGRANT_PROVIDER = os.environ.get("RACKER_WDM_PROVIDER", "virtualbox")
2728
VCPUS = os.environ.get("RACKER_WDM_VCPUS", 4)
2829
MEMORY = os.environ.get("RACKER_WDM_MEMORY", 4096)
2930

@@ -129,7 +130,7 @@ def start(self, provision=False):
129130
provision_option = ""
130131
if provision:
131132
provision_option = "--provision"
132-
cmd(f"vagrant up --provider=virtualbox {provision_option} {self.wdm_machine}", cwd=self.wdmdir, use_stderr=True)
133+
cmd(f"vagrant up --provider={self.VAGRANT_PROVIDER} {provision_option} {self.wdm_machine}", cwd=self.wdmdir, use_stderr=True)
133134

134135
logger.info("Pinging Docker context")
135136
if not self.docker_context_online():

0 commit comments

Comments
 (0)