Using Bitnami’s Rubystack on VirtualBox Linux with Vagrant
In my Software Engineering Projects class, we are going to do a RAILS-based project. Based on feedback from last year’s class, I am furnishing students with an almost configured RAILS system for development. The system is based on
- Bitnami’s Rubystack for 32 bit Linux
- VirtualBox 4.2.12 as the VM
- Vagrant 1.22 to help manage the install
- Ubuntu precise32 Linux
Create the base machine
The Vagrantfile
is configured to support networking from the host machine
and to run a configuration script (script.sh
) as part of the provisioning.
There is a small bit of logic to avoid re-provisioning things each time the
machine is brought up.
I make it by following roughly the following procedure:
- Install Virtualbox
- Install Vagrant
- Create a directory to place files add in
* The bitnami linux installer file
*
Vagrantfile
*script.sh
- Do an install:
vagrant up
- SSH into the running host:
vagrant ssh
- Use Linux as needed
- Exit back to the host OS:
exit
- Shutdown the virtual machine (saving the contents):
vagrant halt
-
Package the machine post configuration with
vagrant package default --output rails3r2e13.box
- Restart the machine and continue work:
vagrant up
Install the base machine on student computer
OS X/Linux commands are given here, change the direction of the /
(to \
) for Windows.
- Install Virtualbox
- Install Vagrant
- Create a vms directory for your development use
mkdir vms
- Create a machine1 directory
mkdir vms/machine1
It will be accessible to both Linux and your operating system. cd vms/machine1
vagrant init rails3r2e13.box url_to_image
- uncomment
config.vm.network :private_network, ip: "192.168.33.10"
in Vagrantfile vagrant up
# first time will download the vm machinevagrant ssh
# if this fails, you need to put SSH on the path
SSH for Windows
Windows does not include SSH by default. Two options are to 1) install Git locally and then use it’s SSH implementation and 2) install PuTTY.
Limitations
The file .bashrc
has a line at the end of it that maps the rails commands onto
the path along with library linkage as well. This messes up some local commands
nano
and others. One solution is to comment out the line and re-log into the
VM.
Other vagrant commands
vagrant destroy
eliminate the virtual machine so next time it will be rebuiltvagrant reload
combination of of halt then upvagrant suspend
pause machine copying state to disk, resume withvagrant resule
`
Leave a comment