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)
- open a console window (I am a huge fan of Yakuake)
- sudo apt-get update
- sudo apt-get dselect-upgrade
- sudo apt-get install gcc gcc+ linux-kernel-headers
- restart the VM to boot with the newest kernel
- sudo apt-get autoremove (this will remove the old kernel files and decrease your used space on the virtual drive)
- goto the Devices drop down menu for VirtualBox and select install Guest additions
- sudo mount /cdrom /media
- sudo /media/VBoxLinuxAdditions-x86.run
- 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)
- (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“
- sudo mkdir /mnt/[name you want your shared folder to have in the VM]
- mount -t vboxsf [name you gave the share in VBox] /mnt/[name you used in step 12]
- 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!
now I bet you want to know how to make it comeback after a reboot, don’t cha!
- sudo vi /etc/fstab
- “G” (uppercase letter)
- “o” (lowercase number)
- [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)
- [esc] (the escape key, probably is labeled “esc” on your keyboard in the top left corner)
- “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.))
- now reboot
- 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!!