http://aruizca.com/steps-to-create-a-vagrant-base-box-with-ubuntu-14-04-desktop-gui-and-virtualbox/
https://stackmachine.com/blog/building-a-vagrant-base-box-with-packer
https://docs.vagrantup.com/v2/virtualbox/configuration.html
set USER and PASSWORD define vagrant
set PASSWORD root define vagrant
$ sudo apt-get install dkms $ sudo apt-get install -y build-essential linux-headers-server
$ sudo mount /dev/cdrom /media/cdrom $ sudo /media/cdrom/VBoxLinuxAdditions.run $ sudo umount /media/cdrom $ sudo apt-get clean $ sudo /etc/init.d/vboxadd setup $ sudo apt-get update -y
$ sudo echo "vagrant ALL=NOPASSWD:ALL" >> /etc/sudoers.d/vagrant $ sudo chmod 0440 /etc/sudoers.d/vagrant
$ mkdir ~/.ssh $ wget -qO- https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub >> ~/.ssh/authorized_keys # Ensure we have the correct permissions set $ chmod 0700 /home/vagrant/.ssh $ chmod 0600 /home/vagrant/.ssh/authorized_keys $ chown -R vagrant /home/vagrant/.ssh
$ sudo apt-get install -y openssh-server $ sudo vi /etc/ssh/sshd_config
Port 22 PubKeyAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys PermitEmptyPasswords no
$ sudo service ssh restart
Run Gedit as root (gksu gedit).
Open /etc/default/grub
and locate the following lines:
GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true
Change the values as follows:
GRUB_HIDDEN_TIMEOUT=10 GRUB_HIDDEN_TIMEOUT_QUIET=false
Save and run sudo update-grub
from your terminal and reboot
.
Asuming you already have Vagrant installed in the host system, just run the following command:
$ vagrant package –-base <VitualBox VM Name>
$ vagrant box add {boxname} package.box
$ vagrant init {boxname}
To show window VM
config.vm.provider "virtualbox" do |v| v.gui = true end
$ vagrant up
ERROR: The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! /sbin/ip addr flush dev eth1 2> /dev/null Stdout from the command: Stderr from the command: stdin: is not a tty SOLUTION: Ssh into the machine Delete the file /etc/udev/rules.d/70-persistent-net.rules Exit the machine Do a "vagrant reload" I think that does the trick =]