Page 1 of 1

Guest on rawdisk - trouble with shared folder permissions

Posted: 10. Feb 2016, 15:11
by Andr_eas
I have a Windows/Linux dual boot config and wanted to be able to boot the Linux partition from within Windows via Virtualbox.

For this to work, I creaded a rawdisk vmdk and I have to run Virtualbox with admin rights.

Now, but I'm struggling with file permissions for files created by the Guest on a Windows NTFS drive - they all are created with admin-only access.

Normally, when running Virtualbox without admin rights, files created on the host via shared folders can be fully accessed by everyone.

I also tried via CIFS, i.e. I created a Windows network share on the host for the drive and accessed it from within the guest via samba - same result - all newly created files have admin-only permissions, which is strange, because I expected file permissions to be handled by CIFS...


If Virtualbox is run with regular user rights, all is fine, but I can't boot from rawdisk / physical harddrive partition of course...


If anyone knows of a workaround, I'd be glad...

Re: Guest on rawdisk - trouble with shared folder permission

Posted: 10. Feb 2016, 15:48
by mpack
Enabling raw access to Win7 and later disks.
viewtopic.php?f=6&t=38914#p175089

Re: Guest on rawdisk - trouble with shared folder permission

Posted: 10. Feb 2016, 16:01
by Andr_eas
Thanks, but my problem quite different. I don't have any trouble with accessing the rawdisk. I'll try to describe my setup more in detail:

Host: Windows, harddisk with 3 partitions: windows, linux and data
Guest: Linux, boots from linux-partition via vmdk rawdisk (I used the --partitions option uppon creation such that access is only given to linux partition, the other partitions are left out to prevent file corruption)

Now, I want to access the data partition from host and guest _simultaneously_, without any file corruption. That's why I don't use rawdisk access for the data partition but folder sharing via Virtualbox shared folders or native Windows share.

But: when I create a file on the shared folder from within the guest, it will be created with admin-only permissions on the host.

That's because Virtualbox is run with admin rights.

From within the guest, file permissions look different, somehow Virtualbox does some mapping here. To solve my problem I need a way to change this mapping.

Curiously, this mapping also happens when accessing the data partition via native Windows network sharing.

Re: Guest on rawdisk - trouble with shared folder permission

Posted: 10. Feb 2016, 18:49
by socratis
Andr_eas wrote:this mapping also happens when accessing the data partition via native Windows network sharing.
OK, I'm not too familiar with rawdisk access, but that statement of yours is leading me to my question:
Since your data partition is not accessed via VirtualBox's rawdisk, how do you explain that behavior? If VirtualBox isn't involved, it can't affect the permissions of files in windows shares, can it? Maybe there is something in the way that you share things?

Re: Guest on rawdisk - trouble with shared folder permission

Posted: 11. Feb 2016, 14:45
by Andr_eas
Ok, I see that mentioning "rawdisk" leads to some confusion here....

Just forget about rawdisk.

Virtualbox is running with admin rights, that's the point.

For sharing the data partion I tried two ways:

1.) Virtualbox built-in folder sharing
2.) Windows network sharing

Both ways result in the same problem: files created by the guest on the shared folder always get admin-only permissions on the host.

I understand that this might be expected behaviour for 1.)

But for 2.), I expected the files to be created with user permissions because in order to access the share from the guest, I have to enter my user credentials, because I created the share on the host that way.


EDIT: issue solved. I needed to re-take ownership of the drive assigned to the data partition within Windows host. The user had read&write access to the drive but wasn't the owner. Seems that newly created files through network sharing where created with owner access rights only and the previous owner was admin.

Re: Guest on rawdisk - trouble with shared folder permission

Posted: 11. Feb 2016, 17:26
by socratis
That's what I said:
socratis wrote:Maybe there is something in the way that you share things?