Sharing folders between host and guest OS in VirtualBox

[Host OS: Windows XP, Guest OS: Ubuntu 8.10]

If you are using VMware as your virtualisation software you will be able to copy files directly from the host to the guest OS, and vice versa. But unfortunately this feature does not exist in VirtualBox. Not yet at least.

However, there is a very easy way you can share files between the host and guest when using VirtualBox – using Shared Folders.

First you have to create folder in your Windows host. For example, create a folder on your desktop called “myshared“.

Then start your Ubuntu VM. After you get to the desktop, press the right-Ctrl button so that your mouse pointer can move outside the Ubuntu desktop. From the menubar, go to Devices-> Shared Folders. After that click the Add New Shared Folder button and then browse to the folder you created earlier (myshared). Make sure you tick the “Make Permanent” checkbox.

selecting folder to be shared

After you have added the folder, click OK and return back to your Ubuntu desktop. Then create a folder in Ubuntu which will be used as the shared folder on the guest OS. For example, create a folder called “SharedItems” on your desktop.

Then open a new Terinal window (Applications -> Accessories -> Terminal) and execute the following command:

sudo mount -t vboxsf myshared Desktop/SharedItems

The text in red is the name of the shared folder in the Windows host and the text in blue is the directory path of the shared folder on the Ubuntu guest.

Once you’ve done that, you can now share files between the two OSs by simply placing files in the folders. Here’s an example. I put a GIF file in the myshared folder and when I open the SharedItems folder, I have that file available for me.

tadaa!

There’s just one more thing to do now. To make sure that the shared folders are mounted automatically when you start your computer, open Terminal and execute the following command:

sudo gedit /etc/init.d/rc.local

This will open the rc.local file in Gedit. Now scroll to the bottom of the file, add the following line and save it.

sudo mount -t vboxsf myshared /home/nass/Desktop/SharedItems

Once again, the red text is the name of the shared folder in the Windows host and the text in blue is the directory path of the shared folder on the Ubuntu guest.

The difference here is that since I created my folder on the Desktop, I had to give the full path. But earlier I didn’t have to write the “/home/nass” part because when you open Terminal, by default you are placed in your Home folder.

About these ads

