How to Map a Host Directory in VirtualBox
When you run virtual machines, occasionally, you will need to Map a Host Directory in VirtualBox. I’m using Oracle’s VirtualBox software. You might be running a virtualbox to use older programs, such as PanelBuilder32. RSView32 would be another reason to run a virtualbox. With VirtualBox, you can run Windows XP as a process on a Windows 10 computer. You might even have a need to run the DOS operating system for older equipment in your plant. Another use for virtualbox might be to test out a different type of operating system all together. You might want to experiment with Linux. You can install VirtualBox on a Windows host, then set up Linux as a virtual machine. On the other hand, you can use Linux as your host. Windows can be a virtual machine.
Occasionally, the older operating system needs to access files on it’s host. One reason for this would be for backups. Another reason would be to access files that you have downloaded from the internet. For example, if you are running MSDOS, you cannot download files easily. In other words, there is no web browser. You might download files, and put them in a specific directly. At this point, your virtual machine can access them.
With VirtualBox, you can even configure how much memory and processor power to assign to each machine.
Keep in mind that older operating systems likely have security vulnerabilities. If these are un-patched, it could potentially be a threat to the host machine.
I’m using Virtualbox 6.1 for this example.
Create a folder on the Host Machine
First, we will create a folder on the host machine. The purpose of this folder is solely to transfer files to the virtual machine. Additionally, the Virtual Machine can store files in this folder. After that, your host file system can access them.
In this case, I’m running Linux. Basically the setup for Windows is the same. We just need to create a folder somewhere in our file system. Additionally, we need to remember the path of where we created the folder. For example, I’m creating a folder called “bay2”. The path for this folder is simply at “/home/ricky”.
Next, we’ll right click your Virthal Machine, and go to “Settings”.
For example, I’m mapping a folder from Linux into Windows XP.
Now, click the “+” on the right hand edge of your screen. This will open the window that allows you to map a drive.
Under “Folder Path” click “Other”. Browse for the folder on the host file system that you wish to map.
I’m also selecting “Auto-Mount”, and I’ll make this permanent.
Accessing the folder from the Virtual Box
At this point, I’ll go into the virtual machine, and go to “My Computer”. Obviously different operating systems will have a different way to go about this. What we want to see is all the drives that are available.
As you can see, I now have a network drive. This is Drive Z. I simply open this drive to access the files on the host operating system.
Summary — Map a Host Directory in VirtualBox
In short, mapping a host folder into a virtual box is very easy. First, go to the settings of the virtual box. Next, go to “Shared Folders”. Add a new Shared Folder. Browse for the file on your host, assign a drive letter, and you should be ready to go! If you run VirtualBox, I would recommend downloading the extension pack. You get access to other features such as additional options for USB Interfaces. I’m using Virtualbox 6.1 for this example.
Visit the Information Technology Category for other similar posts!
— Ricky Bryce