Skip to content

Instantly share code, notes, and snippets.

@ksexton
Last active December 31, 2015 06:18
Show Gist options
  • Save ksexton/7946184 to your computer and use it in GitHub Desktop.
Save ksexton/7946184 to your computer and use it in GitHub Desktop.
Setup Vagrant vmware-fusion box on CentOS 6.5
#!/bin/sh
setenforce 0
echo "Bringing up network"
ifup eth0
chkconfig sshd on
chkconfig iptables off
chkconfig ip6tables off
sed -i -e 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
useradd vagrant
mkdir /home/vagrant/.ssh
curl https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub >> /home/vagrant/.ssh/authorized_keys
chmod 700 /home/vagrant/.ssh
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
sed -i 's/^Defaults requiretty/Defaults !requiretty/' /etc/sudoers
echo "vagrant ALL=NOPASSWD: ALL" >> /etc/sudoers
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
EOF
rm -f /etc/udev/rules.d/70-persistent-net.rules
# Install stuff
# Setup NFS
yum -y install nfs-utils
chkconfig rpcbind on
chkconfig nfslock on
yum -y install perl gcc make kernel-headers kernel-devel
yum -y install curl ftp rsync sudo time wget which openssh-clients bzip2
yum -y install gcc-c++ zlib-devel openssl-devel readline-devel sqlite3-devel
yum -y install cups fuse-libs
rpm -ivh http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm
yum -y install puppet
# Add the /usr/sbin and /sbin to the path:
echo 'export PATH=$PATH:/usr/sbin:/sbin' >> ~vagrant/.bashrc
# Install vmware-tools
mkdir ~/vmware
curl -o ~/vmware/VMwareTools-9.6.1-1378637.tar.gz http://www.mocker.org/files/VMwareTools-9.6.1-1378637.tar.gz
cd ~/vmware
tar -zxvf VMwareTools-9.6.1-1378637.tar.gz
cd vmware-tools-distrib
./vmware-install.pl --default
cd ~
rm -fr ~/vmware
yum clean all
history -c
shutdown -h now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment