How to make a shared folder on VirtualBox. Ubuntu shared folder

VirtualBox is a virtualization system that can work with a large number of well-known operating systems. In short, it can install and run the OS on another OS. For example, Windows on Ubuntu. You may need this for testing, reviewing, or surfing the web safely. To exchange data between operating systems, there is a method of creating public folders.

Bit of theory

VirtualBox is a cross-platform program for virtualization, that is, there are versions for all known OSs. Distributed under the GNU GPL 2 license, which allows you to use it for absolutely any purpose. This is a very convenient tool for creating a trial version of the operating system. For example, a person decided to switch to Linux, but so far he would not want to part with simple Windows. Therefore, he can install any Linux distribution for himself and slowly study it.

virtualbox shared folder

Also, the virtual environment has another important advantage - it is very easy and simple to reinstall. This can be used to test various programs, visit unsafe sites and other actions that may violate the integrity of the OS. In the event of a malfunction, the system can be quickly reinstalled. The only inconvenience is that you cannot store personal data in it. But for this, there is a basic OS.

Most often, this approach is used by Linux users. Since many types of Windows software are not available on Linux, you can create a virtual environment to run them. Data exchange between the OS occurs using a shared folder in VirtualBox.

Terms

When working with VirtualBox, the terms "Home" and "Guest" operating systems are used. ā€œHomeā€ is the one in which the program is installed, and ā€œGuestā€ is another OS in VirtualBox.

virtualbox windows 7 shared folders

This article will discuss two options for using shared folders. The first is Ubuntu's home OS, the guest is Windows 7. And then vice versa.

Before you make a shared folder VirtualBox, you need to install the program itself. In Ubuntu, this can be done in the application center by typing VirtualBox in the search. After successful installation, you need to download the image of the guest operating system.

Install Windows 7

Before starting the manipulation of setting up a shared folder in VirtualBox, you need to install a working system in it. You can do this in two ways: download the image from the Internet or use the original disk.

Finding Windows 7 on the web is no problem. After downloading, you need to go into VirtualBox and click on the "Create a new virtual machine" button. A wizard window will open in which you need to enter its name. It can be arbitrary, for example, "Windows 7". Type of system - Microsoft Windows line. Version - 7, depending on the bit depth of the downloaded image, you need to select the number of bits. RAM can specify 1 GB. For the simplest tasks this is enough.

The choice of a hard drive is possible from an existing one or by creating a new one. When pointing to the last item, the wizard will be called. It will help create a new virtual disk. It is better to choose a dynamic type, as this will automatically expand it if necessary.

Work with image

After clicking the Finish button, the virtual system can be considered almost configured. However, you need to tweak it a bit. Therefore, in the list of systems it is necessary to select it and click on the "Configure" button. In the settings, I’m interested in the ā€œMediaā€ item. Going to it, in the "Storage media" section, click on the add new device button and select "Add optical drive." The system will prompt you to immediately connect the image. He needs to show the file with the system that was downloaded. It is worth noting that in the latest versions of VirtualBox there is already a ready-made device for connecting images, so for it you just need to specify the path.

windows shared folders virtualbox

Now it remains to start the virtual machine. A system installation boot window should appear, as if it were being installed on a real computer. All installations are simple and should not cause questions. In addition, many probably already know how to install an operating system.

How to make shared folders in VirtualBox on Ubuntu

When everything is ready for use, you need to start the guest OS. In it, you must first install a set of add-ons specifically for this operating system. This is necessary to integrate the necessary drivers for graphics, web and other components into the OS. To do this, go to the device’s menu in the virtual machine window and select ā€œMount the guest OS add-ons disk imageā€. After a while, a window with the ability to install will appear. In the process, the system may warn that some drivers are not suitable, for which you need to click "Continue" or "Install Anyway".

virtualbox ubuntu shared folder

Now, while still in the guest OS, you need to go to "Devices" and select "Shared Folders", and then - "Configure Shared Folders". In the window that appears, by clicking on the button with the image of the folder and plus sign, call the window with the path. Optionally, you can check the boxes opposite the "Auto Connect" and "Create Permanent Folder" items. This will prevent you from mounting this shared folder every time.

virtualbox how to make a shared folder

Now you need to configure the VirtualBox shared folder in your home OS, in this case in Ubuntu. You can create it in the terminal or in the Nautilus shell. Now, right-clicking on the ā€œMy Computerā€ icon, select ā€œMap Network Driveā€. The desired folder is specified in the path, and everything is saved. After rebooting the operating system, a directory should appear that can be used between the guest and home OS. This is how data is transferred through the VirtualBox shared folders in Windows 7.

Using the Windows 7 Operating System as a Home

To install VirtualBox in a Windows environment, you will have to visit the official website of the project and download the latest version of the program. Installation is no different from any other application. Then, the Ubuntu guest OS is installed in the virtual machine.

Ubuntu image can be downloaded for free from the official site. The installation process of the operating system was described in detail above using the example of Windows 7. However, the initial configuration of one of the Linux systems may raise some questions. Those new to Ubuntu for the first time should talk a bit about how the process works.

After starting the disk image in the virtual machine, a window will appear before the user, approximately the same as in the image below.

virtualbox shared folder setup

Almost any Ubuntu image is a Live CD. That is, you can already start using it without installing the system, so to speak, try it. Here, in the first window, you can select the language. Then the installation wizard will begin its work. He will check whether the PC configuration is suitable for the system and offer to download updates at boot time, as well as use third-party software. It is recommended to put both checkmarks.

In order not to bother with manually creating partitions on the disk, it is better for beginners to specify the upper type of installation. After clicking the ā€œContinueā€ button, the procedure itself will begin. As a result, a new virtual machine with the Ubuntu system on board will appear in VirtualBox.

Configure Shared Folder

Just as in the previous case, to create a shared folder in VirtualBox, you need to start Ubuntu and select the "Devices" menu in the window. There, find "Mount the guest OS add-ons disk image." It will be mounted as a CD-ROM. However, in order to run it, you need superuser rights. Therefore, you need to go to the terminal. In Ubuntu, this can be done with a combination of Crtl + Alt + t. In the terminal, enter sudo / media / cdrom / mounted_drive_name. Then you need to restart the guest OS.

virtualbox create shared folder

After restarting, you can create a shared folder in VirtualBox. Start with a home OS. In the device menu of the window of the running virtual machine, there is the item "Shared folders". In it you need to select "Configure public folders." This window indicates the path to the existing directory in the home OS, which will be used as a shared one. Now you need to configure the VirtualBox shared folder in Ubuntu. To do this, the sudo mkdir / media / share command is executed in the terminal. To set write permissions you need to use sudo chmod 777 / media / share. And now it remains to connect everything - sudo mount -t vboxsf public_folder_name in the OS / media / share. From this moment, a new folder is available in both OS - guest and home.

Conclusion

This article covered how to set up VirtualBox shared folders on Windows and Ubuntu. Using the examples of these two operating systems, you can configure VirtualBox in other OS versions in the same way. The differences between the steps to configure the VirtualBox shared folder in Winwows 7 are not much different from XP, 8 or 10 versions.

More difficult will be the installation on systems like CentOS, Fedora and the like. However, there are a lot of instructions aimed at solving the problem in these OSs.

Source: https://habr.com/ru/post/K13856/


All Articles