Vagrant reset my VM and now I am frightened I lost my work - virtualbox

I have a horrible situation and I hope you can help.
This morning, the terminal opened in my VM hanged, I tried to access Virtualbox and it went unresponsive. I killed Virtualbox manually and typed vagrant up. Vagrant (vagrant ssh) booted on a VM that pretty much seems the default one and I am terrified that all my work has been lost.
Typing vmboxmanage list vms shows:
wasp_1375609265" {29663113-786b-4b8a-adc8-2edecf06bcff}
which is the same UUID I find on the .vagrant file.
I am on a Mac OSX Montain Lion, the version of vagrant I am using is 1.0.6 and Virtualbox is 4.2.16.
Is there any way I can access the image at the previous state it had before I manually killed it? I can't believe that vagrant or Virtualbox purposely overwrote the image with a default one

It turned out that I am an idiot and the image was not lost. For some reasons Virtualbox saved it with a cryptic name and vagrant reverted to the default vagrant box wasp_32... when I run it again. I found the image I was looking for simply running all the *.vmdk I found under ~/VirtualBox VMs.
After that I followed the instructions I found here to make vagrant booting the correct image

Related

Vagrant Box with Trellis/Bedrock

I recently set up a Trellis/Bedrock/Sage environment. I like it so far but have been running into the issue that if I step away from my computer, I can’t reconnect to my local production environment and have to start up my wordpress install from scratch. Is there a way to “save” a vagrant box so I can close my computer and not have to vagrant destroy, then vagrant up each time?
Thanks,
You could probably Save State directly in VirtualBox to accomplish what you want:
Also, I was able to find this comment to help answer your question here which also may do the trick:
In order to keep the same VM around and not loose its state, use the
vagrant suspend and vagrant resume commands. This will make your VM
survive a host machine reboot with its state intact.
https://serverfault.com/users/210885/

VMWare Workstation won't suspend from command line

I'm trying to automate VMWare Desktop on Windows 7 to suspend all vm's before I do a backup job each night. I used to have a script that did this but I've noticed now that it won't suspend anymore with the same command that used to work.
If I do vmrun list I get a list of the running vms with no issue.
If I do vmrun suspend "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" it just hangs and I have to kill the command with CTRL+C.
I've even tried a newer command using -T to specify it's workstation, ie vmrun -T ws suspend "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" and still no love.
If I have the vm already stopped, I can issue vmrun start "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" and it starts fine.
As well as the suspend command, the stop command also does not work. I'm running VMWare Workstation 11.1.3 build-3206955 on Windows 7.
Any ideas?
Update:
I installed latest VMWare Tools on the guest, as well as the latest Vix on the Host so everything should be up to date.
I can start a vm using vmrun with no problem using vmrun -T ws start <path to vmx> but the command doesn't come back to the command prompt, so I'm assuming it's not getting confirmation from the vm that it is now running.
If I cancel the 'start' command and now try and suspend I'm getting the same lack of communication from the guest. If I manually suspend the vm, once it's suspended I get an 'Error: vm is not running' and the 'suspend' command finally times out and comes back.
So, it looks to me like there is no communication from vmrun to the guest about what state it's in etc. Is there a way to debug the communication from the host to the guest using vmrun or other means? Are there ports I need open in the guest OS?
So, I never did get vmrun to work properly on my main system, although I did get it behave ok on my laptop so there is something weird happening on this machine. I also installed a trial of the latest VMWare 12 and the same thing happens.
As a workaround, I ended up changing the power management settings in my guest OS so that it would 'sleep' after 1 hr of inactivity. When this happens VMWare detects it and automatically suspends the guest which is really what I'm looking for. Not the most slick solution but it does manage to unlock the files I need to be backed up in a nightly backup.

Openstack dashboard gives error "Error: Unable to retrieve usage information"

I installed OpenStack on an ec2 instance running Ubuntu 14.04 LTS via devstack. When I login into the dashboard I get an error "Error: Unable to retrieve usage information"
When I installed it and logged in for the first time, everything was working fine. But after I stopped my ec2 instance and restarted, I am facing this problem.
What might be causing this error?
I used the stable juno version of devstack.
And the AMI for my ec2 instance is Ubuntu Server 14.04 LTS (HVM), SSD Volume Type.
Does restarting the instance might have caused some problem?
cd to devstack and execute ./rejoin-stack
That solved it. I was trying to reboot nova and other services individually.
But since the installation was done using devstack, you need to run the ./rejoin-stack script.
In addition to [akshay1188] answer, you can re-stack your system. Sometimes, rejoin-stack does not work as expected. In that case, you can unstack (unstack.sh) it and stack (stack.sh) again. *This may take much time.
Another observation of mine says this can be an issue with IP address of the system. Try to keep IP address same after reboot.

Vagrant + Chef: Error in provision "Shared folders that Chef requires are missing on the virtual machine."

