Hiển thị các bài đăng có nhãn Vagrant. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Vagrant. Hiển thị tất cả bài đăng

Thứ Năm, 25 tháng 2, 2016

Creating the virtual machine using Vagrant

Note: for the examples below, you will need to have at least Vagrant version 1.8.1 installed on your local computer
And I setup ubuntu 14.04 64bit, with other os visit.

My Script: file name "Vagrantfile" (no extend )
Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  #config.vm.network "private_network", ip: "192.168.11.31"
  config.vm.network "public_network", ip: "192.168.11.31"

  config.vm.synced_folder "/Volumes/Lef/Ubuntu", "/home/vagrant/working", create: true 
  config.vm.provider "virtualbox" do |vb|
    vb.name = "ubuntu-trusty64"
    vb.gui = false
    vb.memory = 2048
    vb.cpus = 2
  end
  config.vm.provision "shell", inline: <<-SHELL
     sudo apt-get update
     sudo apt-get install -y whois git
     sudo useradd -m -p `mkpasswd password` -s /bin/bash madman
     sudo usermod -a -G sudo madman
  SHELL
end
Thanks!