本文翻译自:Virtualbox shared folder permissions

I'm using Windows and Virtualbox with RedHat, putting it simple: I've created a shared folder so I can use Eclipse on my Windows OS and do some testing in Linux. 我将Windows和Virtualbox与RedHat结合使用,简单起见:我创建了一个共享文件夹,以便可以在Windows OS上使用Eclipse并在Linux中进行一些测试。

However, I can't access the shared folder with my user, I've logged in with root and used chmod 777 and even moved my user to the folder's group. 但是,我无法与用户访问共享文件夹,我已经以root用户身份登录并使用chmod 777 ,甚至将我的用户移至了该文件夹的组。

Whatever I do the result is the same: 无论我做什么,结果都是一样的:

/media/sf_sharedFolder/: Permission denied

What can I do? 我能做什么? How can I access the shared folder with my user? 如何与用户访问共享文件夹?


#1楼

参考:https://stackoom.com/question/1oCK9/Virtualbox共享文件夹权限


#2楼

Add yourself to the vboxsf group within the guest VM. 将您自己添加到来宾VM中的vboxsf组。

Solution 1 解决方案1

Run sudo adduser $USER vboxsf from terminal. 从终端运行sudo adduser $USER vboxsf
(On Suse it's sudo usermod --append --groups vboxsf $USER ) (在Suse上是sudo usermod --append --groups vboxsf $USER

To take effect you should log out and then log in, or you may need to reboot. 要生效,您应该先注销然后再登录,否则您可能需要重新启动。

Solution 2 解决方案2

Edit the file /etc/group (you will need root privileges). 编辑文件/etc/group (您将需要root特权)。 Look for the line vboxsf:x:999 and add at the end :yourusername -- use this solution if you don't have sudo. 查找行vboxsf:x:999并在末尾添加:yourusername如果您没有sudo,请使用此解决方案。

To take effect you should log out and then log in, or you may need to reboot. 要生效,您应该先注销然后再登录,否则您可能需要重新启动。


#3楼

Try this (on the guest machine . ie the OS running in the Virtual box): 尝试以下操作(在客户机上,即在“虚拟”框中运行的操作系统):

sudo adduser your-user vboxsf

Now reboot the OS running in the virtual box. 现在,重新启动在虚拟框中运行的操作系统。


#4楼

This also works 这也有效

sudo usermod -aG <group> <user>

Then restart vm 然后重启vm


#5楼

For VirtualBox(5.0.24) Host=Mac(El Capitan) and Guest=RHEL(7.2) 对于VirtualBox(5.0.24)主机= Mac(El Capitan)和Guest = RHEL(7.2)

Start up your RHEL Guest VM and open up a Terminal. 启动RHEL Guest VM,然后打开一个终端。 Make sure you have the Developer Tools installed. 确保已安装开发人员工具。

sudo yum groupinstall 'Developer Tools'

And the Kernel headers package so that the Guest Additions script can update your kernel. 以及内核头文件包,以便Guest Additions脚本可以更新您的内核。

sudo yum install kernel-devel*

Once you have the prereqs in place its time to install the Guest Additions. 有了前提条件后,就可以安装Guest Additions了。 With your running VM selected go to the VirtualBox menu and select Devices --> Insert Guest Additions CD image... 选择运行的虚拟机后,转到VirtualBox菜单,然后选择设备->插入来宾添加CD映像...

Allow a few seconds for the mount to occur and the install script to kick off. 等待几秒钟以进行安装并启动安装脚本。 Once they have click the "Run" button in the dialog that popped up in your Guest VM. 他们单击来宾虚拟机中弹出的对话框中的“运行”按钮。

After the script finishes right click the CD Icon on the Desktop and choose Eject. 脚本完成后,右键单击桌面上的CD图标,然后选择弹出。 Then Shutdown the Guest VM. 然后关闭来宾VM。

Create the Shared folder in you Host system using Terminal, I usually put it in my Documents folder, and make sure that your user can access it. 使用终端在主机系统中创建Shared文件夹,我通常将其放在我的Documents文件夹中,并确保您的用户可以访问它。

sudo mkdir ~/Documents/RhelShared
sudo chmod 755 <user> ~/Documents/RhelShared

In the Oracle VM Virtual Box Manager select your VM and then click on the "Shared folders" configuration element. 在Oracle VM Virtual Box Manager中,选择您的VM,然后单击“共享文件夹”配置元素。 In the next dialog click on the Add Folder icon to the right of the Folders List. 在下一个对话框中,单击“文件夹列表”右侧的“添加文件夹”图标。

Then in the popup window select the Host Folder you just created as the Folder Path and give it a Folder Name that will be used by the Guest VM, also tick the "Auto Mount" check-box. 然后,在弹出窗口中,选择刚创建的主机文件夹作为文件夹路径,并为其指定一个将由来宾VM使用的文件夹名称,同时选中“自动挂载”复选框。

After rebooting the Guest VM launch a terminal on the Host and check the user that is associated with the running VirtualBox Guest process is either your user, very likely, or in a group with access to the Shared folder. 重新启动Guest VM后,在主机上启动终端,并检查与正在运行的VirtualBox Guest进程关联的用户是您的用户(很可能是该用户),还是属于有权访问Shared文件夹的组中的用户。

ps aux | grep VirtualBoxVM

Then as per several of the previous answers in a Terminal on the Guest VM add your user to the vboxsf group. 然后,根据来宾VM上终端中以前的几个答案,将您的用户添加到vboxsf组。

sudo usermod -a -G vboxsf <user>

Log out and in again to pickup the change. 注销并再次登录以获取更改。

The shared folder should now be available and accessible as sf_rhelshared assuming you used the same names as I did in the popup window above. 现在,假设您使用的名称与我在上面的弹出窗口中使用的名称相同,共享文件夹现在应该可以使用sf_rhelshared进行访问。


#6楼

For the truly lazy (no typing, only totally easy copy and paste): 对于真正的懒惰(无需键入,只能完全轻松地复制和粘贴):

sudo usermod -aG vboxsf $USER

Log out and back in to make the change active. 注销并重新登录以使更改生效。

I know it's a "me too" solution, but I am truly lazy and didn't find any other solution to appeal my innate apathy... :) 我知道这是一个“我也是”的解决方案,但是我确实很懒惰,没有找到其他方法来吸引我的天生冷漠... :)

Virtualbox共享文件夹权限相关推荐

  1. [Linux] 解决virtualbox共享文件夹没有访问权限的问题

    [Linux] 解决virtualbox共享文件夹没有访问权限的问题 参考文章: (1)[Linux] 解决virtualbox共享文件夹没有访问权限的问题 (2)https://www.cnblog ...

  2. Oracle VM VirtualBox 共享文件夹

    Oracle VM VirtualBox 共享文件夹 **写作约束: ** $ 后面的命令需要在终端执行, $ 本身并不是命令的一部分 Oracle VM VirtualBox 版本: Ubuntu ...

  3. 设置VirtualBox共享文件夹的方法

    文章难度:入门 环境: 软件环境: VirtualBox:5.2.34 主机操作系统: Windows 7专业版 虚拟机操作系统: Ubuntu 16.04 Desktop amd64 硬件环境: C ...

  4. 服务器不能访问共享文件夹权限,win访问服务器共享文件夹权限设置

    win访问服务器共享文件夹权限设置 内容精选 换一换 开发过程中,您有任何问题可以在github上提交issue,或者在华为云对象存储服务论坛中发帖求助.接口参考文档详细介绍了每个接口的参数和使用方法 ...

  5. win10与virtualBox共享文件夹

    关于win10(宿主机)与virtualBox共享文件夹,网上有很多博客可以借鉴,但是我这里讲下针对我使用的virtualBox版本6.1.18出现共享文件夹出现需要注意的地方, 1.选点击设置.共享 ...

  6. 服务器ftp文件不能共享文件夹权限,ftp服务器共享文件夹权限设置

    ftp服务器共享文件夹权限设置 内容精选 换一换 已成功登录Java性能分析.待安装分析辅助软件的服务器已开启sshd.Java性能分析优先选用非交互shell(non-interactive she ...

  7. samba服务器无法共享文件夹,samba服务器设置共享文件夹权限

    samba服务器设置共享文件夹权限 内容精选 换一换 已成功登录Java性能分析.待安装Guardian的服务器已开启sshd.待安装Guardian的服务器已安装JRE,JRE版本要求为Huawei ...

  8. 服务器云共享文件夹权限设置方法,服务器云共享文件夹权限设置方法

    服务器云共享文件夹权限设置方法 内容精选 换一换 本文介绍了镜像服务IMS产品新特性和对应的文档动态,新特性将在各个区域(Region)陆续发布,欢迎体验.关于镜像服务(IMS)的更多历史版本变更内容 ...

  9. 怎么设置服务器文件夹多权限管理,如何设置共享文件夹,小编告诉你如何设置共享文件夹权限...

    为了保护服务器共享文件的安全,我们需要设置不同用户访问共享文件的不同权限,防止越权访问共享文件的行为,尤其是防止随意修改共享文件.随意删除共享文件以及随意复制共享文件的行为.下面,小编就来跟大家讲解设 ...

最新文章

  1. 关于:为什么在 Real Producer 10 Plus 里面找不到 RealAudio 10 with aacPlus的解答
  2. docker 容器退出自动删除 一次性运行
  3. Android学习笔记18:自定义Seekbar拖动条式样
  4. 成功解决极其刁钻bug之TypeError: ‘<=‘ not supported between instances of ‘list‘ and ‘int‘
  5. 微软邮件系统Exchange 2013系列(二)先决条件
  6. java string document_java - String 和 document 的相互转换总结
  7. nginx动态库加载出现is not binary compatible问题
  8. 一个类可以实现多个接口吗_java中接口的概念
  9. 金钱工具类 MoneyUtils.java
  10. JavaSpring菜鸟教程,附Java面经
  11. Control-车辆动力学模型
  12. 泪目!java面试八股文是哪些
  13. 优化家庭广电宽带网络设置
  14. matlab绘图空间曲线,matlab空间曲线绘图
  15. 希腊神话:希腊众神 宙斯和赫拉
  16. 常用性能测试工具有哪些
  17. mldonkey 安装详细过程
  18. RecyclerView之利用ItemDecoration实现万能分割线
  19. 记一次usb3.0千兆网卡的选购经历;
  20. 安徽大学计算机考研考情与难度、参考书及上岸前辈备考经验指导

热门文章

  1. 虚拟机VMware Workstation安装与使用的一点总结,VMwarews6.0.2完美中文绿色精简版下载...
  2. JAVA编程规定约束(阿里巴巴简化版)
  3. “五一”假期消防安全知识要牢记之消防安全知识答题活动
  4. 看雪学院五周年纪念收藏版
  5. java 自考qq群_学生建QQ群 成绩好的同学作业答案发群共享
  6. python读取sas数据集_SAS之DATA步运行机制
  7. Win7 下安装 VC6 和SP5
  8. NC17134 Symmetric Matrix
  9. yb3防爆电机型号含义_防爆电机型号及防爆标志的意义
  10. V9摄影美学三亚国际公馆2013年11月正式登陆三亚,同年12盛大开幕!