I've installed a Vagrant + Virtualbox using Chef (+library chef). When I do vagrant up first time, cookbooks get loaded correctly. However, when I do provision afterwards (be it vagrant provision, vagrant reload --provision or vagrant up --provisionI get this error:
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.
I searched everywhere and the only solution given is to do vagrant reload --provision, this worked up up to Vagrant 1.3.1.
it seems like there is a bug with sync folders, this clears the cache and fixed it for me. (from your project directory)
rm .vagrant/machines/default/virtualbox/synced_folders
vagrant reload --provision
https://github.com/mitchellh/vagrant/issues/5199
EDIT: this should be fixed in vagrant 1.7.4
That's a fairly common issue with the Vagrant plugins for both Berkshelf and Librarian. Just get used to running that command.
The way to avoid it is to use something like Test-Kitchen instead of the Vagrant plugins. That isn't a drop-in replacement though.

VirtualBox error "Failed to open a session for the virtual machine"

I have a virtual machine with Windows XP with a clean installation. I set it as immutable to create a differential machine, so I create a new virtual machine, select the immutable hard disk and create a new snapshot in the new virtual machine folder.
However, when I try to start the virtual machine I get this error:
"failed to open a session for the virtual machine".
Código Resultado:
VBOX_E_INVALID_OBJECT_STATE (0x80BB0007)
Componente:
ProgressProxy
Interfaz:
IProgress {c20238e4-3221-4d3f-8891-81ce92d9f913}
What is the problem? until now I can use differential virtual machines without problems. I have installed the last version or VirtualBox v4.3.4 and the problem persists.
If I set the hard driver as normal and I create a new virtual machine and select this hard drive I don't have any problem.
EDIT: I use the same virtual disk and do the same steps in another computer and it works fine. I think that the problem is the VirtualBox of my computer with the problem, but I try to uninstall the program and reinstall it and the problem persists, so I don't know how to solve the problem.
EDIT 2: if I set the virtual harddrive as multiattached instead of immutable, then it works fine. In my case is enough, but I know that it would be work as immutable because it was work until now and it works in another computer.
I try to create a new user in windows to try if the problem if with the configuration of my account, but the problem persists. So I think that some general configuration of VirtualBox has been corrupted and I am not be able to repair it.
I would like to know if there is any solution to use a immutable hard drive, because I would like to solve the problem with VirtualBox, although by the moment the multiattached hard disk is enough.
I had the same issue, I tried editing the VM but it wasn't letting me save it. So I tried the following:
Tried editing the VM to change RAM/CPU etc, but it wasn't letting me save it
Deleted the vm (not the data) and tried adding it again, didn't fix it
Tried moving the vbox file to another directory and import it, but it didn't let me move the vbox file so I realized there's a virtualbox process running that's holding a lock on it. So I killed that process and started it again and my VM booted
Killing VM process dint work in my case.
Right click on the VM and click on "Discard Saved State".
This worked for me.
For windows users
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
I had the same issue, and this trick works for me
Goto control panel
Open Uninstall program
Click on turn windows features on or off
Scroll down and find the hyper-V folder.
Uncheck the Hyper-V.
Apply changes and restart your system.
Now here you go... Open your virtual box and start the os you want.
Hope this helps..
Updating VirtualBox to newest version fixed my issue.
If you are in Windows and the error message shows VT-x is not available make sure Hyper-V is disabled in Windows components.
maybe it is caused by privilege, please try this:
#sudo chmod 755 /Applications
#sudo chmod 755 /Applications/Virtualbox.app
Something that I tried and work for me is simply you create a new virtual machine and you use the existing virtual hard disk file and everything is like you left it.
On Ubuntu, this can also be caused by incorrect permissions. I chmod 755 Logs/ which fixed the issue.
In my case I gave administrator privilege to Virtualbox and it solved my problem.
i.e., run run as administrator on windows 10
In may case, "VM VirtualBox Extension Pack" was broken. So I uninstalled it and reinstalled it.
For MAC users
After some research, this worked for me:
Quit VirtualBox
Right click "Applications" folder
Click on "Get Info"
Change "Everyone" Permission to "Read Only"
Open VirtualBox, and now it should work.
Normally this error occurs when it try to load the previous state. This happened in Mac Virtual box.
I tried after restarting the virtual box but again also i've encountered this issue.
Right Click on the operating system in the virtual box and then Click on the Discard Saved State.. .This fixed the issue.
try this
sudo update-secureboot-policy --enroll-key
and restart your system, when restart it shows option and select Mok key and you will work fine.
The only thing that solved the issue for me is to unmount the second hard disk on my laptop.
My current setup contains 1 HDD on SATA0 port and 1 SSD on SATA1 port. I've the OS and Oracle VirtualBox installed on the SSD drive.
When I deleted the partition on the HDD, the issue was solved.
This solved my problem:
open a cmd with admin privilige
bcdedit /set hypervisorlaunchtype off
reboot
Error gone and VMs are working again.
This worked for me:
In the Oracle VM Manager - right click on your virtual maching (for example kali linux).
In the menu choose "discard saved state".
Then press discard and restart your virtual machine.
Ubuntu based system, solution that worked for me...
Delete virtualbox and download the latest deb package from the virtualbox website.