- Host: Mac OS X El Capitan 10.11.4
- Virtualization Providers: VirtualBox 5.0.18, VMware Fusion 7.1.3
- Packer^ ~> 0.10.0
- Vagrant ~> 1.8.1
(^) Packer is required to build the custom Ubuntu 14.04/16.04 LTS image.
- sets the virtual machine to use Europe/London (aka GMT) as your time zone (in
packer/preseed/preseed.cfg
) - defaults to an admin user,
vagrant
(inpacker/template.json
) - applies no password in sudoers for
vagrant
user (inpacker/provisioning/sudoers.sh
) - in Ubuntu 16.04, disables systemd's PredictableNetworkInterfaceNames to work with
vagrant
(inpacker/provisioning/networking_fix.sh
)
You can switch from systemd
to Upstart on Ubuntu 16.04 by performing the following commands:
sudo apt-get install upstart-sysv
sudo update-initramfs -u
cp packer/template.json.example packer/template.json
Note: packer/template.json.example
is based on Packer 0.6.0
.
cpu_cores
: 4 coresmemory
: 4096 MBdisk_size
: 20140 MB
- Run
cp Vagrantfile.example Vagrantfile
or create and define your own. - Configure and uncomment recipes that you want to cook.
- Optionally create your own recipes and place in the
cookbooks/custom
directory
When you're ready, run the following depending on your target virtualization provider:
rake virtualbox:build_and_provision
rake vmware:build_and_provision
vagrant up # starts vagrant
vagrant provision # provisions vm (without restarting)
vagrant ssh # SSH into vagrant
vagrant reload # restarts vagrant
vagrant halt # stops vagrant
vagrant status # check to see if vm is running
On your virtual machine, edit /etc/ssh/sshd_config
and add the following:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Restart the ssh service. Your host machine will need an X11 client. For example, on Mac OS X, you can use XQuartz. Then simply run from your terminal:
vagrant ssh -- -X
The X
flag enables X11 forwarding for the SSH session. Inside your virtual machine, run the idea.sh
script from the IntelliJ directory and it should launch an XQuartz
instance automagically on your host.
- If your vm cannot connect to the internet (this typically happens when you switch from one network to another on a VirtualBox vm), run this command:
sudo dhclient
-
You received the message: "Error creating VM: VBoxManage error: VBoxManage: error: Machine settings file <path_to_vbox> already exists". Installation was left in a bad state. Open VirtualBox, stop and remove the existing VM. Delete this vbox in your VirtualBox directory and re-run the command that failed.
-
On VMware, if HGFS kernel module could not be found, you'll need to re-install VMwareTools. Follow the instructions in the README.
-
You received the message: "Shared folders that Chef requires are missing on the virtual machine. This is usually due to configuration changing after already booting the machine. The fix is to run a
vagrant reload
so that the proper shared folders will be prepared and mounted on the VM." Read the workaround solution here.
Some things taken from boxcutter/ubuntu repo. Thanks guys!