Group ownership of devices changes for "raw partitions"
Posted: 27. Feb 2018, 14:37
Hi,
I'm using VirtualBox 5.2 on CentOS Linux 7 to run a "real" Windows installation via the "raw partition" support. In other words, the VirtualBox image was set up "VBoxManage internalcommands createrawvmdk -filename ... -rawdisk /dev/sda -partitions ...".
The configuration works fairly well, but there is one somewhat annoying problem: It seems like VirutalBox changes the group ownership of the device files corresponding to the windows partitions. This happens when I shut down the guest system; essentially it's like this:
- After I boot the Linux system, all /dev/sda* devices belong to group "disk".
- If I start up VirtualBox, the devices still belong to "disk".
- While I use the Windows guest, the devices belong to "disk"...
- After I shut down Windows, and the VirtualBox window goes away, some of the /dev/sda* files have group "root" instead of "disk". The device files in question seem to correspond to the partitions that are available to Windows.
This is a bit of an issue as it makes it harder to set up the system so that regular users can (always) run the guest OS. Since the devices are also readable and writeable by the group (but not other users), this would normally be a matter of adding the relevant users to the "disk" group, but with the above mentioned behaviour, that won't always work. I'm more reluctant to add to "root", and I don't really like having to manage two groups instead of one...
Does anyone know why the group changes like this? Is there a way to stop it from happening?
Thanks.
- Toralf
I'm using VirtualBox 5.2 on CentOS Linux 7 to run a "real" Windows installation via the "raw partition" support. In other words, the VirtualBox image was set up "VBoxManage internalcommands createrawvmdk -filename ... -rawdisk /dev/sda -partitions ...".
The configuration works fairly well, but there is one somewhat annoying problem: It seems like VirutalBox changes the group ownership of the device files corresponding to the windows partitions. This happens when I shut down the guest system; essentially it's like this:
- After I boot the Linux system, all /dev/sda* devices belong to group "disk".
- If I start up VirtualBox, the devices still belong to "disk".
- While I use the Windows guest, the devices belong to "disk"...
- After I shut down Windows, and the VirtualBox window goes away, some of the /dev/sda* files have group "root" instead of "disk". The device files in question seem to correspond to the partitions that are available to Windows.
This is a bit of an issue as it makes it harder to set up the system so that regular users can (always) run the guest OS. Since the devices are also readable and writeable by the group (but not other users), this would normally be a matter of adding the relevant users to the "disk" group, but with the above mentioned behaviour, that won't always work. I'm more reluctant to add to "root", and I don't really like having to manage two groups instead of one...
Does anyone know why the group changes like this? Is there a way to stop it from happening?
Thanks.
- Toralf