Wednesday, September 18, 2013

Installing GuestAdditions and Setup SharedFolder for Ubuntu 12.04 in VirtualBox


Installing GuestAdditions and Setup SharedFolder for Ubuntu 12.04 in VirtualBox


1). Setup Sharedfolder.
this means we need to choose a folder from your host system that you want to share,  and add it to a shared folder list in VirtualBox like this:

2). Install VBoxguestAdditions
The simplest way is to right click on the disk icon on bottom status bar of VirtualBox, choose VBoxGuestAdditions.iso and run. so that it will be installed. after that you should reboot the system.
Also you can do this by:sudo sh /media/cdrom/VBoxLinuxAdditions.run



After reboot, you should be able to see you shared folder is add to this directory(if you folder named abc, here it should be sf_abc. 
add your username to vboxsf group so that you have access to this sf_abc folder.
sudo adduser xxx vboxsf
or 
sudo usermod -aG vboxsf xxx
where xxx is your username, you need to reboot the system so that it can take effect!

since shared folders are always in /media directory, we want to access more easily say we want to access it from desktop, we can achieve this by creating a symbolic link like this:
ln -s /media/sf_dir ~/Desktop/shared_dir
Also, we even want to jump into this directory directly when we start the system, we can achieve this by adding the following line to the end of file: ~/.bashrc 
cd ~/shared_dir
Done!

If we want to install guest additions on a Ubuntu Server, we can do this:

apt-get install --no-install-recommends virtualbox-guest-utils && apt-get install virtualbox-guest-dkms

apt-get install -- no-install-recommends virtualbox-guest-utils
apt-get install virtualbox-guest-dkms
sudo apt-get install build-essential linux-headers-$(uname -r)

No comments:

Post a Comment