Hello World from OSS Silicon Valley
HowToUse/Vagrant/1.6
_ Prerequisite
- Virtual Box (You can refer HowToUse/VirtualBox/4.3)
_ Install&Setup
- Step.1
- Download and runinstaller.
https://www.vagrantup.com/downloads
- Step.2
- Click Next button.
- Step.3
- Check the accept and click next button.
- Step.4
- Choose install folder and click next button.
- Step.5
- Choose install folder and click finish button.
_ HowToUse
_ Create Vagrantfile
- Step.1
- Execute the following command to create init file.
$ vagrant init <Guest OS name> <box file path>
Example
$ vagrant init centos-6-x64 http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box
Puppet Labs Vagrant Boxes http://puppet-vagrant-boxes.puppetlabs.com/
Chef Bento project https://github.com/opscode/bento
- Step.2
- Edit Vagrantfile which is created by vagrant init as needed
$ vi Vagrantfile
_ Launch guestOS from command line
- Step.1
- Launch guest OS. In the first launch, vagrant download box file to remote server, but after it, vagrant try to launch guest OS with the local virtual box file. Initial root password is "vagrant".
$ vagrant up
- Step.3
- Connect to guest OS from command line.
$ vagrant ssh
- Step.5
- Shutdown guest OS.
$ vagrant halt
_ Launch guestOS from GUI (Virtual Box)
- Step.1
- Launch vagrant.
$ vagrant up
- Step.2
- Connect with terminal.
$ vagrant ssh
- Step.3
- Change user to root. The initial password for root is "vagrant".
$ su - root
- Step.4
- Install X WIndow System and Desktop utilities.
# yum -y groupinstall "X Window System" "Desktop" "General Purpose Desktop"
- Step.5
- Change the inittab.
# vi /etc/inittab
(Before)
id:3:initdefault:
(After)
id:5:initdefault:
- Step.6
- Shutdown the system.
(Exit from root)
# exit
(Exit from vagrant ssh)
$ exit
(Shutdown guest OS)
$ vagrant halt
- Step.7
- Edit Vagrantfile as follows.
config.vm.provider :virtualbox do |vb| # Don't boot with headless mode vb.gui = true # # # Use VBoxManage to customize the VM. For example to change memory: # vb.customize ["modifyvm", :id, "--memory", "1024"] end
- Step.8
- Launch guest OS and GUI will be show up.
$ vagrant up
_ Enable ssh access to guest server
- Step.1
- Edit Vagrant file.
$ vi Vagrant
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # xxx config.vm.network "private_network", ip: "192.168.33.10" # xxx
- Step.2
- Reboot Vagrant then you can access via ssh specifying IP address. (Default ID and password are "vagrant".)
$ vagrant halt $ vagrant up $ ssh 192.168.33.10
_ Author
S.Yatsuzuka
Attach file: install_fig1.png 213 download
[Information]
LaunchGuestOS_fig7.png 297 download
[Information]
install_fig2.png 240 download
[Information]
install_fig3.png 213 download
[Information]
install_fig5.png 210 download
[Information]
install_fig4.png 224 download
[Information]
LaunchGuestOS_fig6.png 184 download
[Information]
LaunchGuestOS_fig5.png 277 download
[Information]
LaunchGuestOS_fig1.png 274 download
[Information]
CreateInitFile_fig2.png 111 download
[Information]
LaunchGuestOS_fig2.png 252 download
[Information]
LaunchGuestOS_fig3.png 293 download
[Information]
LaunchGuestOS_fig4.png 227 download
[Information]
CreateInitFile_fig1.png 216 download
[Information]
Last-modified: 2015-08-17 (Mon) 02:41:34 (3175d)