Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

[ubuntu] Virtualbox: unable to change permissions of host files

$
0
0
I've installed Virtualbox 4.3.20 then Ubuntu 14.04 on a PC running Win7, following these instructions, including the guest additions. I created a shared folder, added myself to the vboxsf group, and can see files on my PC via Ubuntu. However, now matter which variant I try of the many solutions posted online, I'm not able to change the permissions, group or owner of these files, or to replace them inline.

Here's what I observe:
  1. The files in the shared folder belong to root (group=vboxsf); chmod and sudo chmod don't produce an error but don't have any impact.
  2. Trying to replace a file inline (perl -i.bak) produces "Can't rename file to file.bak: Text file busy, skipping file.".
  3. I can create files and move existing files. I can also delete and copy files, but the copies inherit the permissions of the originals. Yes, I do see the obvious workaround.


Here's the setup in Virtualbox.

  1. Storage
    1. Controller: IDE
      1. VBoxGuestAdditions.iso (IDE Primary Master, no live CD)
      2. Empty (IDE Secondary Master, no live CD)

    2. Controller: SATA
      1. ubuntu-14.vhd, 8 GB virtual, 6 GB actual, dynamically allocated

  2. Shared Folders
    1. Machine folders
      1. Name: PC
      2. Path: c:\Users\first.last
      3. Automount: yes
      4. Access: Full
      5. Read-only: no


Here's what I've tried so far:
  1. Edit /etc/fstab and add "PC /media/sf_PC vboxsf rw,umask=002,gid=1000,uid=1000,auto 0 0"
    1. tried this with and without automount above, and with remount as an option to override automount
    2. tried smbfs instead of vboxsf
    3. tried with or without the auto, rw and gid options
    4. Outcome: I see the drive flashing in the docker at every change, but nothing happens to the file permissions. In addition, whenever I reboot after any of these additions to fstab, I get "An error occurred while mounting /media/sf_PC".

  2. Edit /etc/mtab.
    1. Outcome: this does nothing. Every time I reboot, mtab is overwritten.

  3. Edit /etc/rc.local and add "sudo mount -t vboxsf -o rw,umask=002,uid=1000,gid=1000 PC /media/sf_PC". Remove automount option from VM.
    1. Outcome: this makes me the owner and group of files, but I still can't change permissions or edit files in place. Setting gid to 999 makes the group vboxsf but the outcome is the same.

  4. Chown -R of /mnt/sf_PC, either before or after mounting.
    1. Outcome: this does not accomplish anything.


I don't think I'm trying to do anything unusual. Thanks.

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>