-
-
Save webdizz/4568431 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download net install iso. Find a mirror close to you at: | |
http://isoredirect.centos.org/centos/6/isos/i386/ | |
Create a new VirtualBox machine | |
------------------------------- | |
- Name: vagrant-centos | |
- Operating System: Linux | |
- Version: Red Hat 64bit | |
- Base Memory Size: 1000 Mb | |
- Dynamically expanding hard disk: 40Gb | |
- Disable Audio | |
- Disable USB | |
- Make sure network is set to NAT | |
- Attach the net install ISO to the CDROM so it can boot | |
Run through install procedure | |
----------------------------- | |
- Install system | |
- Skip verification | |
- Installation Method: HTTP | |
- Disable IPv6, leave IPv4 enabled with DHCP | |
- HTTP Setup: | |
- URL: http://mirror.centos.org/centos/6/os/x86_64/ | |
- URL: http://mirror.easyspeedy.com/centos/6.3/os/i386/ | |
- Initialize drive and erase data: yes | |
- Configure network: yes | |
- Set hostname to vm.centos | |
- Root password: vaqgrant | |
- Select minimal setup (click continue, this will take a while) | |
- Remove CDRom media | |
- Reboot | |
- Disable firewall: | |
service iptables save | |
service iptables stop | |
chkconfig iptables off | |
Install guest additions | |
----------------------- | |
First, install some required packages: | |
yum install gcc bzip2 make kernel-devel-`uname -r` | |
yum groupinstall ""X Window System | |
From the menu: Devices → Install Guest Additions... | |
sudo mount -o ro -t iso9660 /dev/cdrom /mnt | |
sudo sh /mnt/VBoxLinuxAdditions.run | |
Will complain about X related drivers we didn’t install. Should be fine. | |
If you need to recompile, run this within the VM /etc/init.d/vboxadd setup and then vagrant reload | |
Users | |
----- | |
### Add vagrant user | |
- groupadd admin | |
- useradd -G admin dev | |
- passwd dev # choose "dev" as the password | |
### Grant sudo power | |
Run `visudo` and make the following changes: | |
Add the following lines at the bottom: | |
# Vagrant user should be able to sudo | |
%admin ALL=NOPASSWD: ALL | |
Comment out the following line: | |
# Defaults requiretty # (otherwise ssh <command> doesn't work) | |
Add the variable "PATH" to the "Defaults env_keep" list, otherwise sudo cleans the path, and loses ruby, which ohai needs. | |
Save the changes and exit the editor. | |
Add `/usr/sbin` and `/sbin` to the path: | |
echo 'export PATH=$PATH:/usr/sbin:/sbin' >> ~vagrant/.bashrc | |
h2. Add Vagrant's "insecure" public key | |
h2. As user vagrant | |
mkdir .ssh | |
chmod 755 .ssh | |
curl https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > .ssh/authorized_keys | |
chmod 644 .ssh/authorized_keys | |
h2. Clean up | |
- sudo yum clean headers packages dbcache expire-cache | |
- halt | |
h2. Export and package | |
Follow instructions on http://vagrantup.com/docs/base_boxes.html | |
h3. NFS | |
- yum install nfs-utils | |
- chkconfig rpcbind on | |
- chkconfig nfslock on | |
h2. Users | |
h2. Enable NFS support | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment