boxcutter / centos

Virtual machine templates for CentOS written in legacy JSON
Apache License 2.0
424 stars 199 forks source link

private_network breaks provisioning #54

Closed ghost closed 7 years ago

ghost commented 7 years ago

I'm using boxcutter/centos72-desktop and if I add config.vm.network "private_network", ip: "172.16.193.100" to my Vagrantfile it will remain stuck on:

==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

The same happens when using public_network. When removing this directive everything works just fine.

This issue does not seem to be present with the centos/7 box.

sdemura commented 7 years ago

This didn't used to happen Pre 2.0.16, but I see it on .18 and .19

bretdavidson commented 7 years ago

This still seems to be an issue with version 2.0.20.

annawake commented 7 years ago

Comparing against centos/7 isn't helpful as the guest additions aren't installed - we're trying to tackle the harder problem of making these things work with the guest additions.

Still not sure where the issue lies. Is it VirtualBox, vagrant, the templates or a combination? Currently dunno.

annawake commented 7 years ago

Thanks for the update

ghost commented 7 years ago

@annawake I'm not sure if this is relevant or helpful, but I use the vagrant-vbguest plugin with centos/7 which means it does install the guest additions, albeit as the first provisioning step after the network is setup. Subsequent reboots do however work fine.

ghost commented 7 years ago

For other people running into this who desperately want a centos desktop that supports these features and don't mind the increased initialize time, the following works as a provisioning script, based on the centos/7 image with the vagrant-vbguest plugin installed (I prefer xfce, you can pick a different desktop environment of course):

yum -y install epel-release
yum -y groupinstall 'Development Tools' 'X Window system' 'xfce'
yum -y remove initial-setup initial-setup-gui
yum -y install terminator xfce4-whiskermenu-plugin firefox 'gnu-free-*-fonts' xdg-utils
gtk-update-icon-cache -f /usr/share/icons/hicolor/
sed -i 's/\[daemon\]/[daemon]\nAutomaticLoginEnable=true\nAutomaticLogin=vagrant/' /etc/gdm/custom.conf

# Rebuild VBoxGuestAdditions now that X11 is present
/opt/VBoxGuestAdditions-*/init/vboxadd setup

# Enable GUI
systemctl enable vboxadd
systemctl set-default graphical.target
systemctl start graphical.target
annawake commented 7 years ago

This looks promising: https://github.com/CentOS/sig-cloud-instance-build/issues/38

I'm going to try porting in the ethernet fix code from https://github.com/CentOS/sig-cloud-instance-build/blob/master/vagrant/centos7.ks

annawake commented 7 years ago

Having good luck with the latest boxes on vagrant 1.8.6.

1.8.7 has broken curl, 1.9.0 has broken vmware, 1.9.1 has broken public_network https://github.com/mitchellh/vagrant/issues/8096

misheska commented 7 years ago

Private networking should be sorted now in the new boxes.