Ubuntu 10.04, VirtualBox, and shared folders – a how to

Due to the popularity of my Fedora 12 version of this how to, I have copied it here and made the necessary changes for  (K)Ubuntu 10.04 Guests (I actually did this while making said changes so I know it works…)  :)

step by step instructions for getting shared folders to work in a Kubuntu 10.04 VM on VirtualBox (post OS installation)

  1. open a console window (I am a huge fan of Yakuake)
  2. sudo apt-get update
  3. sudo apt-get dselect-upgrade
  4. sudo apt-get install gcc gcc+ linux-kernel-headers
  5. restart the VM to boot with the newest kernel
  6. sudo apt-get autoremove (this will remove the old kernel files and decrease your used space on the virtual drive)
  7. goto the Devices drop down menu for VirtualBox and select install Guest additions
  8. sudo mount /cdrom /media
  9. sudo /media/VBoxLinuxAdditions-x86.run
  10. You will need to reboot the VM to reinitialize the HAL daemon (or manually restart the daemon if you know how; however restarting will let (K)Ubuntu auto resize your display as well)
  11. (special note, if you have already run the VBox Additions from the cd and just need  to update it, or it was not working, then skip steps 7-10 and  just type this “sudo /etc/init.d/vboxadd setup
  12. sudo mkdir /mnt/[name you want your shared folder to have in the VM]
  13. mount -t vboxsf [name you gave the share in VBox] /mnt/[name you used in step 12]
  14. then you can now access your shared host directory from your (K)Ubuntu 10.04 install in the /mnt/[name you used in step 12] folder!!!

Really not that hard, but nowhere in the documentation for VirtualBox does it tell you that you have to do all of that!

Bonus step!!

now I bet you want to know how to make it comeback after a reboot, don’t cha!

  1. sudo vi /etc/fstab
  2. G” (uppercase letter)
  3. o” (lowercase number)
  4. [name you used in VBox shared folders] [tab] [fullpath to the mount point in the VM, or #12 above] [tab] vboxsf [tab] noauto,rw [tab] 0 [tab] 0 (both of those are the number zero)
  5. [esc]  (the escape key, probably is labeled “esc” on your keyboard in the top left corner)
  6. wq!” (lowercase letters and an exclamation (sometimes called a “BANG” by unix people, older people, and those who were taught by one of the afore mentioned.))
  7. now reboot
  8. sudo mount [name you used in VBox shared folders] (you will have to do this everytime you reboot (I just do a save state, so not an issue very often) as the fstab loads the mounts BEFORE the VBox additions are run, causing a “not found” error if it is not setup this way)

Special note: the folder name from VirtualBox shared folders is normally the name of the last directory in the path, for example if you are sharing /home/[my username]/Downloads/mystuff – then your VBox shared name will be “mystuff”

Also, check out my post on getting this to work in Fedora 12!!


One thought on “Ubuntu 10.04, VirtualBox, and shared folders – a how to

Leave a Reply

1 visitors online now
0 guests, 1 bots, 0 members
Max visitors today: 8 at 03:16 am UTC
This month: 20 at 10-12-2021 11:13 am UTC
This year: 237 at 03-24-2021 09:01 pm UTC
All time: 1100 at 08-08-2011 08:11 pm UTC