Closed annawake closed 8 years ago
Appears to be related to this Vagrant bug: https://github.com/mitchellh/vagrant/issues/5377
See vagrant.sh
# Set up sudo
echo "==> Giving ${SSH_USER} sudo powers"
echo "${SSH_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Add the line below
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
Thanks, @adamdyson seems to do the trick - just merged in your suggested fix.
Upgrading to Vagrant 1.7.3 should also fix the issue without the hack above. In the latest release of Vagrant they have stopped assuming Ubuntu is using upstart
, since it's now using systemd
OK, I’ll yank it then ;-) Thanks.
On Jul 12, 2015, at 6:38 AM, Adam Dyson notifications@github.com wrote:
Upgrading to Vagrant 1.7.3 should also fix the issue without the hack above. In the latest release of Vagrant they have stopped assuming Ubuntu is using upstart, since it's now using systemd
— Reply to this email directly or view it on GitHub https://github.com/boxcutter/ubuntu/issues/17#issuecomment-120721328.
:+1:
Actually still seeing the issue without the hack on 1.7.3:
==> default: Cloning VMware VM: 'ubuntu1504-desktop-nocm-1.1.0'. This can take some time...
==> 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.231.130: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 it's 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: -- /private/tmp/boxtest: /vagrant
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR warden: Error occurred: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
>
ERROR vagrant: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.7.3/plugins/communicators/ssh/communicator.rb:236:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/plugins/communicators/ssh/communicator.rb:246:in `sudo'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/guest_cap/linux/mount_vmware_shared_folder.rb:52:in `mount_vmware_shared_folder'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/capability_host.rb:111:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/capability_host.rb:111:in `capability'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/guest.rb:43:in `capability'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/synced_folder.rb:80:in `block in enable'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/synced_folder.rb:56:in `each'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/synced_folder.rb:56:in `enable'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/synced_folders.rb:92:in `block in call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/synced_folders.rb:89:in `each'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/synced_folders.rb:89:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/plugins/synced_folders/nfs/action_cleanup.rb:25:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:1005:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:71:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:1035:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/box_check_outdated.rb:36:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:1249:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:273:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:143:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:1114:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:482:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:1249:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:99:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:273:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/moujan/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:160:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/machine.rb:214:in `action_raw'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/machine.rb:191:in `block in action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/environment.rb:516:in `lock'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/machine.rb:178:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/machine.rb:178:in `action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.3/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
/opt/vagrant/embedded/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
/opt/vagrant/embedded/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
make: *** [test-box/vmware/ubuntu1504-desktop-nocm-1.1.0.box] Error 1
It looks like this has been fixed in the VirtualBox provider in vagrant 1.7.3, just not in the VMware and Parallels providers. So for, now filtering this box out on these platforms.
No longer seems to be an issue with VMware 8
Actually the issue appears to still be present after further testing.
I fixed this by adding the lines below just after https://github.com/boxcutter/ubuntu/blob/master/script/vagrant.sh#L23
# Fix stdin not being a tty.
if grep -q -E "^mesg n$" /root/.profile && sed -i "s/^mesg n$/tty -s \\&\\& mesg n/g" /root/.profile; then
echo "==> Fixed stdin not being a tty."
fi
Does not seem to help
I'm having this problem with VMWare 6, Ubuntu 15.04 & Vagrant 1.7.4.
My error message doesn't have anything about stdin not being a TTY (which is usually caused by password-less sudo failing).
Stderr from the command:
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
Ubuntu switched to systemd as of release 15 (vivid).. So it's no surprise that Vagrant can't talk to upstart. I think this should be a vagrant bug.
Can you provide a minimal example to reproduce this? And yes if this is a bug it is certainly a Vagrant bug.
@rickard-von-essen I did some further testing this afternoon and narrowed it down in my case to be caused by the Salt bootstrap script (in scripts/cmtool.sh
) - it doesn't seem to support Ubuntu vivid yet.
Seems to be fixed in vagrant 1.8.0