"cannot forward the specified ports on this VM" when trying to bring up a suspended VM in a multi VM environment #1472

Closed
kadishmal opened this Issue Mar 21, 2013 · 4 comments

Projects

None yet

4 participants

@kadishmal
  1. vagrant up on Windows 7 host for Vagrant 1.1.2.

  2. vagrant suspend

  3. vagrant up, and I get the following error:

    D:\cubrid-shard>vagrant suspend
    [node1] Saving VM state and suspending execution...
    [node2] Saving VM state and suspending execution...
    
    D:\cubrid-shard>vagrant up
    Bringing machine 'node1' up with 'virtualbox' provider...
    [node1] Resuming suspended VM...
    [node1] Booting VM...
    [node1] Waiting for VM to boot. This can take a few minutes.
    [node1] VM booted and ready for use!
    Bringing machine 'node2' up with 'virtualbox' provider...
    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 2222 is already in use
    on the host machine.
    
    To fix this, modify your current projects Vagrantfile to use another
    port. Example, where '1234' would be replaced by a unique host port:
    
      config.vm.network :forwarded_port, guest: 22, host: 1234
    
    Sometimes, Vagrant will attempt to auto-correct this for you. In this
    case, Vagrant was unable to. This is usually because the guest machine
    is in a state which doesn't allow modifying port forwarding.
    

vagrant up, vagrant halt, vagrant up works fine.

I suppose this is a bug.

@jayjanssen

Same here.

@mitchellh
Owner

Confirmed. Looking into it now.

@mitchellh
Owner

Fixed, will be part of 1.1.3 (next week).

Thanks!

@mitchellh mitchellh closed this Mar 21, 2013
@markjaquith
Contributor

I'm still experiencing this issue when bringing up machines with saved state. vagrant reload (or vagrant halt && vagrant up) gets it to detect and fix the port collision.


Environment:

  • OS X 10.8.3
  • Vagrant 1.2.2
  • VirtualBox 4.2.12 r84980.

Reproduction:

  1. Bring up A.
  2. Suspend A.
  3. Bring up B.
  4. Attempt to bring up A.

Result:

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 2222 is already in use
on the host machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment