packer, vagrant, vmware_workstation, centos and networks not working

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

packer, vagrant, vmware_workstation, centos and networks not working

Ian Koenig
Hi Vagrant World,  (x-posted to Packer list too)

I'm building a simple centos 7.3.1611 image in packer for use by VMware Workstation/Fusion in a vagrant environment.   Is there any best practices I can follow to get this to work more consistently?

What's happening is the first vagrant up I do, the network configuration fails on me.  If I vagrant halt and vagrant up it works.  In the first vagrant up I get the error of 
--- 
==> service: Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

# Update sysconfig
sed -i 's/\(HOSTNAME=\).*/\1service/' /etc/sysconfig/network

# Update DNS
sed -i 's/\(DHCP_HOSTNAME=\).*/\1"service"/' /etc/sysconfig/network-scripts/ifcfg-*

[... stuff deleted ...]
---


Yet when I use the atlas version of centos/7, it works just fine.   My packer script is fairly simple with a basic kickstart file, one script to setup the vagrant.sh.  My vagrantfile is very simple.  

Why does the centos/7 image work and my packer based centos ISO image not work?  

Thanks
ian

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c6951acd-ca6a-4bda-b950-df73b24845ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vagrant.sh (1K) Download Attachment
sshd.sh (297 bytes) Download Attachment
centos7-ks.cfg (5K) Download Attachment
test.json (3K) Download Attachment
Vagrantfile (438 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: packer, vagrant, vmware_workstation, centos and networks not working

Ian Koenig
Resolution for the public:

bentos does a good job cleaning this up.  The solution in my case was as part of the cleanup steps on top of the more commonly done cleaning of udev and network-scripts folder, do an "rm -rf /var/lib/NetworkManager".  


On Tuesday, 13 June 2017 17:10:19 UTC-5, Ian Koenig wrote:
Hi Vagrant World,  (x-posted to Packer list too)

I'm building a simple centos 7.3.1611 image in packer for use by VMware Workstation/Fusion in a vagrant environment.   Is there any best practices I can follow to get this to work more consistently?

What's happening is the first vagrant up I do, the network configuration fails on me.  If I vagrant halt and vagrant up it works.  In the first vagrant up I get the error of 
--- 
==> service: Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

# Update sysconfig
sed -i 's/\(HOSTNAME=\).*/\1service/' /etc/sysconfig/network

# Update DNS
sed -i 's/\(DHCP_HOSTNAME=\).*/\1"service"/' /etc/sysconfig/network-scripts/ifcfg-*

[... stuff deleted ...]
---


Yet when I use the atlas version of centos/7, it works just fine.   My packer script is fairly simple with a basic kickstart file, one script to setup the vagrant.sh.  My vagrantfile is very simple.  

Why does the centos/7 image work and my packer based centos ISO image not work?  

Thanks
ian

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/4ffd0394-c5c0-497d-a5ad-44c419d89a57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.