Virtualbox - shared folder: how to connect?

VirtualBox is one of the virtual machines, with which you can, working in one operating system, without being overloaded, work in another. This is necessary for those who, working in Windows, want to try working in GNU / Linux or, if necessary, use programs written under Windows and not working under wine when used as the main operating system GNU / Linux. File sharing is carried out by creating a shared folder VirtualBox.

Do I need antivirus

Many VirtualBox shared folder manuals contain recommendations for tracing viruses that can penetrate from the guest system into the main one, and vice versa.

In fact, viruses are written for a specific system, and these systems are mainly Windows and Mac OS X. Moreover, the viruses are different for them, and if you get Mac viruses from the shared VirtualBox folder with Windows, then there’s hardly anything can hurt. The Linux family of operating systems is usually better protected, and if the user uses special repositories, the chances of specific malicious programs getting into his computer tend to zero.

Another thing is if you use the Internet in the guest system, then save pages or files to a shared folder, and then transfer them to another computer. But in this case it is enough to have an antivirus in the main system.

And it is quite another thing if you have relatives and the main guest OS. Then antiviruses need to be installed.

Install add-ons

In order to work with shared folders in VirtualBox and to work comfortably enough in the guest OS, you need to install add-ons for it. They are installed after downloading the latest one and going to the menu of this program in the main OS “Devices”, in which we select “Install add-ons of the guest OS”.

Then, as a rule, an automatic loader appears, and the program is automatically installed (you may have to click on the Next and Finish buttons if these add-ons are installed for Windows).

Add shared folder to VirtualBox

virtualbox shared folder

After downloading the guest OS, go to the program menu located in the main OS, then go to the “Devices” - “Shared Folders” menu.

In the dialog box that appears on the screen, click on the folder icon with a green plus located on the right at the top of the window.

The following window will open in which we select the path where the shared folder will be located. Below we indicate the name of the folder that will be displayed in VirtualBox. In this window, you can put a tick in front of “Read Only” - in this case, the guest OS will only be able to view and collect files from the shared folder, and also “Create a permanent folder”, which will indicate to the program that this folder is not created for one session but forever.

Consider how to connect the shared folder VirtualBox in different guest systems.

Display the shared folder in the Windows guest system

virtualbox shared folders windows

Creating a shared folder in VirtualBox is not such a trivial action as it may seem at first glance. When creating such a folder according to the algorithm presented in the previous section, this folder will not start to be displayed automatically in the guest system.

Consider the procedure for displaying it if the guest is Windows.

Click "Start" (so we will call the button, which was originally called in Windows and which then began to be depicted only with the logo of this system), select "Run", in the dialog box that appears we register "net use x: \ vboxsvr \ {folder } ". Here, x is a drive letter, you can also specify another one, but it must be Latin and different from the disks used on your computer. This disk will be networked.{folder name} is the real name of your shared folder, which is given without curly brackets.

virtualbox how to connect a shared folder

Do not forget to make a space after the drive letter, otherwise the command will not be executed. In Windows XP, the folder will appear in "My Computer", and from 7 and up - in the network environment.

With the correct sequence of actions in Windows, VirtualBox shared folders will appear.

What to do if the shared folder does not appear?

Windows has a closed code, so sometimes the actions of this system are unpredictable. In case the steps described above lead to nothing, you need to configure the shared folder VirtualBox. To do this, in the network settings, we add detection and file sharing of public networks. After that, the \ VBOXSVR folder should appear, in which all created shared folders will be contained.

shared folder in virtualbox

Sharing whole disks

If you have Windows 10 installed as both the main and the guest OS, then you can add entire disks as shared folders. This should work with other versions of this OS, but according to some reviews, this did not work with Windows 8.1, although this may be due to older versions of the virtual machine under review.

To do this, when creating a shared folder in the “Path to folder” field, click on “Other”,then the “This computer” list will appear, in which we click on the disk we need and click on the “Select folder” button. Disk sharing is done through network discovery and file sharing. After that, VBOXSVR will be displayed in the network explorer, in which the contents of the shared disks will be shown.

Add a user to the VirtualBox groups in the GNU / Linux guest system

Everything is a little more complicated here. This is due to the fact that there is no single distribution for this OS, so there are some features for each distribution. First of all, the user must be added to the group or groups related to vbox *. Instead of an asterisk, a continuation of the name of this group may be written, but the beginning will be like this. This action can be performed in graphics programs for those distributions for which they are, or by using a terminal.

With the help of the latter, this action is carried out with administrative rights. Ruth or sudo give the command usermod -aG vbox * {user_name}. Here, instead of the asterisk we append a real-life group or groups separated by a space, instead of {user_name} we write the user name without curly braces.

Mounting a shared folder in GNU / Linux for permanent use

virtualbox shared folders linux

The folder may become available after creating the VirtualBox share, as described above, or you may need to manually register it in fstab.

We open any text editor from the administrator, in it we open the / etc / fstab file, in which we enter:

{folder_name} / media / {name_of_created_folders_in__media_directory} vbox * defaults, gid = {x} 0 0

All words are entered without braces. Initially, in the media folder, the administrator creates an additional folder that you can name as you like, but it’s better to name it as the shared folder in VirtualBox. {folder_name} corresponds to the name of the shared folder. {name_of_created_folders_in__media_directory} corresponds to the name of the folder created by the administrator in the media directory. To find out {x}, in gid you need to run the command

cat / etc / group | grep plugdev

At least, for one of the popular distributions - Ubuntu. If you have another distribution, it is better to give a command after grep to the plug command, it will find what applies to it and what to choose from it.

virtualbox shared folder setting

As a result, a line will appear with a few colons after the last word entered in the previous command. {x} in / etc / fstab will be the number that appears in the output after the second colon.

Editing the / etc / fstab file will make Linux's VirtualBox shared folders available forever.

Temporarily mounting a shared folder on a GNU / Linux guest

If it is necessary to mount the shared folder during the current session, you can issue a mount command from the current user. To do this, a directory is created in the user's home folder where the mount will be performed, for example, all.

Related news

Virtualbox - shared folder: how to connect image, picture, imagery

Virtualbox - shared folder: how to connect 10

Virtualbox - shared folder: how to connect 2

Virtualbox - shared folder: how to connect 90

Virtualbox - shared folder: how to connect 2

Virtualbox - shared folder: how to connect 88

Virtualbox - shared folder: how to connect 98

Virtualbox - shared folder: how to connect 34

Virtualbox - shared folder: how to connect 6