~/Dropbox/Projects/Personal/vagrant ? vagrant init ubuntu-12-10 gogojimmy@MBPA `vagrantfile` has been placed in this directory. You are nowready to `vagrant up` your first virtual environment! Please readthe comments in the vagrantfile as well as documentation on`vagrantup.com` for more information on using Vagrant.
讓VM動起來
我們晚一點再提設定檔的部份,讓我們先把VM跑起來,要讓VM跑起來的指令是vagrant up
1234567891011121314151617181920
$ vagrant up gogojimmy@MBP[default] VM already created. Booting if it's not already running...[default] Clearing any previously set forwarded ports...[default] Forwarding ports...[default] -- 22 => 2222 (adapter 1)[default] Creating shared folders metadata...[default] Clearing any previously set network interfaces...[default] Booting VM...[default] Waiting for VM to boot. This can take a few minutes.[default] VM booted and ready for use![default] The guest additions on this VM do not match the install version ofVirtualBox! This may cause things such as forwarded ports, sharedfolders, and more to not work properly. If any of those things fail onthis machine, please update the guest additions and repackage thebox.Guest Additions Version: 4.1.18VirtualBox Version: 4.2.12[default] Mounting shared folders...[default] -- v-root: /vagrant
vagrant@vagrant-ubuntu-quantal-64:~$ exitlogoutConnection to 127.0.0.1 closed.------------------------------------------------------------$ vagrant package gogojimmy@JoycetekiMacBook-Pro[default] Attempting graceful shutdown of VM...[default] Clearing any previously set forwarded ports...[default] Creating temporary directory for export...[default] Exporting VM...[default] Compressing package to: /Users/gogojimmy/Dropbox/Projects/Personal/vagrant/package.box
$vagrantup[app]Importingbasebox'ubuntu-12-10'...[app]MatchingMACaddressforNATnetworking...[app]Clearinganypreviouslysetforwardedports...[app]Forwardingports...[app]--22=>2222(adapter1)[app]--80=>8080(adapter1)[app]Creatingsharedfoldersmetadata...[app]Clearinganypreviouslysetnetworkinterfaces...[app]Preparingnetworkinterfacesbasedonconfiguration...[app]RunninganyVMcustomizations...[app]BootingVM...[app]WaitingforVMtoboot.Thiscantakeafewminutes.[app]VMbootedandreadyforuse![app]Configuringandenablingnetworkinterfaces...[app]Settinghostname...[app]Mountingsharedfolders...[app]--v-root:/vagrant[db] Importing base box 'ubuntu-12-10'...[db] Matching MAC address for NAT networking...[db] Clearing any previously set forwarded ports...[db] Fixed port collision for 22 => 2222. Now on port 2200.[db] Fixed port collision for 22 => 2222. Now on port 2201.[db] Forwarding ports...[db] -- 22 => 2201 (adapter 1)[db] Creating shared folders metadata...[db] Clearing any previously set network interfaces...[db] Preparing network interfaces based on configuration...[db] Running any VM customizations...[db] Booting VM...[db] Waiting for VM to boot. This can take a few minutes.[db] VM booted and ready for use![db] Configuring and enabling network interfaces...[db] Setting host name...[db] Mounting shared folders...[db] -- v-root: /vagrant
$vagrantsshdbvagrant@db:~$ssh33.33.13.10Theauthenticityofhost'33.33.13.10 (33.33.13.10)'can't be established.ECDSA key fingerprint is a7:71:36:4c:01:4a:38:a2:fc:fa:ea:d7:67:63:3c:40.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '33.33.13.10' (ECDSA) to the list of known hosts.vagrant@33.33.13.10'spassword:vagrant@app:~$