lost and found ( for me ? )

Ubuntu 14.04 : install the latest version of vagrant and use vagrant-libvirt plugin for libvirtd

Here are logs when installing the latest version of vagrant and use libvirtd as its hypervisor.

Reference
https://github.com/pradels/vagrant-libvirt

[ libvirtd ]

edit libvirtd.conf so that users belong to a group ‘libvirtd’ can use vagrant-libvirt.

# egrep '^unix_sock|^auth_unix' /etc/libvirt/libvirtd.conf
unix_sock_group = "libvirtd"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"

# groupadd -G libvirtd -a foo01

[ install vagrant ]

install the latest version, because vagrant shipped with Ubuntu(apt-get) t is a little bit old and vagrant <= 1.4 does not support vagrant-libvirt.

$ sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev libvirt-dev

$ sudo dpkg -i vagrant_1.7.2_x86_64.deb

$ vagrant -v
Vagrant 1.7.2

$ vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Installed the plugin 'vagrant-libvirt (0.0.29)'!

$ vagrant plugin install vagrant-mutate
Installing the 'vagrant-mutate' plugin. This can take a few minutes...
Installed the plugin 'vagrant-mutate (1.0.0)'!

$ vagrant box add trusty64 https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Adding box 'trusty64' (v0) for provider:
   box: Downloading: https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Successfully added box 'trusty64' (v0) for 'virtualbox'!

$ vagrant box list
trusty64 (virtualbox, 0)

convert
$ vagrant mutate trusty64 libvirt
Converting trusty64 from virtualbox to libvirt.
   (100.00/100%)
The box trusty64 (libvirt) is now ready to use.

$ vagrant box list
trusty64 (libvirt, 0)
trusty64 (virtualbox, 0)

initialize the project.
$ vagrant init trusty64

$ grep -v '#' Vagrantfile  | grep -v ^$
Vagrant.configure(2) do |config|
 config.vm.box = "trusty64"
end

start the VM.
$ vagrant up --provider=libvirt
Bringing machine 'default' up with 'libvirt' provider...
==> default: Uploading base box image as volume into libvirt storage...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...

access to the VM.
$ vagrant ssh
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-53-generic x86_64)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.