Page 1 of 1
Starting a VM with "su -c vboxuser" causes error
Posted: 22. Nov 2019, 00:01
by CpServiceSpb
I installed VirtualBox 6.0.14, extensoions pack on UBuntu 18.04 x64.
And I get error while start virtual machine:
starting VM = su -c "VBoxManage startvm u1804arm --type headless" vboxuser
Waiting for VM "u1804arm" to power on...
VBoxManage: error: The virtual machine 'u1804arm' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
How is to solve it ?
There is impossible to use virtual machines.
I saw the same error in Windows Host topic, but there was solution.
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 22. Nov 2019, 06:18
by socratis
CpServiceSpb wrote:su -c "VBoxManage startvm u1804arm --type headless" vboxuser
Can you explain to me why you're starting the VM like that? What if you start it like this:
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 22. Nov 2019, 11:29
by CpServiceSpb
I want to run under vbox user, not under root user.
And I want to store VMs list not to user home folder but to 3rd indeprendent folder.
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 22. Nov 2019, 11:44
by socratis
CpServiceSpb wrote:I want to run under vbox user, not under root user.
Great! Nobody should be running VirtualBox as 'root'.
So... what happens if you login as 'vboxuser' and try the command on my previous comment? Directly from the 'vboxuser' account?
Start simple,
then go fancy...
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 22. Nov 2019, 20:55
by scottgus1
CpServiceSpb wrote:I want to store VMs list not to user home folder but to 3rd indeprendent folder.
Having a common folder for all host PC users is possible. It involves the VBOX_USER_HOME environment variable, see the Virtualbox manual, "Global Configuration Data" (in 6.0.14's manual, section 10.1.3) Then there would be no special 'su'-driven commands; standard commands will work.
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 22. Nov 2019, 23:36
by CpServiceSpb
Yes,
VBoxManage startvm u1404x64 --type headless
gives positive result.
But .............
There are processes:
vboxuser 2645 0.0 0.1 181768 6384 ? S 01:12 0:00 /usr/lib/virtualbox/VBoxXPCOMIPCD
vboxuser 2651 0.0 0.3 819032 13060 ? Sl 01:12 0:09 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
root 16117 0.0 0.3 255500 14008 ? S 23:51 0:00 /usr/lib/virtualbox/VBoxXPCOMIPCD
root 16123 0.3 0.4 761692 18692 ? Sl 23:51 0:00 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
root 16141 31.3 4.6 2161408 187228 ? Sl 23:51 0:10 /usr/lib/virtualbox/VBoxHeadless --comment u1404x64 --startvm uuid --vrde config
As we can together see there are some virtual box processes launched from root including immediately working virtual machine.
- But I want that all would be done from non root user.
As following, folder /.config/VirtualBox with all its content is located at /root folder
- I want to locate such folder with its content at other location, even not under vbox user folder.
Regarding VBOX_USER_HOME, what are diffirencies beetwen VBOX_USER_HOME and VBOX_HOME ?
And phpVirtualBox doesn' t see VMs list.
- I need phpVirtualBox working.
So can you help me to reach 1st, 2nd and 3rd points ?
P.S.: As I remember virtualbox 5.2. worked on Ubuntu 14.04 under vbox user fine as well with phpVirtualBox.
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 23. Nov 2019, 09:14
by socratis
You see? That's
exactly the problem... You start by NOT telling us your whole setup, by NOT divulging all the information, by NOT stating what your end goal is. We have to extract it slowly bit-by-bit.
phpVirtualBox is a program that relies on VirtualBox, but modifies its configuration files in unknown ways to us, and with unknown consequences. They have their own
phpVirtualBox support channels. If you are having this problem with a standalone version of VirtualBox
(after a complete uninstallation of phpVirtualBox), then we can continue this discussion.
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 23. Nov 2019, 10:22
by CpServiceSpb
As I mentioned above the main trouble as I consider as a trouble
it is launching virtualbox under root and at the time my
impossibility to run it under vbox user !
I pointed it as point 1.
And a smaller one is to store all configuration folder/files as virtual machines at other 3rd path folder from users home folders to much easier to back up it.
I pointed it as point 2.
Regarding phpVirtualBox, ok, the question is closed.
Re: Starting a VM with "su -c vboxuser" causes error
Posted: 23. Nov 2019, 11:15
by socratis
CpServiceSpb wrote:As I mentioned above the main trouble as I consider as a trouble it is launching VirtualBox under root
Why would you want to run it as 'root'? Just login as 'vboxuser' and run it as 'vboxuser'. Which you
did, successfully.
CpServiceSpb wrote:And a smaller one is to store all configuration folder/files as virtual machines at other 3rd path folder from users home folders to much easier to back up it.
The VMs and the configuration data, are "per user". So, if you simply login as 'vboxuser', and you create (and register) your VMs as 'vboxuser', then all the data and the configuration will be stored under the 'vboxuser' account; the data (VMs) in '
/home/vboxuser/VirtualBox VMs', and the configuration in '
/home/vboxuser/.config/VirtualBox'. So, that's as clean as it gets.
If on the other hand you login as 'root', and then try to
'su -c vboxuser' then you're going the wrong way. Leave the 'root' out of the equation. If you do not involve the 'root' user, everything gets simplified. Not sure why you want to complicate things unnecessarily with other roles, environmental variables, etc.