I looked at my Virtualbox UI and saw my VM was still running (before I made 
your suggested changes) even though I did a vagrant destroy. Anyway - I powered 
down that VM via the Virtualbox UI and now the new VM with the separate 
vagrantfile for the host starts up.



However - still - when I go to my browser on my host, I can't access the 
management plugin with localhost:14672 … Still a connection refused error. (I 
mapped it to port 14672 from the host to the VM so that it doesn’t collide with 
my local installation of rabbit)

Here is the output from the vagrant up:



>: vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
    default: Vagrant will now create or start a local VM to act as the Docker
    default: host. You'll see the output of the `vagrant up` for this VM below.
    default:  
    default: Checking if box 'mitchellh/boot2docker' is up to date...
    default: Clearing any previously set network interfaces...
    default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Forwarding ports...
    default: 2375 => 2375 (adapter 1)
    default: 15672 => 14672 (adapter 1)
    default: 22 => 2222 (adapter 1)
    default: Running 'pre-boot' VM customizations...
    default: Booting VM...
    default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: docker
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
    default: Machine booted and ready!
    default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host 
only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default: 
    default: This is not an error message; everything may continue to work 
properly,
    default: in which case you may ignore this message.
==> default: Syncing folders to the host VM...
    default: Installing rsync to the VM...
    default: Rsyncing folder: /Volumes/dev/ => 
/var/lib/docker/docker_1433772293_17627
    default:   - Exclude: [".vagrant/", ".git/"]
==> default: Warning: When using a remote Docker host, forwarded ports will NOT 
be
==> default: immediately available on your machine. They will still be 
forwarded on
==> default: the remote machine, however, so if you have a way to access the 
remote
==> default: machine, then you should be able to access those ports there. This 
is
==> default: not an error, it is only an informational message.
==> default: Creating the container...
    default:   Name: rabbitmq
    default:  Image: rabbitmq:3-management
    default: Volume: /var/lib/docker/docker_1433772293_17627:/vagrant
    default:   Port: 5672:5672
    default:   Port: 15672:8080
    default:  
    default: Container created: 7fc8575f656b1ee6
==> default: Starting container...
==> default: Provisioners will not be run since container doesn't support SSH.





> On 08 Jun 2015, at 12:59 PM, Jörg Diekmann <[email protected]> wrote:
> 
> I did a cat on 
> ~/.vagrant.d/boxes/mitchellh-VAGRANTSLASH-boot2docker/1.2.0/virtualbox/Vagrantfile
> 
> And found the following line in it:
> 
>   # Expose the Docker port
>   config.vm.network "forwarded_port", guest: 2375, host: 2375, host_ip: 
> "127.0.0.1", id: "docker"
> 
> 
> Not sure how this all fits together … but may be an indication of what’s 
> going on?
> 
> Jörg
> 
> 
> 
>> On 08 Jun 2015, at 12:57 PM, Jörg Diekmann <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> My host OS is Mac OSX (the latest version)
>> 
>>> On 08 Jun 2015, at 11:53 AM, Alvaro Miranda Aguilera <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Ok, seems is something listening on port 2375
>>> 
>>> What's your host OS?
>>> 
>>> 
>>> 
>>> On Mon, Jun 8, 2015 at 9:44 PM, Jörg Diekmann <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>>> Hi Alvaro,
>>>> 
>>>> Thanks again for this: I think I understand the thinking behind this. I 
>>>> have
>>>> created a separate Vagrantfile as you suggested and linked to it from my
>>>> main Vagrantfile.
>>>> 
>>>> However, when I “vagrant up” now I get the following confusing error 
>>>> message
>>>> about ports that I am not mapping …
>>>> 
>>>> Vagrant cannot forward the specified ports on this VM, since they
>>>> would collide with some other application that is already listening
>>>> on these ports. The forwarded port to 2375 is already in use
>>>> on the host machine.
>>>> 
>>>> I did a vagrant destroy before doing the up - so I don’t think it has
>>>> anything to do with an existing VM that is running …
>>>> 
>>>> I am not sure where it is getting the 2375 port from ….
>>>> 
>>>> 
>>>> Jörg
>>>> 
>>>> 
>>>> 
>>>> On 08 Jun 2015, at 11:31 AM, Alvaro Miranda Aguilera <[email protected] 
>>>> <mailto:[email protected]>>
>>>> wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> Have a look at the attached file, but basically is like this:
>>>> 
>>>> in your Vagrantfile, you need to tell what Vagrantfile use to spin a
>>>> docker host.
>>>> 
>>>> As you are using boot2docker, and seems it works for you, I leave it:
>>>> 
>>>> cat jd/Vagrantfile
>>>> 
>>>> Vagrant.require_version ">= 1.6.0"
>>>> ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
>>>> Vagrant.configure("2") do |config|
>>>>   config.vm.synced_folder ".", "/vagrant", type: "rsync",
>>>> rsync__exclude: ".git/", disabled: false
>>>>   config.vm.provider "docker" do |docker|
>>>>     docker.vagrant_vagrantfile = "../boot2docker/Vagrantfile"
>>>>     docker.image = "rabbitmq:3-management"
>>>>     docker.ports = ['5672:5672', '15672:8080']    # guest:container
>>>>     docker.name = 'rabbitmq'
>>>>     docker.create_args = ['-e', 'RABBITMQ_NODENAME=johnny-is-a-rabbit']
>>>>   end
>>>>   config.ssh.insert_key = false
>>>> end
>>>> 
>>>> 
>>>> Check the first line inside the docker block
>>>> 
>>>> 
>>>> Then you define your docker host, and here is where you need to do all
>>>> the extra work:
>>>> 
>>>> cat boot2docker/Vagrantfile
>>>> 
>>>> Vagrant.configure(2) do |config|
>>>> config.vm.box = "mitchellh/boot2docker"
>>>> config.vm.network "forwarded_port", guest: 5672, host: 5672
>>>> end
>>>> 
>>>> 
>>>> So, on the first Vagrantfile, you do the mapping between guest and
>>>> docker container
>>>> on the second one you can use host to docker host
>>>> 
>>>> hope this helps
>>>> 
>>>> Thanks
>>>> Alvaro.
>>>> 
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Vagrant" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/vagrant-up/GcbTei30yUM/unsubscribe 
>>>> <https://groups.google.com/d/topic/vagrant-up/GcbTei30yUM/unsubscribe>.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected] 
>>>> <mailto:[email protected]>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>>> <docker_sample.zip>
>>>> 
>>>> 
>>>> --
>>>> 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 [email protected] 
>>>> <mailto:[email protected]>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>> 
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Vagrant" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/vagrant-up/GcbTei30yUM/unsubscribe 
>>> <https://groups.google.com/d/topic/vagrant-up/GcbTei30yUM/unsubscribe>.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> [email protected] 
>>> <mailto:[email protected]>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <https://groups.google.com/d/optout>.
>> 
> 

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to