access windows-host shared folders from ubuntu-guest

Upload: loroow

Post on 07-Jul-2015

79 views

Category:

Documents


0 download

TRANSCRIPT

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

www.giannistsakiris.commostly computer related stuffDedicated Server in India Fast PowerBasic Compilers

Dedicated Hosting Servers in India @ 99.95% Faster than C? Easy as Basic? No trace of Uptime SLA. Check Offers bloat - Free details ! Ctrls.in/Dedicated-Hosting-Servers www.powerbasic.com

VirtualBox: access Windows-host shared folders from Ubuntu-guestApril 9th, 2008

This is the scenario that you run Windows as your host operating system and Ubuntu in a VirtualBox, and that you want to access a specific Windows folder from Ubuntu. First you have to make sure that have install Guest Additions. From the VirtualBox's menu go to Devices Install Guest Additions... This will mount a virtual CD on your /media/cdrom. Normally this folder's window will show up. As root run the program VBoxLinuxAdditions.run. When the program completes reboot your VirtualBox. With Guest Additions installed you may now go ahead and define the shared folder(s). From the VirtualBox's menu go to Devices Shared Folders. A dialog will show up. In this dialog you can specify which folder from your Windows system you want to share with your Ubuntu. Press the button with the + symbol to add a new shared folder in the list. You will have to specify a Folder Name for each folder you add. Make sure you memorize that name because you will need it very soon. When done with you shared folder(s) specification, you may now go ahead and actually mount these folders from Ubuntu. First you have to create a mounpoint, that is, a directory in your Ubuntu which will reflect the shared folder from Windows:# sudo mkdir /media/windows-share

Of course you may choose an alternative path for your mountpoint. With your mountpoint created you can now mount the shared folder, like this:# sudo mount -t vboxsf folder-name /media/windows-share

Where folder-name will be the name you assigned for this folder when you were adding it in the shared folders list. You could use the /etc/init.d/rc.local script to execute these commands on startup to have the shared folders automatically mounted every time you start your Ubuntu VirtualBox. Posted in uncategorized |

1 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

Secure SMB Network Access Juniper.net/Smb+Network+Access Clientless Remote Network Access for Enterprises; View Free Demo!

86 Responses to VirtualBox: access Windows-host shared folders from Ubuntuguest1. Pablo Says:November 5th, 2008 at 6:48 am Very useful!!! thanks a lot for this article...

From Chile - Southamerica pamorale 2. Pindey Says:November 12th, 2008 at 9:46 am thank you so much!!!

3. Pindey Says:November 12th, 2008 at 9:49 am One question though, how do I used the " /etc/init.d/rc.local" ?

4. vastan Says:January 3rd, 2009 at 1:07 pm but in my machine, i get this message

mount: unknown filesystem type 'vboxsf' 5. D'Amico Says: January 6th, 2009 at 1:14 am This is just what I needed! I would add that the shared folder may need to be in the following directory: C:\Program Files\Sun\xVM VirtualBox 6. SeanG Says: February 2nd, 2009 at 6:58 pm Works like a CHARM. THANKS for outlining this. 7. Kaiyuan Says: February 4th, 2009 at 6:00 pm Sorry, I'm pretty new to OS stuff, so my question might be quite low level. Qn) There are several VBoxLinuxAdditions(sth).run. How do I know which one I should choose? 8. Eric Says: February 6th, 2009 at 9:29 am Great tip, thanks for sharing this! FYI this is what I added to my Ubuntu VirtualBox guest /etc/rc.local file (top section of rc.local omitted). It now connects to the shared folder automatically on startup, as the blog owner stated. Very cool! (I have _VirtualBoxShared added under Vbox menu Devices > Shared Folders. _VirtualBoxShared is the name of the actual folder on my Windows Vista host box.) The folder ubushare is what I created instead of the tutorials /media/windows-share example. # # By default this script does nothing. mount -t vboxsf _VirtualBoxShared /home/ubuntu/ubushare

2 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

exit 0 9. Ran Says:February 9th, 2009 at 4:49 am Finally, a quick solution that works! Thank you!

10. fisher Says:February 12th, 2009 at 12:56 am I've followed the guide and I still can't get this to work.

After I set up the folders I keep getting this : fisher@fisher-laptop:~$ sudo mount -t vboxsf VBShare /home/fisher [sudo] password for fisher: /sbin/mount.vboxsf: mounting failed with the error: Protocol error Can anyone help me out with this? 11. dolphin Says: February 17th, 2009 at 10:26 pm thanks for sharing this, couldn't be easier ! 12. codeamatic Says: February 19th, 2009 at 10:39 am thanks for sharing, this definitely was a quick solution to my problem... much appreciated...!!! 13. An Aspiring Person Says: February 25th, 2009 at 4:34 am I have a question... Is it possible to unmount the shared folder??? I accidentally put it in the wrong directory...I'm an ubuntu noob... 14. mj Says: March 15th, 2009 at 11:43 am thanks ,a lot ....it really workssssssss 15. Badri Says: March 19th, 2009 at 3:02 pm Thanks a lot!! Very helpful article. 16. Badri Says: March 19th, 2009 at 3:11 pm Thanks a lot!! 17. saycat Says: March 23rd, 2009 at 7:48 pm A great solution, thanks! 18. stuntpilot Says: April 7th, 2009 at 9:54 pm Great site! You really helped me with the shared folders in virtualbox. Good luck being smoke free! You made the right decision. 19. ubuntuuser Says: May 3rd, 2009 at 4:26 am mount is not working for me! but I use this command instead: mount.vboxsf NAME /PATH/TO/FOLDER 20. Paul Reinheimer Says: May 22nd, 2009 at 12:14 am Thanks for documenting this. I'm used to a few other VM tools where this is all automagic, I couldn't figgure out why it wasn't working. 21. zourtney Says: June 5th, 2009 at 8:39 am Anyone having problems might be helped be this link: http://forums.virtualbox.org/viewtopic.php?f=8&t=17827#p77284 I was initially getting something along the lines of "filesystem vboxsf unknown" but resolved it by following the steps in that post. Note: do not run "guest additions" shell script from the window manager -- use the command line. I tried running the script by double clicking on it and it did not work (permission problem, probably). Works now! 22. Alex Says:

3 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

June 15th, 2009 at 1:31 am >>I have a question... Is it possible to unmount the shared folder??? >>I

accidentally put it in the wrong directory...I'm an ubuntu noob... I had the same problem =) To unmount folder use this: sudo umount /media/windows-share where /media/windows-share - your wrong directiory Kemi Says: June 23rd, 2009 at 11:52 pm I've spent about 20 hours trying to find help on this... and found your article, which solved my issue in 2 minutes! Thanks! lunix rookie Says: July 1st, 2009 at 4:32 am as clear as crystal. Thanks Christine Says: July 22nd, 2009 at 4:13 pm This was very useful, thanks! Jimbo Says: July 24th, 2009 at 2:52 pm @fisher - Check to make sure that "vboxsf" is the name of your shared folder in "Devices > Shared Folders". That was causing the same error for me. Colin Phelps Says: August 1st, 2009 at 12:09 pm This is a great article. The only suggestion as a Linux newbie is that a detailed explanation of the sybtax would be great to get a complete understanding. Anton Says: August 11th, 2009 at 10:42 pm Glad I found this article. You saved me many hours of going throuhg the docs. Thanks ! SRib Says: September 23rd, 2009 at 4:59 pm Help a newbie How do i avoid to insert sudo mount -t vboxsf folder-name /media/windows-share every time a start ubuntu? And how to make it available at "PLACES" tks in advance 30. SRib Says:September 23rd, 2009 at 5:01 pm forgot to add

23.

24.

25. 26.

27.

28.

29.

great post :) 31. FID Says:October 3rd, 2009 at 4:28 pm Hi,

Thanks a lot! Worked great! 32. Tim Says: October 9th, 2009 at 4:05 am I had to: sudo apt-get install dkms then reinstall the guest additions, reboot and then: sudo mount -t vboxsf folder-name /media/windows-share and it worked. 33. Debasis Goswami Says:October 21st, 2009 at 7:12 pm Wonderful! It worked exactly as the article published. Helps me playing with my

