VirtualBox怎么共享文件夹

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

VirtualBox怎么共享文件夹_第1张图片


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.

VirtualBox怎么共享文件夹_第2张图片

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.

VirtualBox怎么共享文件夹_第3张图片

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.

VirtualBox怎么共享文件夹_第4张图片

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

VirtualBox怎么共享文件夹_第5张图片

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.

VirtualBox怎么共享文件夹_第6张图片

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.

VirtualBox怎么共享文件夹_第7张图片

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.

VirtualBox怎么共享文件夹_第8张图片

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.

VirtualBox怎么共享文件夹_第9张图片

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

VirtualBox怎么共享文件夹_第10张图片

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.

VirtualBox怎么共享文件夹_第11张图片

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

VirtualBox怎么共享文件夹_第12张图片

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怎么共享文件夹)