Sharing of VMs with root user

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Piedpiper
Posts: 3
Joined: 25. Jul 2017, 11:45

Sharing of VMs with root user

Post by Piedpiper »

Is there a way to share the VMs create by a non-root user to be visible to the root user to manage all user VMs on virtualbox 5.0.32,
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing of VMs with root user

Post by Perryg »

Not easily and even when accomplished security is non-existent. VirtualBox is designed to restrict anyone other than the creator by default so as to secure the guest and sets the VBOX_USERS_HOME environment. Altering that and r/w becomes an issue.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Sharing of VMs with root user

Post by Martin »

Of course nothing keeps the root user from switching to the users context with 'su - <username>' and manage the VMs there. ;)
Piedpiper
Posts: 3
Joined: 25. Jul 2017, 11:45

Re: Sharing of VMs with root user

Post by Piedpiper »

Thanks, fully understand the associated security risks, but I'm running GNS3, which runs in root and my application runs in the userspace. So might need to move everything to root if sharing not an option.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing of VMs with root user

Post by Perryg »

I'm running GNS3, which runs in root
Why? Applications should never run in root. Is this the way they intend it to run?
Piedpiper
Posts: 3
Joined: 25. Jul 2017, 11:45

Re: Sharing of VMs with root user

Post by Piedpiper »

yes, I tried running it in userspace, where it could start the VMs but I run into issues. Their documentation also says that they require root, but this is not for production application, more a lab that I am setting up so should be fine.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing of VMs with root user

Post by Perryg »

Wow, well someone needs to learn how to program and adapt the software to run properly. Anyway you do this just be sure that the host and guest never have access to LAN/WAN in the real world.
Post Reply