Linux toy :) 34. Ankush Says:October 25th, 2009 at 12:04 pm thanks a lot. . .It's really an easy solution to the specified problem! ! ! nd ur

4 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

solution works like a charm! ! ! ! ! ! 35. mo Says: November 2nd, 2009 at 1:08 am so far that sums up my linux experience. why do i have to do something as fundamental as mounting a drive using the command line?? i don't want to go back to the DOS days, it's 2009 not 1989. could you please describe how to do this using a gui?!! 36. Duncan Says: November 4th, 2009 at 1:56 pm Nice one. I *needed* this info :) 37. donnie Says: November 7th, 2009 at 1:15 am To have the shared folder show up when you boot Ubuntu, add a line like this in /etc/fstab: folder-name /media/windows-share vboxsf uid=myusername 0 2 Don't use a startup script to mount a filesystem. 38. Glen Says: November 8th, 2009 at 2:26 am fisher, I had this problem too You need to run the command from another dir (e.g. do not run it from the /media dir) Anyways, great tutorial - Thanks! 39. Pankaj Kumar Says: November 8th, 2009 at 5:56 pm Thanks... it worked... :) 40. Chris Says: November 11th, 2009 at 8:18 am Just as an alternative - you can configure your guest network adapter as bridged. This will allow the guest to get an address on the same subnet as your host from the DHCP server. From there, you can use WinSCP to copy files back from a linux installation that has SSH set up on it. 41. Kerem Says: November 11th, 2009 at 4:52 pm Perfect Thank you it works 42. john mower Says: November 15th, 2009 at 9:12 am had to use mount.vboxsf, mount -t vboxsf wouldn't work for me. thanks! 43. Dan Says: November 21st, 2009 at 4:07 am Hi, I did the above and it works, but I can't write to it from Ubunto, it say's Permission denied. I tried to sudo chmod, sudo chown. In the virtual box I did set it to mount permanently, but did not check off readonly. In windows I did the same. I can write as root, but just not as the regular user 44. TuanAnh Says: November 24th, 2009 at 10:35 am Awesome, thank you so much! 45. MCdatashed Says: January 5th, 2010 at 2:49 am Thanks loads for this! Very easy to follow and helpful. 46. Mr T Says: January 15th, 2010 at 1:30 am Worked like a charm! Thanks! 47. Teiji Says: January 29th, 2010 at 7:10 am Thanks. Now I can share files. Also, thanks donnie for the tips. Now, to figure how to make the windows-share as a desktop shortcut.... 48. Teiji Says: January 29th, 2010 at 7:14 am "Now, to figure how to make the windows-share as a desktop shortcut.... " Nvm, ctrl+ shift drag did the trick. :) 49. neftal Says: February 4th, 2010 at 3:55 pm Good tip. Thank you. 50. Valmond Says: February 6th, 2010 at 10:17 pm Excellent, a Big Thanks!!!! 51. Georg Says: February 20th, 2010 at 9:00 pm Great!

5 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

Also works well for USB-Sticks. (I never found a way to reliably accesss them under VirtualBox.) Thanks! 52. scott Says: February 24th, 2010 at 10:33 pm thanks for the pointer. i did this and it worked flawlessly. so i got the brilliant idea to share a fat32 usb disc rather than repartition my ntfs drive (permissions issues with ntfs not fun). so i shared my empty usb disc and mounted it, but i couldn't ls on the disc. said: "/bin/ls: cannot open directory .: Operation not permitted." what the? it worked 2 minutes ago! it seems the disc IS working, but for some reason ls fails on an empty disc. so i created a text file: vi hi.txt i edited and saved the file. worked fine. i was then able to ls on the top-level directory. 53. Pranav Says: March 4th, 2010 at 8:41 am Thanks ... It really helped me to mount a windows shared box on Ubuntu 54. subodh Says: March 18th, 2010 at 10:21 pm Really simple and nice blog 55. Pssh Says: April 13th, 2010 at 11:49 pm Why in the world does this require us to use the command line? Ridiculous. Make it show up as a virtual thumb drive or something. 56. Junix Says: May 1st, 2010 at 3:06 am If you're root ("#" signal is showed), why do you proceed sudo command? 57. Mondrok Says: May 19th, 2010 at 12:31 am Thank you. Worked great! @Teiji: Thanks for the "ctrl+ shift drag" tip! 58. Vicer Says: May 31st, 2010 at 4:07 am Thank you very much. Worked like a charm. 59. David Says: June 19th, 2010 at 4:43 am Thank you a lot for this. VirtualBox configuration is confusing. You were clear and it works perfectly. Congratulations! 60. David Says:June 19th, 2010 at 4:45 am I typed "configuration" meaning "documentation" lol

I'm sorry, I'm too sleepy :P 61. Matthew Says: June 21st, 2010 at 2:55 am I can see the entire c: drive when I do an ls -la ~/shared. but when try to cp a file to ~/shared I get "cp: cannot create regular file `/home/mrentz/shared/redmine-0.9.3.tar.gz': Protocol error." What am I doing wrong? It would be awesome to get it working now that I've got this far. Cheers! 62. Matthew Says:June 21st, 2010 at 3:03 am Forget previous message... I've figured it out and got it going. I just cd'ied into ~/shared/vboxsf (which is on the C:/ drive) and did a cp ~/path/file . boom boom and wallah!

p.s. this is my first submission to an online post "ever"!

6 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

I think you people who read and help on these things are Sooooo Coooool 63. Dustin Says: July 19th, 2010 at 11:45 pm You freakin rock... I too had to run the installation via command line though. 64. pritesh Says: July 30th, 2010 at 2:25 pm you save my time. Bunch of thanks. 65. Manish Zedwal Says: August 7th, 2010 at 12:23 am Many many thanks buddy. V.Good. 66. LS Says: August 23rd, 2010 at 11:07 pm Thanks a lot for posting this, it worked like a charm. Will link this later when I write it down on my blog. 67. sajjan Says: September 4th, 2010 at 3:38 pm thx ! 68. jitendra Says: September 10th, 2010 at 10:48 am thanxxx hey buddy can u help me in starting opensource developement under linux 69. Pranav Says: September 20th, 2010 at 4:02 pm Excellent...thanks. I followed it and worked great. I was looking for it for a while now. It works great. Thanks a lot. 70. Ming the Merciless Says: September 25th, 2010 at 1:45 am Thanks for posting - this issue seems to cause a lot of confusion. However, I do think the posters who wish to see how to mount the drive in the Ubuntu GUI. 71. Ming the Merciless Says: September 25th, 2010 at 1:47 am Thanks for posting - this issue seems to cause a lot of confusion. However, I do think the posters who wish to see how to mount the *folder* in the Ubuntu GUI. 72. Tareq Says: September 30th, 2010 at 4:35 pm thanks dude :) 73. Jarek Says: October 15th, 2010 at 3:55 pm Thanks! 74. ristarr11 Says: October 30th, 2010 at 7:35 pm Thank you! 75. Randee Ashell Says: November 26th, 2010 at 5:09 am Thank you, I have checked other tutorials and they were not successful but this one worked a charm. Thanks 76. Joseph Says: December 1st, 2010 at 4:03 pm Thanks, this is really helpful! 77. Noobulon Says: December 2nd, 2010 at 11:13 pm Ok this is great n all but... when I try to mount I get user@user-desktop:/$ sudo mount -t vboxsf PDWNLDS /home/user/pdwnlds [sudo] password for user: /sbin/mount.vboxsf: mounting failed with the error: No such file or directory User=me but not real me so WTF? Ive been working to solve this issue for 6 days now! Fracking G@Y! I have the folder shared etc and it still wont mount, been to hundereds of sites without any success and even tried to get a product to mount the virtual disk so I can just extract my fracking data...you know if all you linux people want others to use linux instead of windows...MAKE IT FRACKING SIMPLER and GUI FRIENDLY!! So tired of this l33t speak shit makes me want to puke JUST TELL WHAT THE FRACKING SOLUTION IS and GET IT OVER WITH! 78. bart Says: December 6th, 2010 at 9:29 pm @Noobulon, I had the exact same problem. What I had done wrong was I hadn't written the path correctly. I'd double check the path if I were you.

