Problems when using vmware_fusion and docker providers together

24 views
Skip to first unread message

nick alexander

unread,
Mar 29, 2017, 9:22:35 AM3/29/17
to Vagrant
Hi IM having 2 problems when using the vmware_fusion and docker providers together in multi-machine config. I am using the native docker base images i.e. force_host_vm = false

below is the Vagantfile

# -*- mode: ruby -*-

# vi: set ft=ruby :


Vagrant.configure("2") do |config|


 config.vm.define "db" do |db|

    db.ssh.username = "root"

    db.ssh.password  = "xxxxx"

    db.ssh.host = "localhost"

    db.ssh.port = 2202


    db.vm.provider "docker" do |d|

       d.image = "xxxxx:8091/ims-oracle"

       d.force_host_vm = false

       d.ports = [  "49162:1521" ]

       d.has_ssh = true

    end


  end



  config.vm.define "adc" do |adc|

    adc.vm.box = "nick/win2012core-ad"

    adc.vm.box_url = "http://xxxx:8081/repository/vagrant/nick/win2012core-ad/metadata.json"


    adc.vm.network "forwarded_port", guest: 88, host: 10088, protocol: "tcp"

    adc.vm.network "forwarded_port", guest: 88, host: 10088, protocol: "udp"

    adc.vm.network "forwarded_port", guest: 53, host: 10053, protocol: "tcp"

    adc.vm.network "forwarded_port", guest: 53, host: 10053, protocol: "udp"

  end


end

~            


Problem 1:
I am unable to get ssh access to the docker container when using the docker provider in a multi machine config, however if I use it in a docker only config works fine.

output from docker ps is

CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                       NAMES

bca7bcd2ce13        dhpsciq01:8091/ims-oracle   "/bin/sh -c '/usr/..."   14 hours ago        Up 21 seconds       22/tcp, 8080/tcp, 0.0.0.0:49162->1521/tcp   ims_db_1490789906


when using docker only config


# -*- mode: ruby -*-

# vi: set ft=ruby :


Vagrant.configure("2") do |config|

  config.ssh.username = "root"

  config.ssh.password = "admin"

  config.ssh.host = "localhost"

  config.ssh.port = 2202


  config.vm.provider "docker" do |d|

#    d.vagrant_vagrantfile = "./docker-host-vm/Vagrantfile"

    d.image = "dhpsciq01:8091/ims-oracle"

    d.has_ssh = true

    d.force_host_vm = false

    d.ports = [  "49162:1521" ]

  end

end


the output from docker ps is:


CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                                       NAMES

6363f2bd65cf        dhpsciq01:8091/ims-oracle   "/bin/sh -c '/usr/..."   21 hours ago        Up 14 seconds       8080/tcp, 127.0.0.1:2202->22/tcp, 0.0.0.0:49162->1521/tcp   oracle-sacs_default_1490715212


and i can ssh into the box. Why is this?

Problem 2: 

Im struggling to figure out how to configure networking between the vmware  VM and the docker container. Does anyone have any bright ideas on this?

Nick

Alvaro Miranda Aguilera

unread,
Mar 29, 2017, 9:33:17 AM3/29/17
to vagra...@googlegroups.com
Hello.

on linux, you can run docker natively, and the vagrant will run docker commands and work fine.

If you go without vagrant creating the VM, its a bit of trial/error to get this working, as Vagrant will create a script for the docker that should be available to the docker container

the problem is docker-engine on windows/mac will create a VM anyways and vagrant is not aware of that part.

also, on docker world, the idea behind docker is not to run ssh , so seems you are on a very specific use case where the out of the box hello world is far from there.

If you could create a more simple repo with public docker, will be easier to give it a go and help.

Alvaro.

nick alexander

unread,
Mar 29, 2017, 9:54:16 AM3/29/17
to Vagrant
Hi Alvaro, thanks fro your quick response. the docker image I'm using is based on wnameless/oracle-xe-11g (https://store.docker.com/community/images/wnameless/oracle-xe-11g) and this should behave identically to my custom container.

when is set d.force_host_vm = true using hashicorp/boot2docker (vmware_desktop, 1.7.8)
and d.has_ssh = false

i get the following error

    default: Rsyncing folder: /Volumes/NickSSD/vagrant-test/ims/ => /var/lib/docker/docker_1490795341_77261

doc...@192.168.177.158's password: 

doc...@192.168.177.158's password: 

doc...@192.168.177.158's password: 

There was an error when attempting to rsync a synced folder.

Please inspect the error message below for more info.


Host path: /Volumes/NickSSD/vagrant-test/ims/

Guest path: /var/lib/docker/docker_1490795341_77261

Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 22 -o LogLevel=FATAL  -o ControlMaster=auto -o ControlPath=/var/folders/sj/lmnd606j5nl3xs5tpk14lr680000gn/T/ssh.540 -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" "--exclude" ".vagrant/" "/Volumes/NickSSD/vagrant-test/ims/" "doc...@192.168.177.158:/var/lib/docker/docker_1490795341_77261"

Error: Permission denied (publickey,password,keyboard-interactive).

rsync: connection unexpectedly closed (0 bytes received so far) [sender]

rsync error: unexplained error (code 255) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/io.c(453) [sender=2.6.9]


Any ideas?

Also any suggestion around how to create a network between the docker container and VM would be greatly appreciated.

Nick

Alvaro Miranda Aguilera

unread,
Apr 2, 2017, 7:11:44 AM4/2/17
to vagra...@googlegroups.com
hello

can you create a github repo with just a simple ubuntu:latest to see if we can get this working?

when we get soemthing that work, we can move to a more complex one

Thanks
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1480e4bb-d6a2-47f8-a6f9-bea238fb89d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages