VBoxManage does not show running vms (after Userswitch)

Discussions related to using VirtualBox on Linux hosts.

VBoxManage does not show running vms (after Userswitch)

Postby flichten » 28. Nov 2017, 13:10

Hello,

i encountered a strange problem with VBoxManage.

With the following steps i am able to reproduce the problem:

# Start a VM via VirtualBox GUI under your normal user (user that is in group: vboxusers)
# Check that VM is up and running: VBoxManage list runningvms (shows running vm)
# Become root on your linux system (su) via Terminal
# Issue: VBoxManage --version (gives version number)
# Try to check that VM is up and running again via root: su - <username> -c "VBoxManage list runningvms" -> doesn't show any output even the VM is still running
# Cancel root mode: exit
#Try to check that VM is up and running again via user: VBoxManage list runningvms -> still doesn't show any output even the VM is still running

When i shutdown the VM via GUI, close the Virtualbox GUI and open it again everything is working fine.

Do you agree that this could a possible bug or do i harm some rules with my steps described above?

VBoxVersion: 5.1.30 r118389
Linux Host: Oracle Linux 7.4
Kernel: 3.10.0-693.5.2.el7.x86_64

thanks for your help
flichten
 
Posts: 4
Joined: 29. Jun 2017, 09:10

Re: VBoxManage does not show running vms (after Userswitch)

Postby Perryg » 28. Nov 2017, 14:27

VirtualBox is designed to run in user space ( only for the user that installed it ). It does its best to prevent anyone else from using/seeing the guest/s by placing them in the user space. So what you are seeing is normal.
Perryg
Site Moderator
 
Posts: 34282
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage does not show running vms (after Userswitch)

Postby flichten » 28. Nov 2017, 15:24

Thanks for your quick reply.

So you mean that it is not good practice to execute a VBox command as root or other user with:
Code: Select all   Expand viewCollapse view
su - <user that is owner of vbox-vms> -c "VBoxManage <command>"
?

If that's true, i agree that Step 1 till Step 5 (explained above) works as designed but why cant I see the running VM when i have an active Terminal-Session as User that is owner of the VM (after going through Step 1 - Step 5) ? That still seems to be a bug for me.

Thanks
flichten
 
Posts: 4
Joined: 29. Jun 2017, 09:10

Re: VBoxManage does not show running vms (after Userswitch)

Postby Perryg » 28. Nov 2017, 15:31

That's the way it has always been. By switching the user you change the VBOX_USER_HOME environment to a different user and one which does not have access. You need to manually set this back (export) or reboot.
Perryg
Site Moderator
 
Posts: 34282
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage does not show running vms (after Userswitch)

Postby flichten » 28. Nov 2017, 15:42

I understand.

Thanks for your help
flichten
 
Posts: 4
Joined: 29. Jun 2017, 09:10


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: Google [Bot], jj007, Yahoo [Bot] and 18 guests