You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A really common dependency for development and testing environments is vagrant and virtualbox. While vagrant supports using docker as the provisioner it will never give you something "virtual machine" like. Allowing vagrant to talk to virtualbox from inside a docker image brings a lot of challenge. Mostly of these challenges come from the fact that vagrant directly calls the VBoxManage command to interact with virtualbox.
Design (with working POC)
When lope is run with the -vbox flag the following happens:
Lope starts a http endpoint which allows running commands and will return the output
A binary called VBoxManage is added into the docker container which proxies all commands to the lope http endpoint and prints the result
localhost is set to the IP address of the host machine running docker (host.docker.internal) --add-host=localhost:192.168.65.2
Lope runs as the current user and that user has an actual account in the docker image (requirement of vagrant)
The working directory is set to the host working directory so that mounting directories into virtualbox works as expected
With all of these things setup lope is able to start a container and run vagrant up && vagrant ssh successfully!
Todo
Move current server POC code directly into lope
Move current client POC code and build and release it as a separate binary. This client works for VBoxManage but has been written in a way to be a generic host command proxy
Find a nice way to get the value of host.docker.internal so that the localhost of the container can be set to it.
Don't run as root when the -vbox flag is added
When running a container as the current user actually add the users account into the image. This will also fix some weirdness with git and running as different users.
Set working directory to match the host working directory. (Should this be the lope default?)
Automatically set the $HOME directory (normally blacklisted)
Mount ~/.vagrant.d/boxes/ into the container
Add option in vagrant to use "localhost" instead of "127.0.0.1". This used to be the default but was changed because OSX doesn't have localhost by default (or didn't a few years ago). vagrant source. For testing purposes this can be monkey patched with RUN sed -i 's/127.0.0.1/localhost/g' /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/providers/virtualbox/provider.rb
The text was updated successfully, but these errors were encountered:
A really common dependency for development and testing environments is vagrant and virtualbox. While vagrant supports using docker as the provisioner it will never give you something "virtual machine" like. Allowing vagrant to talk to virtualbox from inside a docker image brings a lot of challenge. Mostly of these challenges come from the fact that vagrant directly calls the
VBoxManage
command to interact with virtualbox.Design (with working POC)
When lope is run with the
-vbox
flag the following happens:VBoxManage
is added into the docker container which proxies all commands to the lope http endpoint and prints the resultlocalhost
is set to the IP address of the host machine running docker (host.docker.internal)--add-host=localhost:192.168.65.2
With all of these things setup lope is able to start a container and run
vagrant up && vagrant ssh
successfully!Todo
host.docker.internal
so that the localhost of the container can be set to it.-vbox
flag is added~/.vagrant.d/boxes/
into the containerRUN sed -i 's/127.0.0.1/localhost/g' /opt/vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/providers/virtualbox/provider.rb
The text was updated successfully, but these errors were encountered: