[Resolved] Started VMs on Command Line, GUI shows them as "Powered Off"

This is for discussing general topics about how to use VirtualBox.
Post Reply
robertb1
Posts: 13
Joined: 12. Sep 2017, 19:51

[Resolved] Started VMs on Command Line, GUI shows them as "Powered Off"

Post by robertb1 »

Using Vbox 5.2.16 on Ubuntu 16.04. Desktop

- I created seven VMs via GUI, have been running with no problems.

- Registered them on the command line in order to facilitate automated backups of each VM's entire vbox folder.

- When I start the machines using the command line, the GUI still shows "Powered Off" for all VMs.

I'm guessing I probably need to remove and re-add each VM to the GUI. Before I do that and risk damage, can someone comment if there is a correct way to get the GUI to correctly show the status of each VM?

Thanks
Last edited by socratis on 29. Jul 2018, 16:38, edited 1 time in total.
Reason: Marked as [Resolved].
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Started VMs on Command Line, GUI shows them as "Powered Off"

Post by socratis »

robertb1 wrote:Registered them on the command line in order to facilitate automated backups of each VM's entire vbox folder.
What? Why would creating a VM from the CLI would be any better than the GUI? Unless you have other plans, backup should not be one of the reasons to create the VMs from the CLI.
robertb1 wrote:When I start the machines using the command line, the GUI still shows "Powered Off" for all VMs.
How did you start them exactly? Are they actually running? Did you try to close the VirtualBox Manager and restart it?

As I told you in another thread, I tried to start a VM from the CLI (created in the GUI) and there were no problems. The Manager changed the VM status to show that it was running.
robertb1 wrote:can someone comment if there is a correct way to get the GUI to correctly show the status of each VM?
There's no "correct" way to do it, there's only one way AFAIK.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
robertb1
Posts: 13
Joined: 12. Sep 2017, 19:51

Re: Started VMs on Command Line, GUI shows them as "Powered Off"

Post by robertb1 »

socratis wrote:What? Why would creating a VM from the CLI would be any better than the GUI? Unless you have other plans, backup should not be one of the reasons to create the VMs from the CLI.
From the GUI I can't schedule a VM shutdown, copy the VM folder to NAS, then restart the VM, I have to do those manually. I can do that automatically from CLI, but only if the VMs are registered first.
socratis wrote:How did you start them exactly? Are they actually running? Did you try to close the VirtualBox Manager and restart it?
vboxmanage list runningvms confirms all VMs are currently running. I closed and restarted VBox and restarted it, now all VMs show status "Inaccessible"
socratis wrote:As I told you in another thread, I tried to start a VM from the CLI (created in the GUI) and there were no problems. The Manager changed the VM status to show that it was running.
That's where I want to get to by the end of this. My guess is it has something to do with creating the VMs via GUI but registering via CLI, but I can't say for sure yet.
Last edited by socratis on 28. Jul 2018, 18:35, edited 1 time in total.
Reason: Fixed formatting.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Started VMs on Command Line, GUI shows them as "Powered Off"

Post by socratis »

robertb1 wrote: I can do that automatically from CLI, but only if the VMs are registered first.
I think that there's something wrong with your understanding of the "registration" part. Creating a VM in the GUI registers said VM. So what you want to do would work no matter where the VMs were created. The only way that you'd want to create a VM in the CLI would be:
  • A headless/remote server so that the only thing you have would be available would be the CLI.
  • Automation for creating/testing/destroying VMs in a loop.
I need to know exactly the whole script that you 1) create, 2) start, and 3) stop the VM. I think that there's something wrong in there. You're missing a step or two.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
robertb1
Posts: 13
Joined: 12. Sep 2017, 19:51

Re: Started VMs on Command Line, GUI shows them as "Powered Off"

Post by robertb1 »

Yikes... I see now what I did wrong. In answering my previous topic, you explained I needed to be out of root and running as my user that created the VMs.

I exited out of root but then registered the VMs instead of verifying first that I could see my running VMs, start and stop them via CLI, etc. Registering from CLI once I was out of root was not only unnecessary, it was flat out the wrong thing to do as it must have created some kind of conflict with what was already set up via the GUI, so the GUI didn't even recognize the VMs.

I had to remove all my VMs from the GUI, create new VMs, and then reattach the .vdi's. Everything is doing what it should now (in CLI as user, not root). Thanks for your help. Re-reading it now, it all makes sense.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Started VMs on Command Line, GUI shows them as "Powered Off"

Post by socratis »

Glad you got it going. Marking as [Resolved].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply