Vagrant on Ubuntu 12.04 – Create and Boot New Virtual Machine in Minutes – apt-get install vagrant

Vagrant quickly creates a new virtual machine. Settings like automated ssh login and sudo are handled automatically.
To follow this artice, you should be familiar with command line, apt-get and ssh.

First Time Setup

$ sudo apt-get -y install vagrant
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box

Takes 5-10 minutes to download the image.

Creating a New Virtual Machine & SSH Login

$ vagrant init lucid32
$ vagrant up
$ vagrant ssh

Vagrant greeted me with Ubuntu 10.04 login screen on the guest operating system. Vagrant automatically sets up openssh-server, ssh pubkey login and sudo without password (on the guest OS). For example, I could immediately use ‘sudo apt-get update; sudo apt-get install trash-cli’.

What’s Next?

Set web development environment on Vagrant – stay tuned for a new article.

Troubleshooting

“A Vagrant environment is required to run this command. Run `vagrant init` to set one up.” You should run ‘vagrant ssh’ in the folder where your Vagrantfile is. Change folder show that ‘ls’ shows Vagrantfile, then run ‘vagrant ssh’ again.
Update 2013-03-28: I want to use Ubuntu 12.04 LTS. Answer:

$ vagrant box add precise32 http://files.vagrantup.com/precise32.box
$ vagrant init precise32
$ vagrant up
$ vagrant ssh

See also

Hashimoto and Bender 2012: Getting Started with Vagrant

Admnistrivia

Tested on xUbuntu 12.04 precise beta 32bit, Linux 3.2.0-18-generic-pae, vagrant 0.9.5-1, virtualbox 4.1.8-dfsg-2.
Briefly in Finnish: Asenna valmiiksi säädettyjä virtuaalikoneita Vagrantilla.

Posted in Uncategorized | Tagged , , , , , , , , | 3 Comments

3 Responses to Vagrant on Ubuntu 12.04 – Create and Boot New Virtual Machine in Minutes – apt-get install vagrant

  1. Niko Kiuru says:

    Nowadays virtualbox is one of vagrant package’s suggest.
    $ sudo apt-get -y install vagrant virtualbox
    or
    $ sudo apt-get –install-suggests install vagrant

  2. Niko Kiuru says:

    I have also article, how to run multiple vagrants virtual machines at same time.

  3. Niko Kiuru says:

    My blog link somehow deleted on last post, cause I trying to use your “a href” -tag.
    Url is: http://nikokiuru.com/2013/11/vagrant-boot-multiple-virtual-machines