Class: Vagrant::Guest::Ubuntu

Inherits:
Debian show all
Defined in:
lib/vagrant/guest/ubuntu.rb

Instance Attribute Summary

Attributes inherited from Base

#vm

Instance Method Summary collapse

Methods inherited from Debian

#configure_networks

Methods inherited from Linux

#distro_dispatch, #halt, #initialize, #mount_nfs

Methods inherited from Base

#configure_networks, #distro_dispatch, #halt, #initialize, #mount_nfs

Constructor Details

This class inherits a constructor from Vagrant::Guest::Linux

Instance Method Details

#change_host_name(name) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/vagrant/guest/ubuntu.rb', line 14

def change_host_name(name)
  if !vm.channel.test("sudo hostname | grep '#{name}'")
    vm.channel.sudo("sed -i 's/.*$/#{name}/' /etc/hostname")
    vm.channel.sudo("sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
    vm.channel.sudo("service hostname start")
  end
end

#mount_shared_folder(name, guestpath, options) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/vagrant/guest/ubuntu.rb', line 6

def mount_shared_folder(name, guestpath, options)
  # Mount it like normal
  super

  # Emit an upstart event if upstart is available
  vm.channel.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
end