Page 1 of 1
non root user
Posted: 12. Apr 2017, 19:47
by stipan
Hello ,
I apologize if this is replication of existing issue.
Ok, I am using virtualbox on ubuntu 16.04.
I have created VM called "ubuntu" as user1.
So, now I am wondering is there some way to access to my VM as user2.
My purpose is to monitor VM.
So for example if I try to execute following command as user2 : "VBoxMange showminfo ubuntu", i get following error:
"VBoxManage: error: Could not find a registered machine named 'ubuntu'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(VMNameOrUuid).raw(), machine.asOutParam())" at line 2719 of file VBoxManageInfo.cpp"
Maybe, is there some way to execute VBoxManage and pass username and password as parameters that is also option?
So, My purpose is just to monitor VM (usage of cpu, memory, is it in running state) from user that is different than user1, so I will welcome every suggestion...
Re: non root user
Posted: 12. Apr 2017, 20:21
by socratis
VirtualBox runs on the user context that created/launched the VM. So, no, you can't directly do what you are looking for. You could be looking at the other user's screen (or a remote computer, same thing) if you enable the RDP server in the VM. See
Chapter 7. Remote virtual machines.
Re: non root user
Posted: 12. Apr 2017, 20:54
by Perryg
My purpose is to monitor VM.
Only way I can think of is to use the metrics measuring from VBoxManage
http://www.virtualbox.org/manual/ch08.html#metrics
Re: non root user
Posted: 12. Apr 2017, 22:58
by socratis
Using the "metrics" however, would still require to be checking from the same account as the user that created/launched the VM, 'user1' in this case. And by re-reading the title of the thread, not even 'root' could have access to the VMs of 'user1', if that's what 'stipan' was thinking of.
Re: non root user
Posted: 13. Apr 2017, 17:55
by stipan
yeah, Socratis got a point.
If I try to use VBoxManage user2 can't see VM. I got following error : "VBoxManage: error: Invalid machine name: 'ubuntu'" cause he can not see machine.
So, as user2 there is no way to monitor user1 VMs?
Re: non root user
Posted: 13. Apr 2017, 18:02
by Perryg
So, as user2 there is no way to monitor user1 VMs?
Sure there is just not by default. Permissions will not let users see each other, but you can place the virtual machines in a common location and setup the permissions where all users can see. It is just not secure. You would need to create or use a group that each user is in with the proper permissions. This is however outside the scope of what VirtualBox is designed to do ( isolate users ) so there probably will not be a lot of help here.
Re: non root user
Posted: 13. Apr 2017, 18:56
by stipan
So, if I get it right, the best solution is to use another software
Re: non root user
Posted: 13. Apr 2017, 19:02
by Perryg
I fail to see how that would solve your problem but a different program is as always your option. AFAIK all virtualizers try to isolate these machines for security.
Re: non root user
Posted: 14. Apr 2017, 19:33
by socratis
Perryg wrote: but you can place the virtual machines in a common location and setup the permissions where all users can see.
That would allow you to simply have access to, and launch a "common" VM. It wouldn't allow you to monitor the process launched by user1 from the user2 account. I believe the reason is the VBoxSVC process which is responsible for holding the registry/status of all the user's running VMs. I think only root could do that, or by:
As Perryg mentioned the design logic behind VirtualBox was user isolation.
Re: non root user
Posted: 18. Apr 2017, 19:39
by stipan
in yours opinion, Is there some way to implement a script that will do it, so User2 just run it and get infos? So he doesn't have to know that in the background you do all that su stuff you mention?
Re: non root user
Posted: 18. Apr 2017, 19:50
by socratis
No.
Re: non root user
Posted: 18. Apr 2017, 20:01
by stipan
great thank you very much
