VirtualBox怎么共享文件夹

访问共享文件夹的方法之一 在我的电脑地址栏里输入  \\Vboxsvr\



https://helpdeskgeek.com/virtualization/virtualbox-share-folder-host-guest/

Share Folders between Host and Guest OS in VirtualBox

VirtualBox is a great free virtualization software from Oracle. I’ve previously written many articles on VirtualBox, including how to install Ubuntu in VirtualBox and how to run VirtualBox from a USB drive.

If you’ve had any experience with virtualization software, you’ve probably also heard of VMWare and Hyper-V. I’ve previously used Hyper-V from Microsoft for converting my PC into a virtual machine and one feature that I really liked was the ability to easily share files and folders between the guest and host operating system.

In VMWare and Hyper-V, all you have to do in order to share files from the host OS to the guest OS is drag and drop between the desktops. Super easy. When I switched over to VirtualBox, I realized that sharing folders in VirtualBox was not as simple as dragging and dropping.

This was really annoying to me at first and it took me a little while to figure out exactly how to do it! In this article, I will walk you through the steps for sharing folders between guest and host OS in VirtualBox.

Share Between Guest and Host in VirtualBox

First, you have to install VirtualBox Guest Additions in the guest OS. You can do this by going to Devices and clicking on Install Guest Additions CD image.

Once installed and your guest OS rebooted, you need to create a virtual shared folder. You can do this by going to Devices again and clicking on Shared Folders – Shared Folders Settings.

Now click on the Add New Shared Folder button on the right.

In the Folder Path box, click the down arrow and then click Other. Browse to the folder on the host OS that you would like to share with the guest OS. In the Folder Name box, give your share a name. You can choose to make it read-only, auto-mount the folder after restarts, and make the shared folder permanent.

Click OK and the new shared folder will show up under Machine Folders if you chose to make it Permanent, otherwise it will show under Transient Folders.

Now click OK to close the Shared Folders dialog. You have to do one more thing in order to be able to actually access the folder on the host OS. Depending on whether the guest OS is running Windows or Linux (Ubuntu, etc), the method is different.

Windows Guest

In this case, you can either browse to the shared folder by going to ComputerNetworkVBOXSVR or you can map a drive letter to that shared folder.

I prefer the second method to make it easily accessible. The easiest way to map the folder to a drive letter on the virtual PC is to simply right-click on the folder as shown above and choose Map Network Drive.

Pick a drive letter, make sure Reconnect at login is checked and then click the Finish button.

You can also map the network drive using the command prompt, if required. To do this, open a command prompt and type in the command below.

net use z: \\vboxsvr\sharename

Simply replace sharename with the Folder Name you used when adding a share. Note that you do NOT need to change vboxsvr. Also, you can use any letter that is currently free; it doesn’t have to be Z if you don’t want. That’s it! You should get a message like The command completed successfully as shown below.

Now when you go to Explorer or My Computer, you’ll see the new drive mounted and ready for access!

Linux Guest

To mount a shared folder in a Linux Guest OS such as Ubuntu, type in the following command in terminal:

mount -t vboxsf [-o OPTIONS] sharename mountpoint

Replace sharename with the name of the share and mountpoint with the path where you want the share to be mounted (i.e. /mnt/share).

Not too hard eh? Of course, if you didn’t know you had to do all this, it could get quite frustrating! Now when you need to share files or folders in VirtualBox, you’ll be able to do it easily. Enjoy!






VirtualBox共享文件夹是一种在虚拟机和主机之间共享文件的功能。根据引用\[1\],如果你在虚拟机下查看共享文件夹的属性发现没有权限,你可以通过在终端中输入指令"sudo usermod -aG vboxsf $(whoami)"来解决这个问题。这个指令将把当前用户添加到vboxsf组中,从而获得对共享文件夹的访问权限。 另外,根据引用\[2\],你也可以通过以下步骤来设置共享文件夹: 1. 点击设备,然后选择共享文件夹。 2. 在固定分配旁边有一个添加共享文件夹的标识,点击该标识。 3. 选择共享文件夹的路径,并勾选自动加载和固定分配选项。请确保文件夹的名称不包含中文,并可以放在任何盘符下,比如E:\shared。 4. 点击设备,选择安装增强功能。在弹出的选择框中点击运行。 5. 等待增强功能的安装完成,可能需要一些时间。安装完成后,重新启动虚拟机。 通过以上步骤,你应该能够成功设置和访问VirtualBox共享文件夹。 #### 引用[.reference_title] - *1* *2* [virtualbox:如何设置共享文件夹以及可能会遇到的问题](https://blog.youkuaiyun.com/LUCAS004/article/details/108181989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值