After following the vagrant tutorial everything seems to be going fine. However something new and slightly annoying has started happening when I run vagrant up: VirtualBox also starts up and I see a VM window which seems to correspond to the Vagrant VM open. I've used Vagrant many times in the past without this happening, and IIRC even for this current vm that I'm using VirtualBox wouldn't necessarily open just because I ran vagrant up.
What is causing this? Why does vagrant up cause the VirtualBox VM window to appear? (and steal focus from my Mac OS X Terminal window, which is quite annoying)
Note: The answer in my case is not that Vagrant uses VirtualBox. If this were the case then VirtualBox would have always been opening in the background and I'm quite sure this is a new behaviour.
I see three possibilities:
In your Vagrantfile, you configured gui = True (see GUI vs Headless)
The box you use with Vagrant comes with gui = True setting in its Vagrantfile (Box contains initial Vagrantfile which is being merged when you do vagrant up)
Possible bug in Vagrant and/or VirtualBox
It could be helpful if you specify your Vagrant & VirtualBox versions, and share with us your Vagrantfile.
Related
I'm using vagrant inside the linux VM using VMWare and the hosted machine is windows-base. So it's a virtual machine inside a virtual machine.
So when I try to boot the vagrant box I got this error
When I google I couldn't able to find the exact solution for this but here in this question Vagrant up timeout #BrainC pointed out that enable GUI mode from vagrant config file it will give you better idea what exactly going wrong here. but still I couldn't able to find any cause of the problem!
So what's the really issue here... is it because of virtual-machine inside virtual-machine or it's something else.
UPDATE:
when i enabled gui option in vagrantfile gui opens it shows some error BUT IT happend so fast I couldn't able to see it, so I've recorded the screen and this is what i got
I am pretty new to vagrant. I have installed an ubuntu 14.04 trusty box on my vagrant and will use it for my web development environment. I want to know which is the best way to disable/close/shutdown a vagrant box so that data in it remain safe in the next session? I mean when I want to shutdown my laptop (in windows 10, my host machine os is win10) there is a message telling me that virtualbox interface is open. so if I close the process then I cant access vagrant box anymore. I want a good way to close vagrant and run it in my next working session.
I read about vagrant halt before host shutdown and using vagrant up in next session but it takes too long to run a vagrant up.
**summary : I WANT A WAY TO DO THIS:
1- close a vagrant box without a data loss in it;
2- shutdown my laptop without seeing the message that tells virtualbox interface is open.
3- run vagrant box and access it with putty as fast as possible when I start working again.
is there a way to do this?**
thanks.
I want to know which is the best way to disable/close/shutdown a vagrant box so that data in it remain safe in the next session
I would not necessarily to recommend vagrant halt which will completely stop your VM and will need to start up after you restart your host.
You can run vagrant suspend which will hold your data and you will retrieve your instance in the same state as it was before on your next startup
You can read more about the differences between halt and suspend
Hadoop & Vagrant: If I set up a new VM using these two packages, is the VM available for starting with VirtualBox or do I always have to use vagrant up?
When you first create the VM, you will need to use vagrant up since VirtualBox has no ability to read a Vagrantfile. Once your VM is up and running, you could stop and start it using VirtualBox. However, Vagrant can perform the same operations as VirtualBox and has a lot of advantages on top of that.
First let's discuss how Vagrant can do what VirtualBox can do. You can use vagrant suspend to put the VM in a saved state, vagrant resume to start it again, vagrant halt to power it off, and vagrant destroy to delete it. You can also use settings in Vagrant's VirtualBox provider to modify your VM's memory, CPUs, and more. You can also change the network settings and synced folders. And this gives you the advantage of defining all of these settings in code which can be checked into a revision control system such as Git.
On top of all this, Vagrant has support for provisioners. These range from something as simple as shell scripts to full blown configuration management tools such as Puppet, Chef, Ansible, and Salt. Just like you can define your VM's VirtualBox settings in code, you can define the entire creation process including installing packages, managing services, and customizing files. And you can make changes at any time and apply them using vagrant provision.
So getting back to your question... yes, you can control your VM directly with VirtualBox, but you'd be missing out on the rich feature set of Vagrant.
I'm new to vagrant, I'm using scotchbox.
I've configured a couple of vhosts in apache.
I guess the right way to do this would have been to change the provisionning of my box (as it's the aim of vaghrant right?) but i did the old school way by simpply editing my config files and so on...
Now my question is :
if i run vagrant destroy, do i loose all my configs?
is there any other command (vagrant halt, vagrant suspend?) that would allow me to reboot my host machine without loosing my config?
vagrant destroy will remove entire VM so any changes that were made manually will be lost. Vagrant halt only turns of the power so to speak so nothing is lost. If you run your machine again or reboot it all your data is save, just don't use --provision option that will recreate all initial configuration.
I'm problem with my Vagrant boxes. I had a number of boxes in operation, opened my Vagrantfile to add a new box config. Then when I ran vagrant up new_box, I was told that it could not boot and was subsequently placed in poweroff state. Now ALL my boxes are in poweroff state when I check vagrant status. The apps running on these boxes are still running though, but I can't ssh into them. I also cannot run vagrant halt, nothing seems to happen. When I run vagrant up port collisions occur.
In short, my Vagrant boxes are running (sort of), but they aren't really?
EDIT
I have tried destroying a box (rather than just halting) and then running vagrant up again, but the port is still occupied when I try to bring the box back up again... However, when I check netstat the host ports are not listed as in use by any application.
The problem was caused by an update of VirtualBox performed by the server admin (without me knowing). Also, a kernel update was being performed.