Unable to SSH to Box

Discussion in 'Parallels Provider for Vagrant' started by RonC3, Mar 30, 2018.

  1. RonC3

    RonC3 Bit poster

    Messages:
    1
    I'm new to Parallels but not new to Vagrant. I'm having trouble connecting to a box when doing vagrant up. Here is what I have:
    MacPro 2016 High Sierra 10.13.2
    Parallels 13.3.0 (43321)
    Vagrant 2.0.3
    The Parallels installation is mostly untouched _except_ I changed the Host-Only and Shared networks via Preferences to use 192.168.10.0 and 192.168.11.0 networks, respectively, and turn off DHCP for both IPv4/v6 on both.
    Here is my Vagrantfile:

    Vagrant.configure("2") do |config|
    config.vm.box = "centos-7.3"
    config.vm.provider "parallels" do |prl, override|
    override.vm.box = "parallels/centos-7.3"
    override.vm.box_version = "1.0.0"
    prl.memory = 4096
    prl.cpus = 2
    prl.name = 'vagrant-spark'
    # put the following in based on Parallels Forum Vagrant thread
    prl.customize ["set", :id, "--device-set", "net0", "--mac", "00:1c:42:26:1d:f1"]
    config.vm.network "forwarded_port", guest: 22, host: 2200
    end

    config.vm.provider "virtualbox" do |vb, override|
    override.vm.box = "bento/centos-7.3"
    vb.memory = 4096
    vb.cpus = 2
    vb.hostname = 'vagrant-spark'
    end

    config.ssh.insert_key = false
    config.ssh.forward_agent = true

    config.vm.define 'vagrant-spark' do |h|
    # h.ssh.guest_port = 2200
    # h.vm.network "private_network", ip: "192.168.10.10"
    # h.vm.network :forwarded_port, guest: 22, host: 2200, auto_correct: true
    end

    config.vm.provision "ansible" do |ansible|
    ansible.verbose = "v"
    ansible.playbook = "vagrant-setup.yml"
    ansible.inventory_path = "hosts"
    ansible.skip_tags = nil
    ansible.tags = nil
    ansible.raw_arguments = []
    end
    end

    When I issue the command vagrant up --no-provision --provider=parallels I get the following output:
    Bringing machine 'vagrant-spark' up with 'parallels' provider...

    ==> vagrant-spark: Registering VM image from the base box 'parallels/centos-7.3'...
    ==> vagrant-spark: Cloning new virtual machine...
    ==> vagrant-spark: Unregistering the box VM image...
    ==> vagrant-spark: Setting the default configuration for VM...
    ==> vagrant-spark: Checking if box 'parallels/centos-7.3' is up to date...
    ==> vagrant-spark: Setting the name of the VM: vagrant-spark
    ==> vagrant-spark: Preparing network interfaces based on configuration...
    vagrant-spark: Adapter 0: shared
    ==> vagrant-spark: Clearing any previously set network interfaces...
    ==> vagrant-spark: Forwarding ports...
    vagrant-spark: 22 => 2200
    ==> vagrant-spark: Running 'pre-boot' VM customizations...
    ==> vagrant-spark: Booting VM...
    ==> vagrant-spark: Waiting for machine to boot. This may take a few minutes...
    vagrant-spark: SSH address: 192.168.11.10:22
    vagrant-spark: SSH username: vagrant
    vagrant-spark: SSH auth method: private key
    vagrant-spark: Warning: Host appears down. Retrying...

    So Vagrant is unable to reach the guest machine. The IP address doesn't ping from the command line, so it seems that the network isn't bridged to the Mac network even though that option is set in the Parallels Preferences for the network.

    The other issue is that the Parallels provider plugin docs say that a private network connection will be to the host only network but this doesn't seem to be the case - it always goes to the Shared Network. The only way I could get setting the IP address to work against _some_ network was based on a thread in this forum; it seems that the documentation doesn't match what's really going on...

    Anyway, I probably just need a small nudge in the right direction to close the gap here - any suggestions welcome!!
     
  2. MikhailZ

    MikhailZ Bit poster

    Messages:
    3
    Hi, RonC3
    Changing the IP range is OK (unless it overlaps other networks available on your OS X host). But you should not disable DHCP for Shared network interface. This interface is needed for Vagrant to communicate with all VMs running on your host and having DHCP disabled there will cause this issue for all VMs.
    The documentation says about that:
    http://parallels.github.io/vagrant-parallels/docs/networking/
    Ah, I'll try to explain it a little bit clearer. Every Vagrant machine created by our provider will always have Shared interface configured. As I said above, it's needed for internal communication from the Mac host to VM.
    If you want to have a host-only network with another IP range on some particular VM you should configure private_network in your Vagrantfile, as described here:
    - http://parallels.github.io/vagrant-parallels/docs/networking/private_network.html
    - https://www.vagrantup.com/docs/networking/private_network.html
    In that case an additional interface will be created and attached to your VM, so there will be 2 in the result (because Shared is always there). You can configure more than one private_network`s if needed.
     

Share This Page