Skip to content

Instantly share code, notes, and snippets.

@krasio
Forked from petyosi/new-vm.textile
Created December 14, 2011 14:03
Show Gist options
  • Save krasio/1476672 to your computer and use it in GitHub Desktop.
Save krasio/1476672 to your computer and use it in GitHub Desktop.
Instructions on setting up new work VM.

Installation

  • Update your VirtualBox
  • Download ubuntu LTS server (64 bit)
  • name “garmz-dev”
  • Run default installation from the downloaded iso in new VM
    • hostname “garmz-dev”
    • Don’t encrypt home
    • No automatic updates
    • Pick OpenSSH server and PostgreSQL server
    • Complete, shutdown, remove CD

Configure SSH port forwarding (execute on host machine)


VBoxManage modifyvm "garmz-dev" --natpf1 "rails,tcp,,3000,,3000"
VBoxManage modifyvm "garmz-dev" --natpf1 "guestssh,tcp,,2222,,22"
echo "Host vm
ForwardX11 yes
Hostname localhost
Port     2222
User     petyo" >> ~/.ssh/config
VBoxHeadless --startvm "garmz-dev"
rsync -av ~/.ssh/ vm:.ssh

In terminal, ^⌘k ssh vm – should let you in

System setup

sudo -s
export EDITOR=vim
visudo
Gi petyo   ALL=(ALL) NOPASSWD: ALL
:wq
^D
sudo apt-get upgrade

Install needed stuff

sudo apt-get install git-core zsh curl exuberant-ctags ack-grep libpq-dev libxml2-dev libxslt-dev redis-server firefox
# fix ack
sudo ln -sf /usr/bin/ack-grep /usr/bin/ack

Shell/screen config

sudo mkdir /w/
sudo chown petyo:petyo /w/
cd /w/
git clone https://github.com/underlog/config_files.git
cd config_files; ./install.sh
# change default shell
chsh -s /bin/zsh
# logout, SSH again.
# at this point, you have screen, switch to it
screen

Configure git

cd
vim .gitconfig # ignore the warning of vim, we will get to it.  

[github] 
    user = ****
    token = ***
[user] 
    name = **** 
    email = ****

vim .netrc # add your github account here
machine github.com
login *****
password ******

Configure vim

cd 
mkdir .vim
mkdir .vimbackup
cd .vim
git init .
git remote add origin https://github.com/underlog/vimfiles.git
git fetch origin
git co petyo
git submodule init
git submodule update

Ruby

Use brightbox repos for REE


sudo -s
wget http://apt.brightbox.net/release.asc -O - | sudo apt-key add -
echo 'deb http://apt.brightbox.net/ lucid rubyee' >> /etc/apt/sources.list.d/brightbox-rubyee.list
apt-get update
apt-get install ruby1.8 ruby1.8-dev libopenssl-ruby1.8 irb ruby 
cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xfv rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -sf /usr/bin/gem1.8 /usr/bin/gem
gem install bundler
^D # exit sudo

Checkout project

Bundle install

In my case I need these:

Setup databases

sudo su - postgres 
createuser -s petyo
^D
psql template1
ALTER USER petyo WITH PASSWORD '*****';

Run specs

Run cucumber

You may have to close ssh and open again. Try running firefox to see if it will hook up on X11 forwarding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment