Password prompt on bringing up Vagrant although it is specified in Vagrantfile

321 views
Skip to first unread message

Shashank Korada

unread,
Jan 24, 2018, 1:23:49 AM1/24/18
to Vagrant
Hello,

I am trying to launch VMs on a remote server by specifying the username/password for the server in the Vagrantfile but on running "vagrant up" it still prompts me for the password.
How do I avoid being prompted for the password?

This is my current Vagrantfile:

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.ssh.forward_agent = true
  config.vm.define "test-remote-vm-libvirt" do |x|
    x.vm.box = "ceph/ubuntu-xenial"
    x.vm.hostname = "test-remote-vm-libvirt"
    x.vm.network :private_network, ip: 10.0.10.100
    x.vm.provider :libvirt do |v|
      v.driver = "kvm"
      v.host = "10.73.40.52"
      v.username = "skorada"
      v.password = "mypassword"
      v.connect_via_ssh = true
      v.memory = 2
      v.cpus = 2
      v.nested = true
    end
  end
end

Console logs on bringing up vagrant:

skorada@test-server:~/home/vagrant/$ vagrant up
Bringing machine 'test-remote-vm-libvirt' up with 'libvirt' provider...

root@localhost's password:   ==================================> PASSWORD PROMPT

==> test-remote-vm-libvirt: Creating image (snapshot of base box volume).
==> test-remote-vm-libvirt: Creating domain with the following settings...
==> test-remote-vm-libvirt:  -- Name:              master_test-remote-vm-libvirt
==> test-remote-vm-libvirt:  -- Domain type:       kvm
==> test-remote-vm-libvirt:  -- Cpus:              2
==> test-remote-vm-libvirt:  -- Feature:           acpi
==> test-remote-vm-libvirt:  -- Feature:           apic
==> test-remote-vm-libvirt:  -- Feature:           pae
==> test-remote-vm-libvirt:  -- Memory:            6000M
==> test-remote-vm-libvirt:  -- Management MAC:
==> test-remote-vm-libvirt:  -- Loader:
==> test-remote-vm-libvirt:  -- Base box:          ceph/ubuntu-xenial
==> test-remote-vm-libvirt:  -- Storage pool:      default
==> test-remote-vm-libvirt:  -- Image:             /var/lib/libvirt/images/master_test-remote-vm-libvirt.img (301G)
==> test-remote-vm-libvirt:  -- Volume Cache:      default
==> test-remote-vm-libvirt:  -- Kernel:
==> test-remote-vm-libvirt:  -- Initrd:
==> test-remote-vm-libvirt:  -- Graphics Type:     vnc
==> test-remote-vm-libvirt:  -- Graphics Port:     5900
==> test-remote-vm-libvirt:  -- Graphics IP:       127.0.0.1
==> test-remote-vm-libvirt:  -- Graphics Password: Not defined
==> test-remote-vm-libvirt:  -- Video Type:        cirrus
==> test-remote-vm-libvirt:  -- Video VRAM:        9216
==> test-remote-vm-libvirt:  -- Sound Type:
==> test-remote-vm-libvirt:  -- Keymap:            en-us
==> test-remote-vm-libvirt:  -- TPM Path:
==> test-remote-vm-libvirt:  -- INPUT:             type=mouse, bus=ps2
==> test-remote-vm-libvirt: Creating shared folders metadata...
==> test-remote-vm-libvirt: Starting domain.
==> test-remote-vm-libvirt: Waiting for domain to get an IP address...
==> test-remote-vm-libvirt: Waiting for SSH to become available...
Pseudo-terminal will not be allocated because stdin is not a terminal.
skorada@localhost's password:    ====================================> PASSWORD PROMPT
==> test-remote-vm-libvirt: Setting hostname...
==> test-remote-vm-libvirt: Configuring and enabling network interfaces...
==> test-remote-vm-libvirt: Rsyncing folder: /home/vagrant/ => /vagrant

skorada@localhost's password:   ====================================> PASSWORD PROMPT


Am I missing any ssh config that is required? Also dont understand why I am being prompted for a password multiple times
Any pointers would be helpful.

Regards

Alvaro Miranda Aguilera

unread,
Jan 24, 2018, 9:51:55 PM1/24/18
to vagra...@googlegroups.com
hello

seems you got the user/pass on the wrong block.


config.ssh.username

or 
x.ssh.username




--
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/453f75a4-41b0-4a6e-ae22-79b8f86b5717%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Shashank Korada

unread,
Jan 25, 2018, 12:33:51 AM1/25/18
to Vagrant
Hi Alvaro,

Thanks for your reply.
I think the ssh_settings that you are referring to is for accessing the VM. I was referring to accessing the remote server.
As per plugin provider options this is what I found and tried to use


Any idea if I am maybe still using it incorrectly ?
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Jan 25, 2018, 4:56:03 PM1/25/18
to vagra...@googlegroups.com
hello

thats new info. you should open an issue with then and check

thats a 3rd party plugin.

thanks
alvaro

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/d335ea3a-63c6-4853-8881-2964f8af316d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Shashank Korada

unread,
Jan 25, 2018, 10:29:50 PM1/25/18
to Vagrant
Thanks Alvaro.

I have opened an issue , for reference : https://github.com/vagrant-libvirt/vagrant-libvirt/issues/854

I shall update the thread if I figure out a solution.Might help others with the same issue

Thanks,
Shashank




--
Alvaro

Reply all
Reply to author
Forward
0 new messages