46 Responses to Sharing folders between host and guest OS in VirtualBox

  1. alex says:

    thanks alot, worked like a charm

  2. sowmithry says:

    Thanks a lot,
    If I want to share folders between Host Ubutnu and Guest Windows XP/ Vista.
    And if I want to share folders which are not on desktop, like if I want to share folder “oracle” which is under /opt/oracle in my Ubuntu 8.10 with my Guest OS windowsXPSP2/Vista.
    Thanks waiting for ur mail my ID: sowmithry87@gmail.com

  3. esender says:

    Sweet thanks.

    One thing I noticed on Ubuntu 8.10 is that the shared folder should have all lower cases. I noticed that it gave me a “Protocol error” right before I tried lower case.

    Not sure if that is common Linux knowledge, I am pretty new to it all..

  4. ClarkKent says:

    Extraordinarity: ,

  5. analiseramil says:

    thanks so much!

  6. Ajeet says:

    Thanks a lot buddy. Very helpful stuff.

  7. Kiran Kumar says:

    Thanks a lot..

  8. jeri says:

    thanks a bunch! :)

  9. Bob10 says:

    Why aren’t you answering any of these questions? ,

  10. Coder44 says:

    In the most extreme cases nucleotides are inserted and deleted. ,

  11. RockJock says:

    This doesn’t seem to be working for me…I’m sure that it’s “user error”, but I get the following error:

    mount: unknown file system type ‘vboxsf’

    Any suggestions…?

  12. sri says:

    I have got windows vista as my host os and i have installed solaris 10os through vmware.Now I want to share folders from my host os to guest os ……………can anyone help me in that……………..?

  13. sulasno says:

    working with WinXP as host and Ubuntu as guest

    appreciate similar tips when host and guest is WinXP

  14. srilaxmi says:

    Works perfectly, very helpful!

  15. bhojpuri videos…

    […]Sharing folders between host and guest OS in VirtualBox « the ubuntu experiment[…]…

  16. Diseño| Hosting| Computadoras…

    […]Sharing folders between host and guest OS in VirtualBox « the ubuntu experiment[…]…

  17. best hosting provider…

    […]Sharing folders between host and guest OS in VirtualBox « the ubuntu experiment[…]…

  18. top web hosting free…

    […]Sharing folders between host and guest OS in VirtualBox « the ubuntu experiment[…]…

  19. Carlos, servidor dedicado…

    […]Sharing folders between host and guest OS in VirtualBox « the ubuntu experiment[…]…

  20. Gogo says:

    Nice, thank you! Worked perfectly!!

  21. SK says:

    Thank you. Worked on Windows 8 host and centos as guest os.

  22. Ketan says:

    Can it work with Windows Xp and Windows 7?

  23. I am using Windows 7 host and Mint Linux Guest and I got the protocol error. I then closed the Guest down and renamed the default Windows share name to something all lowercase, then restarted the Mint/Guest and renamed the Mint Desktop shared folder the same name all lowercase and it “mounted” fine for me, very pleased, thanks

  24. CK says:

    Thanks! Win7 (Professional) Host with Ubuntu (12.04) Guest, worked like a charm! Might just wanted to add that your username is ‘nass’, on the final step they could browse to location and type pwd to see path.

  25. w says:

    I can’t follow this instruction-
    Then open a new Terinal window (Applications -> Accessories -> Terminal) and execute the following ….
    I am using win7 and guest is xp.

  26. 3 maximum aperture, fixed lens mount, auto focus features, 2.
    A montage specially edited for the occasion works best. s r CMOS
    sensor, BIONZ impression processor chip in addition
    to a Sony Grams contact with powerful (10x optical move, 25-250 mm range) wide-angel mega-zoom (26 mm) help in
    choosing stunning golf swings quite possibly with low-light circumstances.

  27. sunitha says:

    i am new to virtualization windows xp is my host os and i have installed virtualbox with ubuntu 12.10 desktop as guest when i try to shared folder i get error msg
    mount : unknown filesystem type ‘vboxsf’
    plz help me

  28. It is absolutely simpler over a lot of men and women believe.
    And with good reason because sometimes running an app on the big screen is nothing short of magical.
    Being a computer and laptop manufacturer, the company jumped in tablet
    PC market soon after they came into market.

  29. If you are not ready to fight with yourself, to say “NO” to things you liked to do or
    which were just a habit to you then nothing on Earth will help you to get rid of those excess pounds.

    These tablets are frequently over the a hundred and fifty mark but offer you a
    considerably broader and longer lasting expertise. At the impressive number one spot
    is the Superpad 10.

  30. It is absolutely simpler over a lot of men and women believe.
    There are many new applications available for you
    to download within the market. Some manufacturers
    call their product a Cover while others use the name Case.

  31. containers says:

    What you ought to do is find a wedding marquee hire that will provide you with the cost
    effective for the money. Here are 10 easy steps you can take to lower your exposure to
    tree pollen and other spring allergens, and keep allergy symptoms under
    control. One popular bathroom fixture today that
    many interior decorators and home owners use is a shower bath.

  32. If you are not ready to fight with yourself, to say
    “NO” to things you liked to do or which were just
    a habit to you then nothing on Earth will help you to get rid
    of those excess pounds. The built quality on the XPS is also a solid one with aluminum carbon
    chassis, giving it a sturdy, premium look. The actual pc is
    usually Wi-Fi enabled and can connect to web anywhere.

  33. 3 maximum aperture, fixed lens mount, auto focus features, 2.
    four GHz which is why you want to invest in
    a jammer that can tamper this signal. Make sure you get a decent resolution LCD with any
    camera in this category.

  34. watch says:

    Good post however I was wondering if you could write a litte more on this subject?
    I’d be very grateful if you could elaborate a little bit further. Cheers!

  35. […] you are installing Ubuntu as a VM and need to share folders then this is a good link to […]

  36. Superb web site. A great deal of techniques here. I am just transmitting the item to several good friends ans furthermore giving throughout tasty. And certainly, appreciate it on your own effort!

  37. Choosing small business web hosting can be a
    challenge; there are a lot of things that you have to consider.
    There are some hosting providers that have some limitation on the FTP features and these are the companies
    that you should not consider. As each year passes, web hosting continues to get cheaper and cheaper.

  38. prada wallet says:

    ダンヒル美容室

  39. Do you mind if I quote a coouple of your posts aas long as I provide crediot
    and sources back to your website? My bloog site is in the very same niche as
    yours and my users would truly benefit from
    a lot of the information you presemt here. Please let me know if
    this alright with you.Appreciate it!

  40. Its like ƴou read my mind! Youu appear too know so much about this, like youu wrotе the book in it or
    something. I think that you can do with some
    pics to drivе thee message home a bit, but instead
    of that, this is excellent blog. An excellent гead.

    I’ll definitely be back.

  41. I like the valuable info you supply to your articles. I will bookmark your blog and test again here frequently. I’m reasonably sure I will be informed a lot of new stuff proper right here! Best of luck for the following!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: