Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 15.04 + Parallels potential ssh race condition #405

Closed
cheeseplus opened this issue Jul 13, 2015 · 4 comments
Closed

Ubuntu 15.04 + Parallels potential ssh race condition #405

cheeseplus opened this issue Jul 13, 2015 · 4 comments

Comments

@cheeseplus
Copy link
Contributor

On first boot via kitchen kitchen test default-bento-ubuntu-1504, I get:
https://gist.github.com/242892ca85959abdaf5a

If I repeat the command kitchen test default-bento-ubuntu-1504 it then works as expected which is weird cause test should destroy an existing instance (maybe also a kitchen bug?) /cc @fnichol

@fnichol
Copy link
Contributor

fnichol commented Jul 19, 2015

@cheeseplus Confirmed, looks like this is a Vagrant issue when you attempt to set the hostname (which Test Kitchen does by default). It appears to be fixed as of Vagrant 1.7.3. Going to try and confirm if disabling the hostname is an okay workaround…

@fnichol
Copy link
Contributor

fnichol commented Jul 19, 2015

Confirmed with a simple Vagrant project.

Currently:

> cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-15.04"
  config.vm.hostname = "default-ubuntu-1504"
end

> vagrant up --no-provision --provider vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Cloning VMware VM: 'bento/ubuntu-15.04'. This can take some time...
==> default: Checking if box 'bento/ubuntu-15.04' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 172.16.60.138:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    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: Forwarding ports...
    default: -- 22 => 2222
==> default: Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

service hostname start

Stdout from the command:



Stderr from the command:

stdin: is not a tty
Failed to start hostname.service: Unit hostname.service is masked.

Without setting hostname:

> cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-15.04"
end

> vagrant up --no-provision --provider vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Cloning VMware VM: 'bento/ubuntu-15.04'. This can take some time...
==> default: Checking if box 'bento/ubuntu-15.04' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 172.16.60.138:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    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: Forwarding ports...
    default: -- 22 => 2222
==> default: Configuring network adapters within the VM...
==> default: Waiting for HGFS kernel module to load...
==> default: Enabling and configuring shared folders...
    default: -- /Users/fnichol/Projects/sandbox/ubuntu: /vagrant
==> default: Machine not provisioning because `--no-provision` is specified.

I also tried a Test Kitchen project with vm_hostname: null in the Driver block, which allowed the instance to fully boot.

@cheeseplus
Copy link
Contributor Author

Do we need to fix this given it's a Vagrant bug?

@cheeseplus
Copy link
Contributor Author

Closing as this was a vagrant bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants