解决 VirtualBox里Ubuntu的共享文件夹无法访问 之问题

原文标题:You do not have the permissions necessary to view the contents of ‘shared_folder’
原文链接:http://darrenma.wordpress.com/2012/07/18/you-do-not-have-the-permissions-necessary-to-view-the-contents-of-shared_folder/


转载于此。其实最重要的就是文末的最后一条命令。

sudo usermod -a -G vboxsf darren

darren是你自己的用户名。比如我的是xwchen。
使用这个命令后,如果不能马上生效,需要重启一下系统。
这样,我在Windows里共享给VirtualBox里Ubuntu的文件夹就能访问了。


I develop within Virtualbox(VB). Often I need to be able to share files and folders between my host machine(the machine VB is installed on) and my client machine(the OS installed in VB, in this case Ubuntu).

It’s easy to share a folder. If you follow these steps:

1) Open Virtualbox, select your OS on the left then click on Shared Folders on the right.

2) Click on the Green cross on the top right to add a new Shared Folder

3) Fill out the form by selecting which folder you want to shared between your machines. Check auto mount and Save.

4) Start up your Ubuntu now and navigate to /media and you will see your shared folder.

Easy right? But it’s not over. If you try to open this shared folder you’ll probably land up with this error: “You do not have the permissions necessary to view the contents of ‘shared_folder’ “

To fix this you need to add the correct permission group to your user. (Resource) but seeing as I use Ubuntu 12.04 I was unable to find Manage Groups anywhere. It seems that it’s hidden under gnome 2. (Resource)

If you are like me and want to install as little extra stuff onto your machine as possible then instead of using gnome tools or ubuntu tweak to manage the groups lets use the terminal. Just type

1
sudo usermod -a -G vboxsf darren

(and replace ‘darren’ with your username)

*NOTE the change will only be visible once you logout and login again! (Resource)

There you go. Now if you go to /media/ you’ll be able to see your shared folder and access it. I also like to make a symlink from there to my home directory to make it even easier to access.


  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: VirtualBox是一款虚拟机软件,可以在其中安装不同的操作系统。如果你在VirtualBox中安装了Ubuntu操作系统,想要与主机共享文件夹,可以按照以下步骤操作: 1. 在VirtualBox中启动Ubuntu操作系统,进入桌面界面。 2. 点击菜单栏中的“设备”-“安装增强功能”,安装增强功能后,会自动挂载一个名为“VBoxGuestAdditions”的ISO镜像文件。 3. 打开终端,输入以下命令安装增强功能: sudo mount /dev/cdrom /mnt cd /mnt sudo sh VBoxLinuxAdditions.run 4. 安装完成后,重启Ubuntu操作系统。 5. 在主机中创建一个文件夹,例如“share”,将需要共享的文件放入该文件夹中。 6. 在VirtualBox中,选择Ubuntu操作系统窗口上方的“设备”-“共享文件夹”-“设置共享文件夹”,将主机中的“share”文件夹设置为共享文件夹。 7. 在Ubuntu操作系统中,打开终端,输入以下命令挂载共享文件夹: sudo mkdir /mnt/share sudo mount -t vboxsf share /mnt/share 8. 挂载成功后,可以在Ubuntu操作系统中的“/mnt/share”路径下访问共享文件夹中的文件。 希望这些步骤可以帮助你成功实现VirtualBoxUbuntu操作系统的文件共享。 ### 回答2: VirtualBox是一款开源的虚拟机软件,可以模拟多种计算机操作系统,在其上运行的多个操作系统可以互相隔离、独立、安全地运行,以达到在同一计算机上运行多个操作系统的效果。而Ubuntu则是一款基于Linux内核的操作系统,它采用GPL授权的自由软件,无需购买,可以自由使用、分享、修改。 在VirtualBox中运行Ubuntu系统时,有时需要将虚拟机中的文件与主机共享,以便于在虚拟机主机之间传输文件或共享资源。具体操作步骤如下: 1. 共享文件夹设置 在VirtualBox中选择需要运行Ubuntu虚拟机,依次选择“设置”-“共享文件夹”,在该页面中点击“添加共享文件夹”按钮,在弹出的窗口中选择要共享文件夹路径、名称以及共享模式(只读或读写),确定后点击OK。 2. 安装增强功能 在Ubuntu系统中需要安装VirtualBox增强功能,以便于访问共享文件夹。在Ubuntu系统中打开终端界面(快捷键Ctrl+Alt+T),输入以下命令: sudo apt-get update sudo apt-get install dkms build-essential sudo apt-get install virtualbox-guest-additions-iso 3. 挂载共享文件夹Ubuntu系统中打开终端界面(快捷键Ctrl+Alt+T),输入以下命令挂载共享文件夹: sudo mkdir /mnt/share(创建挂载点) sudo mount -t vboxsf 共享文件夹名称 /mnt/share 注意:共享文件夹名称应与设置中的共享文件夹名称一致。 4. 更改文件夹权限 在Ubuntu系统中挂载共享文件夹后,需要更改文件夹权限以便于操作。在终端界面中输入以下命令: sudo chown -R 用户名:用户组名 /mnt/share 注意:用户名和用户组名应该是当前登录用户的名称和组名。 到此,我们就可以在虚拟机Ubuntu中访问共享文件夹,并进行文件操作和数据传输了。 总之,利用VirtualBox配置和使用Ubuntu虚拟机,在其上建立和操作共享文件夹,可以更好地满足多个操作系统之间资源的共享和管理需求,使我们的工作和学习更加高效和便捷。 ### 回答3: VirtualBox是一款开源且免费的虚拟机软件,在其中安装的虚拟机可以实现很多的功能,如共享文件夹共享文件夹功能可以让我们轻松在Windows和Linux两个系统中共享文件,让我们更加方便的实现跨平台操作。 在这,我们一步步教你如何利用VirtualBox共享文件夹。 1. 安装VirtualBox扩展包 首先你需要下载安装VirtualBox扩展包,在VirtualBox官方网站上可以找到下载链接。安装扩展包可以增强VirtualBox的功能,其中也包括共享文件夹功能。 2. 设置共享文件夹VirtualBox中选择你想要设置共享虚拟机,点击"设置" -> "共享文件夹" -> "+号",在弹窗中输入共享文件夹的路径,设置自动挂载文件夹选项和可读写权限。勾选"固定分配"选项可以设置共享文件夹虚拟机中的目录名,如果不勾选,则目录名是动态分配的。 3. 安装增强功能 在虚拟机的操作系统中安装增强功能,可以增强虚拟机的性能,并使共享文件夹稳定运行。在虚拟机中点击"设备" -> "安装增强功能",按照提示操作即可。 4. 挂载共享文件夹虚拟机中挂载共享文件夹需要先创建一个本地目录,用于映射共享文件夹。在Linux中,可以使用命令"sudo mkdir /mnt/sharedfolder"来创建一个/mnt/sharedfolder目录。接着使用命令"sudo mount -t vboxsf sharedfolder /mnt/sharedfolder"来挂载共享文件夹。其中,sharedfolder是你的虚拟机共享文件夹的名称。你也可以在/etc/fstab中配置共享文件夹自动挂载选项。 以上就是VirtualBox Ubuntu共享文件夹的全部内容。在实际应用过程中,可能会遇到一些挑战,但这样的共享方法能够让我们大大提高工作效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值