Setup Vagrant with VMWare and Ubuntu
Vagrant is a very handy command-line tool for managing virtual machines (VMs) and orchestrating consistent developer environments across a team of developers.
By default, Vagrant uses Virtualbox VMs. However, it can integrate with other VM providers, as well.
I’ve been a huge fan of VMWare for more than a decade now. I really like it. It always felt cleaner and snappier than alternatives, to me. At least some industry analysis seem to agree that it may be the fastest VM enclosure available.
Unfortunately, setting up Vagrant with VMWare isn’t very straight-forward. Information for various steps is scattered across multiple documentation pages. It took a while for me to piece everything together. In the hopes of saving that time for the next person, I decided to write this blog post.
To use Vagrant with VMWare, it’s not sufficient to have VMWare license (which you may already have). You need to also purchase a license for VMWare/Vagrant plugin. At the time of this writing, it costs a hefty $79. Once you purchase the license for the plugin, you get license.lic file. We will be using that file in our installation steps.
Following is a log of installation steps. It should be pretty self-explanatory. We first
- Install vagrant-vmware-fusion plugin, then:
- Install the license,
- List plugins list to verify successful installation
- Download Ubuntu12 vm box for VMware
- Create an instance of Ubuntu12/VMware box, with “init”.
- Launch the newly minted vagrant box with “up”.
$ vagrant plugin install vagrant-vmware-fusion Installing the 'vagrant-vmware-fusion' plugin. This can take a few minutes... Installed the plugin 'vagrant-vmware-fusion (2.3.2)'! $ vagrant plugin license vagrant-vmware-fusion license.lic Installing license for 'vagrant-vmware-fusion'... The license for 'vagrant-vmware-fusion' was successfully installed! $ vagrant plugin list vagrant-vmware-fusion (2.3.2) $ vagrant box add vmwareubuntu12 http://files.vagrantup.com/precise64_vmware.box Downloading box from URL: http://files.vagrantup.com/precise64_vmware.box Extracting box...te: 3485k/s, Estimated time remaining: 0:00:01) Successfully added box 'vmwareubuntu12' with provider 'vmware_fusion'! $ vagrant init vmwareubuntu12 A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant. $ vagrant up --provider=vmware_fusion Bringing machine 'default' up with 'vmware_fusion' provider... [default] VMware requires root privileges to make many of the changes necessary for Vagrant to control it. In a moment, Vagrant will ask for your administrator password in order to install a helper that will have permissions to make these changes. Note that Vagrant itself continues to run without administrative privileges. Password: [default] Cloning VMware VM: 'vmwareubuntu12'. This can take some time... [default] Verifying vmnet devices are healthy... [default] Preparing network adapters... [default] Starting the VMware VM... [default] Waiting for the VM to finish booting... [default] The machine is booted and ready! [default] Forwarding ports... [default] -- 22 => 2222 [default] Configuring network adapters within the VM... [default] Waiting for HGFS kernel module to load... [default] Enabling and configuring shared folders... [default] -- /Users/irakli/vagrants: /vagrant
Once the new Vagrant machine with Ubuntu is successfully up and running, you can ssh into it, by simply typing:
$ vagrant ssh Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-virtual x86_64) * Documentation: https://help.ubuntu.com/ Last login: Wed Feb 26 13:48:53 2014 vagrant@precise64:~$