If you’ve been following this blog, then you probably know a thing or two about VirtualBox. That’s because we’ve written a lot about it. If you don’t know what VirtualBox is, then let me give you a brief summary.
VirtualBox is a virtualization softwarethat lets you run multiple guest operating systems ( Windows, Linux, Mac OSX and few others) from a single computer known as the host computer.
The host computer should have more than enough resources (CPU, RAM, Hard Drive) to host as many guest operating systems as you want. Hosts with fewer resources will run fewer guest OSs.
Now that you know a thing about VirtualBox, let’s move on to what this post is about. This post is going to show you how to access host folders from Ubuntu guest machines. Remember guest machines run inside a host machine as a separate entity. You can’t just access files and folders from the host machine without first enabling shared folders.
Before you can enable shared folders on the host machine, you must firstinstall VirtualBox guest additions softwareon the guest machines. This software allows the guest machine to completely integrate with the host for seamless operations.
Without the guest additions software, the guest machines will not operate as smoothly as they supposed to, including accessing shared folders.
Next, open VirtualBox from the host machine and select the guest OS you wish to edit, then selectSettings –> Shared Folders. Hit theadd button(plus sign) and browse to the folder you wish to access from the guest machine. When you’re done, close out.
Now, launch Ubuntu and run this commands to add your account to VirtualBox group.
sudo adduser USERNAME vboxsf
Replace USERNAME with your account name in Ubuntu.
When you’re done, restart the Ubuntu guest machine and go to the/media/directory. From Nautilus clickComputer / File System –> Mediafolder and inside it you’ll see a folder beginning withsf_
That’s it! Put content in the folder on the host machine and access it from the Ubuntu guest machine folder.
2. Install virtualbox guest on Linux (Installing virtual-guest-x11 may give an error message. If it is so, just ignore it)