In this tutorial you will learn how to install ubuntu-precise32 and ubuntu-trusty32 in Vagrant on Linux Mint/Ubuntu Desktop.
We will explore the content of the Vagrant home directory and VirtualBox VMs and you will see how to create, init and start a Vagrant project using the previous and latest Ubuntu Server operating system Vagrant box version.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# Vagrant Install ubuntu-precise32 and ubuntu-trusty32 on Linux Mint/Ubuntu Desktop # Switched to using Vagrant in host OS # Less memory, more download and running speed and avoid problems (such as when using "vagrant suspend" command) # Open Oracle VM VirtualBox Manager # Explore Vagrant home directory tree -h ~/.vagrant.d/ # Create Vagrant project dir mkdir ~/vagrant mkdir ~/vagrant/ubuntu-precise32 cd ~/vagrant/ubuntu-precise32/ # Create an initial Vagrantfile if one doesn't already exist vagrant init ubuntu/precise32 ls -al # Describe the type of machine required for a project, and how to configure and provision these machines # Vagrant is meant to run with one Vagrantfile per project # Vagrantfile is supposed to be committed to version control vi Vagrantfile config.vm.box = "ubuntu/precise32" # Creates and configures guest machines according to your Vagrantfile # If you didn't downloaded the box before using "vagrant box add" this command will do it for you vagrant up --provider virtualbox vagrant up # Timed out while waiting for the machine to boot. This means that # Vagrant was unable to communicate with the guest machine within # the configured ("config.vm.boot_timeout" value) time period. # # If you look above, you should be able to see the error(s) that # Vagrant had when attempting to connect to the machine. These errors # are usually good hints as to what may be wrong. # # If you're using a custom box, make sure that networking is properly # working and you're able to connect to the machine. It is a common # problem that networking isn't setup properly in these boxes. # Verify that authentication configurations are also setup properly, # as well. # # If the box appears to be booting properly, you may want to increase # the timeout ("config.vm.boot_timeout") value. vi Vagrantfile # As of http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying config.vm.provider "virtualbox" do |vb| # 1 # Display the VirtualBox GUI when booting the machine vb.gui = true # 2 # As of https://github.com/mitchellh/vagrant/issues/3860 ### Change network card to PCnet-FAST III # For NAT adapter vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"] # For host-only adapter vb.customize ["modifyvm", :id, "--nictype2", "Am79C973"] end # 3 # The time in seconds that Vagrant will wait for the machine to boot and be accessible config.vm.boot_timeout = 600 vagrant up # SSH into a running Vagrant machine and give you access to a shell # Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-97-virtual i686) # New release '14.04.3 LTS' available. vagrant ssh # Shutdown VM sudo poweroff # Create Vagrant project mkdir -p ~/vagrant/ubuntu-trusty32 cd ~/vagrant/ubuntu-trusty32/ cp ../ubuntu-precise32/Vagrantfile ./ vi Vagrantfile config.vm.box = "ubuntu/trusty32" vagrant up # Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-74-generic i686) vagrant ssh sudo poweroff # VirtualBox machines ls -al ~/VirtualBox\ VMs/ # Useful links https://docs.vagrantup.com/v2/cli/init.html https://docs.vagrantup.com/v2/vagrantfile/ https://docs.vagrantup.com/v2/cli/up.html http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying https://github.com/mitchellh/vagrant/issues/3860 https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html https://docs.vagrantup.com/v2/cli/ssh.html |
Useful links:
https://docs.vagrantup.com/v2/cli/init.html
https://docs.vagrantup.com/v2/vagrantfile/
https://docs.vagrantup.com/v2/cli/up.html
http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying
https://github.com/mitchellh/vagrant/issues/3860
https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html
https://docs.vagrantup.com/v2/cli/ssh.html