You are not logged in.

#1 2019-05-15 16:55:44

scot
Member
Registered: 2017-04-22
Posts: 23

running one appl as root Qt WARNING: wrong ownership /run/user/1000

[this post is related to, but not a continuation of, https://bbs.archlinux.org/viewtopic.php?id=224338 . Please lmk if i should "do something" to connect these two posts]

I am the only user of my laptop, which now runs arch. For the moment, I have a very bare openbox running on top of X and no other desktop environment. I do, however, have three monitors: the built-in laptop LCD, an external HDMI one and an external USB-C/displayport one. The built-in LCD is one screen in X, attached to the nvidia GPU, and the two external monitors are a second screen in X, attached to the integrated intel GPU. I think that's waaaaay more than you need to know to answer my question, but I'm not certain, so I thought it best to lay out my layout smile.

I need to run Oracle Virtualbox as root, because it seems that one needs to run as root to use VirtualBox's "raw disk" feature. (I actually am not certain that I believe this fact, which is very explicit in the manual, but dancing with udev to let virtualbox get the access it would need as me is will need some time before I can think about that without my brain exploding. So even if the "need" part is a statement about me and not about arch, it's still true that for the time being, I "need" to.....  Please help me crawl so that I have a chance to run and dance when i grow up).

When I type "xhost +; export DISPLAY=:0; virtualbox &" into an xterm window, I get the following warning:

[root@scott-dell7577 scott]# Qt WARNING: QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0

I learned from the post which I cite in the first sentence above that in this case (of wanting to run virtualbox as root on my normal=usersś X desktop), I should invoke virtualbox by "dbus-launch --exit-with-session virtualbox". Doing so engenders more warnings, not fewer warnings:

[root@scott-dell7577 scott]# dbus-launch --exit-with-session virtualbox
dbus[1820]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/1000" is owned by uid 1000, not our uid 0
Qt WARNING: QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0

To my untrained eye, it looks like this is telling me to set XDG_RUNTIME_DIR to /run/user/0 before I start virtualbox. However, 1. there is no directory /run/user/0. And before I start making random directories with important sounding names like /run/user/0/systemd and giving them root privileges, I would like to ask here:

1. Do I need to care about that initial warning at all, or can i just ignore it?
2. Even if I don't need to care, I'm a caring person smile. Is there a "right" way to invoke virtualbox in this situation so that the newly installed police inside my laptop give me neither a ticket nor even a Warning?

With thanks,
scott

Last edited by scot (2019-05-15 16:57:02)

Offline

#2 2019-05-15 17:27:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: running one appl as root Qt WARNING: wrong ownership /run/user/1000

scot wrote:

I need to run Oracle Virtualbox as root...

That's a bad idea - even if you think it's temporary.

scot wrote:

... because it seems that one needs to run as root to use VirtualBox's "raw disk" feature. (I actually am not certain that I believe this fact, which is very explicit in the manual...

Nor do I believe it.  But I also cannot find any such claim in the manual.  Where are you seeing this?

scot wrote:

... but dancing with udev ...

That's also not necessary.  Simply add your user to the 'disks' group.  That's it.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-06-03 09:02:06

scot
Member
Registered: 2017-04-22
Posts: 23

Re: running one appl as root Qt WARNING: wrong ownership /run/user/1000

You're correct that it's a bad, sloppy thing to do.  I was hit by the need to do it when i had a Windows host (sorry, can remember which version of Windows), and I think i needed to have  "elevated privileges" to access the raw disks. The manual alludes to this in section 9.8.1.1:

"Creating the image requires read/write access for the given device. Read/write access is also
later needed when using the image from a virtual machine. On some host platforms, such as
Windows Vista and later, raw disk access may be restricted and not permitted by the host OS in
some situations."

I found the  blog post at
https://www.jamieweb.net/blog/booting-a … -on-linux/
to be a helpful explanation of the "simple but coarse-grained" fix ( which is to add yourself to the "disk" group, as you suggest), and the slightly more intricate but more grown-up fix (which is to add a udev rule. The benefit of doing a bit more work is a bit more security -- adding yourself to the disk group gives the user the right to access ANY disk at all, which might violate someone's privacy or just make it too easy to poke yourself in the eye sometime. Better to make accessible only the part of the your eye that you need to access, only when you need to access it).

Of course, when i wrote my question, the host OS was Windows -- and I don't know if there is a group one can become a member of in Windows 10 that obviates the need to run virtualbox as adminstrator to use rawdisks. I solved that problem by removing Windows as my host OS in general smile.

/scott

Offline

Board footer

Powered by FluxBB