On Friday, December 4, 2015 at 6:36:09 AM UTC-5, Alvaro Miranda Aguilera wrote: > > Hello Kiran. > > Let's do a tutorial together, very slowly. > > I see you want to learn, and something is not working, so I will help you > as much as I can. > > A. Managing Boxes with Vagrant > B. Connecting to Vagrant boxes. SSH and CLI > C. Adding networking interfaces to Vagrant > > Let's do them slowly: > > A. Managing Boxes with Vagrant > > The correct way (The Vagrant way) is use Vagrant, and not the Virtualbox > Gui. > > If you want to use the Virtualbox Gui, then you can just use Virtualbox > Templates and not use Vagrant all. > > In the other way around, Vagrant provide many cool features, that I think > you will end using Vagrant more than the Virtualbox Console. > > A.1 Create a Box > > I am using OSX here, and I have deleted all the Virtual machines, so my > Virtualbox manager looks like this: > > > Vagrant does things automatically and will use VirtualBox command line > tools to import a template, create/clone disk, etc. > > If at the moment the VM start doesn't show up in the VirtualBox gui, trust > me, is not a vagrant problem is a issue with the Virtualbox tool. > > So, the most simple way of create a new box is like this: > > Alvaros-Mini:t kikitux$ mkdir kiran > > Alvaros-Mini:t kikitux$ cd kiran > > Alvaros-Mini:kiran kikitux$ vagrant init -m hashicorp/precise64 > > A `Vagrantfile` has been placed in this directory. You are now > > ready to `vagrant up` your first virtual environment! Please read > > the comments in the Vagrantfile as well as documentation on > > `vagrantup.com` for more information on using Vagrant. > > Alvaros-Mini:kiran kikitux$ vagrant up --provider=virtualbox > > Bringing machine 'default' up with 'virtualbox' provider... > > *==> default: Importing base box 'hashicorp/precise64'...* > > *==> default: Matching MAC address for NAT networking...* > > *==> default: Checking if box 'hashicorp/precise64' is up to date...* > > *==> default: Setting the name of the VM: > kiran_default_1449228244214_84829* > > *==> default: Clearing any previously set network interfaces...* > > *==> default: Preparing network interfaces based on configuration...* > > default: Adapter 1: nat > > *==> default: Forwarding ports...* > > default: 22 (guest) => 2222 (host) (adapter 1) > > *==> default: Booting VM...* > > *==> default: Waiting for machine to boot. This may take a few minutes...* > > default: SSH address: 127.0.0.1:2222 > > default: SSH username: vagrant > > default: SSH auth method: private key > > default: Warning: Remote connection disconnect. Retrying... > > default: > > default: Vagrant insecure key detected. Vagrant will automatically > replace > > default: this with a newly generated keypair for better security. > > default: > > default: Inserting generated public key within guest... > > default: Removing insecure key from the guest if it's present... > > default: Key inserted! Disconnecting and reconnecting using new SSH > key... > > *==> default: Machine booted and ready!* > > *==> default: Checking for guest additions in VM...* > > default: The guest additions on this VM do not match the installed > version of > > default: VirtualBox! In most cases this is fine, but in rare cases it > can > > default: prevent things such as shared folders from working properly. > If you see > > default: shared folder errors, please make sure the guest additions > within the > > default: virtual machine match the version of VirtualBox you have > installed on > > default: your host and reload your VM. > > default: > > default: Guest Additions Version: 4.2.0 > > default: VirtualBox Version: 5.0 > > *==> default: Mounting shared folders...* > > default: /vagrant => /Users/kikitux/Downloads/t/kiran > > Alvaros-Mini:kiran kikitux$ > > > > Then the Virtualbox GUI looks like this: > > > > > At this point you may be asking of the nice windows where you can type > commands directly on the VM, that will be covered in B2 > > > > A2 Restart a vm > > vagrant reload > > A3 Shutdown a vm > > vagrant halt > > A4. Start a shutdown vm > > vagrant up > > > B. Connecting to Vagrant boxes. SSH and CLI > > To connect to this Vagrant box, as a remote server you can use ssh > > Vagrant have a convenient option that is > > vagrant ssh > > Alvaros-Mini:kiran kikitux$ vagrant ssh > > Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64) > > > * Documentation: https://help.ubuntu.com/ > > New release '14.04.3 LTS' available. > > Run 'do-release-upgrade' to upgrade to it. > > > Welcome to your Vagrant-built virtual machine. > > Last login: Fri Dec 4 11:28:44 2015 from 10.0.2.2 > > vagrant@precise64:~$ logout > > Connection to 127.0.0.1 closed. > > Alvaros-Mini:kiran kikitux$ > > > however if you want to use your cool tool, say putty, or use SFTP/SCP, etc > you can connect using the port where SSH is redirected. > > > Alvaros-Mini:kiran kikitux$ vagrant ssh-config > > Host default > > HostName 127.0.0.1 > > User vagrant > > Port 2222 > > UserKnownHostsFile /dev/null > > StrictHostKeyChecking no > > PasswordAuthentication no > > IdentityFile > /Users/kikitux/Downloads/t/kiran/.vagrant/machines/default/virtualbox/private_key > > IdentitiesOnly yes > > LogLevel FATAL > > > Alvaros-Mini:kiran kikitux$ > > > > Alvaros-Mini:kiran kikitux$ ssh -p 2222 -l vagrant localhost -i > /Users/kikitux/Downloads/t/kiran/.vagrant/machines/default/virtualbox/private_key > > The authenticity of host '[localhost]:2222 ([127.0.0.1]:2222)' can't be > established. > > ECDSA key fingerprint is > SHA256:+zgKqxyYlTBxVO0xtTVGBokreS9Zr71wQGvnG/k2igw. > > Are you sure you want to continue connecting (yes/no)? yes > > Warning: Permanently added '[localhost]:2222' (ECDSA) to the list of known > hosts. > > Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64) > > > * Documentation: https://help.ubuntu.com/ > > New release '14.04.3 LTS' available. > > Run 'do-release-upgrade' to upgrade to it. > > > Welcome to your Vagrant-built virtual machine. > > Last login: Fri Sep 14 06:23:18 2012 from 10.0.2.2 > > vagrant@precise64:~$ logout > > Connection to localhost closed. > > B2. Using the GUI. > > Here the vagrant way is modify the Vagranfile and Tell Vagrant you want to > use the GUI > > > So you can modify the Vagrantfile from: > > > Alvaros-Mini:kiran kikitux$ cat Vagrantfile > > Vagrant.configure(2) do |config| > > config.vm.box = "hashicorp/precise64" > > end > > > TO: > > > Alvaros-Mini:kiran kikitux$ cat Vagrantfile > > Vagrant.configure(2) do |config| > > config.vm.box = "hashicorp/precise64" > > config.vm.provider "virtualbox" do |v| > > v.gui = true > > end > > end > > Alvaros-Mini:kiran kikitux$ > > > Then, reload the VM > > > vagrant reload > > > and Vagrant will give you the GUI console you were after: > > > > > > > C. Adding networking interfaces to Vagrant > > > a private network > > config.vm.network "private_network", type: "dhcp" > a public network > config.vm.network "public_network" > > So Vagrantfile will look like this: > > Vagrant.configure(2) do |config| > > config.vm.box = "hashicorp/precise64" > > config.vm.provider "virtualbox" do |v| > > v.gui = true > > end > > config.vm.network "private_network", type: "dhcp" > > config.vm.network "public_network" > > end > > > Then vagrant reload > > > Thanks a lot for all the trouble. My issue, is not how to do it, but the real issue is it gives an error when it should not. Previously, I had no issue.
when I added the network and vagrant reload, this is what i get C:\vagrant\precise64>vagrant reload *==> default: Attempting graceful shutdown of VM...* *==> default: Checking if box 'hashicorp/precise64' is up to date...* *==> default: Clearing any previously set forwarded ports...* *==> default: Fixed port collision for 22 => 2222. Now on port 2200.* *==> default: Clearing any previously set network interfaces...* *==> default: Preparing network interfaces based on configuration...* * default: Adapter 1: nat* * default: Adapter 2: hostonly* * default: Adapter 3: bridged* *==> default: Forwarding ports...* * default: 22 => 2200 (adapter 1)* *==> default: Booting VM...* *==> default: Waiting for machine to boot. This may take a few minutes* *The guest machine entered an invalid state while waiting for it* *to boot. Valid states are 'starting, running'. The machine is in the* *'poweroff' state. Please verify everything is configured* *properly and try again.* *If the provider you're using has a GUI that comes with it,* *it is often helpful to open that and watch the machine, since the* *GUI often has more helpful error messages than Vagrant can retrieve.* *For example, if you're using VirtualBox, run `vagrant up` while the* *VirtualBox GUI is open.* *The primary issue for this error is that the provider you're using* *is not properly configured. This is very rarely a Vagrant issue. * I will look other things e.g the sp of windows 7, or cpu of my machine, etc. Not sure,what is causing the issue. Once again, I really appreciate your help. Thanks Kiran Also, when I tried to start/restart, it does gave the same error I posted you before, the mac > More information and options available here: > > https://docs.vagrantup.com/v2/ > > > Alvaro > > > > > On Fri, Dec 4, 2015 at 1:24 AM, Kiran Sharma <[email protected] > <javascript:>> wrote: > >> ==> default: which network to bridge to. >> ==> default: Preparing network interfaces based on configuration... >> default: Adapter 1: nat >> default: Adapter 2: bridged >> ==> default: Forwarding ports... >> default: 22 => 2200 (adapter 1) >> ==> default: Running 'pre-boot' VM customizations... >> ==> default: Booting VM... >> ==> default: Waiting for machine to boot. This may take a few minutes... >> The guest machine entered an invalid state while waiting for it >> to boot. Valid states are 'starting, running'. The machine is in the >> 'poweroff' state. Please verify everything is configured >> properly and try again. >> >> If the provider you're using has a GUI that comes with it, >> it is often helpful to open that and watch the machine, since the >> GUI often has more helpful error messages than Vagrant can retrieve. >> For example, if you're using VirtualBox, run `vagrant up` while the >> VirtualBox GUI is open. >> >> The primary issue for this error is that the provider you're using >> is not properly configured. This is very rarely a Vagrant issue. >> >> As I said, the problem is not resolved. I can not create another adapter, >> nor I can changed the NAT to bridge. In summary >> >> >> 1. creation of machine works sometime, but not always >> 2. the machine does not appear into virtualbox console automatically, so >> I can ssh but can not stop or start >> 3. I can make the box appear on console by non standard way( which read >> somewhere else) >> 4. No network change by any way, even changing the vagrantfile and >> reloading it >> >> If there is anything I can provide you, it would be happy in regards to >> resolve this issue. >> >> Thanks a lot >> Kiran >> >> >> On Thursday, December 3, 2015 at 3:24:39 AM UTC-5, Alvaro Miranda >> Aguilera wrote: >>> >>> How are you doing these changes? >>> >>> The way of doing with Vagrant is update the Vagrantfile and then do a >>> vagrant reload. >>> >>> Alvaro. >>> >>> >>> On 3/12/2015, at 6:05 PM, Kiran Sharma <[email protected]> wrote: >>> >>> Do you mean not showing in the virtualbox console is fine? Also, I can >>> not change the network adapter to bridge or add in addition to the nat >>> which is created while propositioning the machine. >>> >>> Based on what I used to do, it is not resolved. I can only create >>> machine with nat adapter nothing else. when I changed network adapter to >>> bridge, and restart the interface, I got this >>> >>> e1000 0000:01:03.0: eth0: Detected Tx Unit Hang >>> Tx Queue <0> >>> TDH <bd> >>> TDT <bd> >>> next_to_use <bd> >>> next_to_clean <73> >>> >>> >>> >>> -- >> This mailing list is governed under the HashiCorp Community Guidelines - >> https://www.hashicorp.com/community-guidelines.html. Behavior in >> violation of those guidelines may result in your removal from this mailing >> list. >> >> GitHub Issues: https://github.com/mitchellh/vagrant/issues >> IRC: #vagrant on Freenode >> --- >> You received this message because you are subscribed to the Google Groups >> "Vagrant" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/vagrant-up/24c1b4a6-b383-4c73-a267-79aff4136458%40googlegroups.com >> >> <https://groups.google.com/d/msgid/vagrant-up/24c1b4a6-b383-4c73-a267-79aff4136458%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/81e2a1cf-40e9-4ddf-99e1-581b464e4766%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
