HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Vagrant inside a VM to control the VM host

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
thevagrantcontrolhostinside

Problem

Background

I have an application which comes with a Vagrant setup that is designed for this usage scenario:

Laptop (Windows, Virtualbox host) => edit source code
+----> Vagrant VM (Linux) => build and run


Plain, default, simple, works. The sources are on a shared/synced directory, i.e., they are usually edited on the Windows host and then compiled and ran inside the VM.

Unfortunately, I prefer to use Linux development tools myself. Right now, I have this setup:

Laptop (Windows)
+----> Vagrant VM
+----> My personal VM (Linux, non-vagrant)


So my editor etc. run in the personal VM, and I have a common directory shared through Virtualbox. Again, everything works just fine.

Here is the problem:

To control the vagrant stuff, I need to enter the vagrant commands in the Windows shell, which is slowing me down. For example, to run the build inside the vagrant VM, I would prefer to use a hotkey in my editor to start vagrant ssh build.sh instead of switching to the CMD.EXE and entering that command. Unneccessary context switch.

Question

I don't wish to open the can of worms that is "virtualization inside virtualization" (i.e., I won't run Linux Virtualbox inside a Windows-hosted VM); so this keeps me with these two alternatives:

Is there a way to control the "Windows-Vagrant" that is running on the Windows host from inside a Linux VM (which itself is not under Vagrant control), i.e., to use vagrant up or vagrant ssh?

Alternatively, is it possible to install "Linux-Vagrant" in my existing VM right away (i.e. the Debian version) and have it create its VM in the Windows host?

Or is there a completely different way to solve this problem in an elegant fashion?

Solution

Is the answer as simple as setting up a dual-booted machine? Linux partitions for development tasks and as the VM host, Windows partitions for normal computing use.

  • Laptop



  • Windows partition



  • Linux Partition



  • Vagrant VM

Context

StackExchange DevOps Q#2778, answer score: 1

Revisions (0)

No revisions yet.