Tuesday, July 17, 2012

Virtually Shared Folders

While in the midst of a class discussion, one of my classmates was doing a presentation on virtualization. The presentation was done very well and afterwards questions were asked. One question that seemed to be on most minds was how to access folders on the host from the guest installation. This is actually a very easy thing to do, at least with VirtualBox and I would expect that VMWare is just as simple.

I was actually surprised with how many students in the class had not explored setting up a virtual machine. The entire process is actually pretty simple (at least to me). The benefits of having a virtual machine are really only limited to one’s imagination on what would a person do with an OS that they didn’t have to care if it crashes? How much exploration or trial and error would someone be willing to do if they didn’t have to worry about the ramifications of making a mistake? What would be the educational benefits of being able to try something totally crazy or bleeding edge new?

In this how-to I’m going to show just how easy it is to set up file sharing between an openSUSE host and a Windows guest. Perhaps once people get the opportunity to see just how simple this is, more people will consider being a little more adventurous with their systems. This also gives new IT students an idea of how simple it can really be to set up a virtualized server running a variety of different operating systems for their users based on requirements of the clients.

The first thing I usually do is to take a look at my uppermost file system and decide which ones I want to share with any particular guest. Although it is completely possible to simply provide access to the entire root system of the host, I don’t recommend it. If something should go buggy or awry with any particular guest situation, I personally wouldn’t want it to have access to too much on the host system.

Since I use virtual machines fairly frequently, I have a file structure that I create with every OS installation with the intent of providing sharing to a virtualized guest. In this case I am going to be sharing Documents, Downloads, Pictures and School.



Once the decision of what folders will be shared then we can go ahead and start our virtual machine and set these folders up to be accessed from our guest machine. Obviously this decision can be done simply from the selection process or, as in my earlier day of setting up virtual machines, a person may want to create folders specifically to be shared with each machine in particular. As an example “Windows Folder” either in the top tier or as a sub folder perhaps under documents.

One example of why this would be good is if a person decides they don’t want to provide internet access to their virtual machine. I typically turn off internet to my Windows machines and only download or access the internet through my Linux host. By doing things this way I don’t worry too much about virus protection or malware getting to my Windows install. Even if something does get in, I really don’t care since the OS is just a virtual guest which can be simply replaced anytime. This decision can be invoked or revoked any time with just a simple setting.

The next action to take is to start VirtualBox and go into the settings tab in the top left prior to starting the actual guest OS.



Inside the settings, on the left hand side, navigate down to “Shared Folders” and click on it. In the window that opens over on the right shows a file tree window and just to the right of that is a tiny folder with a green plus sign. Click on this little folder and a file browser will open allowing navigation to the folder to be shared between host and guest systems.



Repeat this process to add all the files you will want to allow access to between the guest and the host. As I stated earlier, I wouldn’t get overly zealous with this action. It is much safer to be conservative especially when various file types will probably be created and shared to the host over a period of time. Keeping your file system clean and organized is always a good thing.

Repeat this process to add all the files you will want to allow access to between the guest and the host. As I stated earlier, I wouldn’t get overly zealous with this action. It is much safer to be conservative especially when various file types will probably be created and shared to the host over a period of time. Keeping your file system clean and organized is always a good thing.



This is all fine and good for being able to access our folder system on the host machine but, what we really want to do is be able to access these documents with an application set up to run in our guest. So lets go ahead and fire up Adobe Illustrator and try to access some image file which is truly stored in our Pictures folder on our openSUSE host machine. Files for use in applications can either be accessed this way or they can be copied over into the guest machine and utilized there. Keep in mind though that the guest machine in itself without a lot of files in it takes up a lot of space. Windows 7 is kind of a space pig (in my opinion) although the sacriface is worth the improvement over the Vista release.


Once we have our software open, lets go ahead and open up a file we want to work with.


The end results are exactly as we want. We opened a file which was originally stored on the host machine for use in an application written to run on our guest machine. Kind of gives us the best of both worlds doesn’t it?

As can be seen this was really easy to set up and execute. If for any reason anyone runs into a problem with their folder sharing with VirtualBox, the first thing to do is go to the VirtualBox website and sift through the forums. Odds are really good someone else has asked the same questions or had the same problems.









1 comment: