Unabte to start VM in headless mode !!

Discussions related to using VirtualBox on Linux hosts.
Post Reply
vincen
Posts: 28
Joined: 6. Sep 2008, 09:48
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Windows 10
Location: Grenoble, France
Contact:

Unabte to start VM in headless mode !!

Post by vincen »

Hi

So I'm running Virtualbox 5.1.14 on Ubuntu 16.04. I have few virtual machines running in it without problems. Today I created a new VM with Ubuntu server in it. My goal is to be able to start it automatically in headless mode at boot of host system. First I wanted to test it in command line to be sure of syntax but I run into trouble for that.

I tried that syntax:
vboxheadless -startvm "7f527b43-569f-4d2c-98d6-8aef4d033122"
but Virtualbox always reports machine or uuid unknown unless I got the uuid just in previous command:
vboxmanage showhdinfo /home/vincen/VirtualBox\ VMs/Home-Assistant/Home\ Assistant.vdi
UUID: 7f527b43-569f-4d2c-98d6-8aef4d033122
Parent UUID: base
State: created
Type: normal (base)
Location: /home/vincen/VirtualBox VMs/Home-Assistant/Home Assistant.vdi
Storage format: VDI
Format variant: fixed default
Capacity: 8192 MBytes
Size on disk: 8194 MBytes
Encryption: disabled
I tried also using name between quotes as indicated in documentation but exactly the same. What am I missing here ?

Thanks

Vincèn
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Unabte to start VM in headless mode !!

Post by andyp73 »

As it is the output from the showhdinfo command it looks like that UUID is for the disk image.

I start my headless VMs with VBoxManage so based on your output try:
VBoxManage startvm "Home-Assistant" --type headless
-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
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: Unabte to start VM in headless mode !!

Post by socratis »

You can use "VBoxManage --type headless" or "VBoxHeadless" to start a VM, same end result.
What you can't do is to start a hard disk. A hard disk cannot start without a computer.
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.
vincen
Posts: 28
Joined: 6. Sep 2008, 09:48
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Windows 10
Location: Grenoble, France
Contact:

Re: Unabte to start VM in headless mode !!

Post by vincen »

andyp73 wrote:As it is the output from the showhdinfo command it looks like that UUID is for the disk image.
I start my headless VMs with VBoxManage so based on your output try:
VBoxManage startvm "Home-Assistant" --type headless
Thanks for details but not better :(
root@serveur:~# vboxmanage startvm "Home-Assistant" --type headless
VBoxManage: error: Could not find a registered machine named 'Home-Assistant'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 572 of file VBoxManageMisc.cpp
root@serveur:~#
socratis wrote:You can use "VBoxManage --type headless" or "VBoxHeadless" to start a VM, same end result.
What you can't do is to start a hard disk. A hard disk cannot start without a computer.
Yep sorry for confusion between UUID of a drive image and the one of the computer itself ;) so I tried the command using the machine ID (found in the text file of description of the VM !) but same error too :(
root@serveur:/home/vincen/VirtualBox VMs/Home-Assistant# vboxmanage startvm 74ba0593-0324-401c-9175-55e209c1852e --type headless
VBoxManage: error: Could not find a registered machine with UUID {74ba0593-0324-401c-9175-55e209c1852e}
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 572 of file VBoxManageMisc.cpp
root@serveur:/home/vincen/VirtualBox VMs/Home-Assistant#
vincen
Posts: 28
Joined: 6. Sep 2008, 09:48
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Windows 10
Location: Grenoble, France
Contact:

Re: Unabte to start VM in headless mode !!

Post by vincen »

oki found the issue and I have to apologise :( I'm stupid :oops: If I do the command with the correct user account it'll be much better !! Command works perfectly when used in original user account in which are the virtual machines ;)

Side question: if I run the command in a terminal and close terminal process will detach and continue or I'll kill the running virtual machine ?
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: Unabte to start VM in headless mode !!

Post by socratis »

You seriously need to look up the name of the VM that you're about to launch headless. The error tells you that no such VM exists; believe it. For starters, you seem to have manually intervened with the names. Check the differences of the VM folder and the VDI:
Dir: Home-Assistant
VDI: Home Assistant
You see the difference?

Whatever you have in your VirtualBox Manager as the VM name, that's what you got to put in the "<VM_Name>" field:
  • VBoxManage startvm "<VM_Name>" --type headless     or
    VBoxHeadless -s "<VM_Name>"
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.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Unabte to start VM in headless mode !!

Post by andyp73 »

vincen wrote:Side question: if I run the command in a terminal and close terminal process will detach and continue or I'll kill the running virtual machine ?
They will keep running. Some of mine are started through an init script on a machine that no-one ordinarily ever logs into.

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
Post Reply