$mkdir vagrant_www/www -p
$cd vagrant_www
$echo "<h1>Hello from a Vagrant VM</h1>" > www/index.html
$vagrant init
$vagrant box add precise64 http://files.vagrantup.com/precise64.box
$vagrant up
$vagrant ssh
$cd /vagrant
$sudo python -m SimpleHTTPServer 80
In host browser: http://localhost:8080
$vagrant suspend
$vagrant status
$vagrant up
OR
$vagrant resume
up:- this will do proper boot sequence depending on state of machine, even if it isn't suspended
resume:- will show an error if machine isn't suspended
$vagrant halt --force
$vagrant destroy --force
$vagrant up
$vagrant ssh
$sudo apt-get udpate
$sudo apt-get install apache2 -y
$sudo rm -rf /var/www
> change `/var/www` to be a symbolic link to the default shared folder
$sudo ln -s /vagrant /var/www
$logout
$echo "<strong>Hello!</strong>" > index.html
$vagrant reload
$vagrant ssh
%free -m
Version 1
$vagrant package --output vagrant_example.box
Version 2
When you package a box, the box name has to be the specific machine name that you can get from VirtualBox (e.g. lucid_1372711888). Just execute following command in cmd:
vboxmanage list vms
Notice that "vboxmanage" should prior be added to PATH variable. See here how to do that.
Also notice that virtual maschine name must not contain spaces. Otherwise it won't be recognized by "vagrant package" command. For instance:
vagrant package --base scotch-box_default_1444817558360_40202
vboxmanage list runningvms | sed -r 's/.*\{(.*)\}/\1/' | xargs -L1 -I {} VBoxManage controlvm {} savestate