7 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

79. Ricky Jay 'Dotcom' Says:December 7th, 2010 at 8:12 am I have a problem When I install an error occured it says that "unknown file

system 'vboxsf' " By the way I'm using Ubuntu 10.10 is it because of the version or what?? please tell me about this problem immediate action is highly appreciated. :D Dotcom 80. joseph Says:December 19th, 2010 at 6:36 am Thanks! great resource...

81. bigDee Says:January 22nd, 2011 at 12:07 pm Thanks for this simplicity. It works but in my case I need to run through the whole process including installation... I am newbie... any clues? 82. swiftcarinsurance Says: January 29th, 2011 at 3:59 am How about if i'm using live cd to run ubuntu 8.04 on vbox ?, is'nt work properly..... 83. .ny Says: February 12th, 2011 at 7:33 pm Thank you for precisely showing how to do this. It works! Thanks again! I am confused on how to make changes to rc.local because it opens read-only but I'm a newbie and sure I'm doing something wrong. Probably rights related. Also, another user recommended modifying fstab instead of rc.local - not sure what the difference is and what's better. Thanks! 84. Michigan Says: February 24th, 2011 at 7:02 pm I'm running a Vista host and Kubuntu 10.10 guest. Thanks for your excellent article. I'm new to this. It only took me two days to do this. So many people have posted replies I thought I should try to remember what worked for me. I finished about midnight so it's kind of a blur but here is what I can remember. First I got errors when installing the VB Additions I copied the error into Google and found this VB forum post http://forums.virtualbox.org /viewtopic.php?t=15679 that states extra packages must be installed. After doing that VB Additions installed correctly. I created a shared folder in windows C:\AA and a shared forlder in Linux in my home dir called 'host'. I used Dolphin to create the linux folder. I had a lot of trouble with: sudo mount -t vboxsf folder-name /media/windows-share My errors were using a path for the windows 'folder-name' like \\win-pc\AA. All that's needed is the folder name 'aa'. Also, the win and linux folder names must be different. Writing to '/etc/init.d/rc.local' must be done as root. This page http://forums.virtualbox.org /viewtopic.php?t=15868 also helped change the ownership from root to me. Thanks again. 85. ECM Says: March 12th, 2011 at 10:52 pm This worked great! Thanks! 86. hitman Says: May 8th, 2011 at 7:20 am to mount the shared folder @ boot time, add the following commands in a terminal.

sudo su gedit /etc/init.d/rc.local mount -t vboxsf VMshare-win /home/hitman/Desktop/VMshare-Ubu where "VMshare-win" is the folder created in Windows host OS and "VMshare-Ubu" is the folder created on Ubuntu guest OS. note: add the last line @ the end of rc.local file.

Leave a Reply

8 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

Name (required) Mail (will not be published) (required) Website

Type the two words:

PagesPosts

ArchivesMay 2011 April 2011 January 2010 November 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 September 2008 August 2008 July 2008 May 2008 April 2008 March 2008 February 2008 January 2008 December 2007 November 2007 October 2007 September 2007

9 of 10

5/10/2011 12:26 AM

VirtualBox: access Windows-host shared folders from Ubuntu-guest http://www.giannistsakiris.com/index.php/2008/04/09/virtualbox...

August 2007 July 2007 June 2007

Categoriesuncategorized (123)

VPS - only 3 No minimum contract. Instant deploy 256MB RAM; 15GB disk; 1 TB trafficwww.newhost.ro

Dedicated Server US$119 Dual Quad-Core, 24 GB RAM, SSD 2x 1000 GB HDD, located in EU or USwww.serverloft.com

Rails Hosting Latest rails. Mongrel, passenger, any gems. Deploy now...launchtime.ri.mu/rails-hosting

Windows 2008 Hosting Latest Technology, IIS 7, ASP.NET 4 Full Support 24/7, Reliable Hostingwww.seekdotnet.com

www.giannistsakiris.com is proudly powered by WordPress Entries (RSS) and Comments (RSS).

10 of 10

5/10/2011 12:26 AM